/* General Body Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Notification Banner */
#notification-banner {
    display: none;
    background-color: #007bff;
    color: white;
    text-align: center;
    padding: 1rem;
    position: relative;
}

#notification-banner p {
    margin: 0;
}

#notification-banner button {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Header and Navigation */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #007bff;
    text-decoration: none;
}

nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
}

nav ul li {
    display: inline-block;
    margin-left: 20px;
}

nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover, nav a.active {
    color: #007bff;
}

#logoutButton {
    background-color: #dc3545;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    display: none; /* Hidden by default */
    border: none; /* Ensure no default border */
    cursor: pointer; /* Add cursor pointer */
}

#logoutButton:hover {
    background-color: #c82333; /* Darker shade on hover */
}

/* Page Layout */
.page-container {
    padding: 2rem 0;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
}

/* Sections */
.auth-section,
.file-upload-section,
.conversion-history-section,
.info-section {
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

h2 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    color: #333; /* Ensure text is visible */
    background-color: #fff; /* Explicitly set background to white */
}

option {
    color: #333; /* Ensure option text is visible */
    background-color: #fff; /* Explicitly set background to white */
}

input:focus,
select:focus {
    border-color: #007bff;
    outline: none;
}

button {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

.button-container,
.upload-button-container,
.convert-button-container {
    text-align: center;
    margin-top: 1rem;
}

/* Specific Sections */
.storage-indicator {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    display: none; /* Initially hidden */
}

.progress-bar-container {
    background-color: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    width: 80%;
    margin: 0.5rem auto; /* Center the progress bar */
}

.progress-bar {
    height: 20px;
    background-color: #28a745;
    width: 0%;
    transition: width 0.4s ease;
}

#historyList {
    list-style: none;
    padding: 0;
    max-height: 400px; /* Limit the height of the history list */
    overflow-y: auto; /* Add a scrollbar if the content overflows */
}

#historyList li {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}

/* Footer */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

footer a {
    color: #00aaff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
    }

    nav ul li {
        margin: 10px 0;
        width: 100%;
        text-align: left;
    }

    .logo {
        margin-bottom: 1rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    #notification-banner {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    #notification-banner button {
        font-size: 1.2rem;
        right: 10px;
    }

    .container {
        width: 95%;
    }

    button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

.file-upload-section {
    display: none; /* Initially hidden */
}

.conversion-history-section {
    display: none; /* Initially hidden */
}

#registerPlan {
    margin-bottom: 1rem; /* Add space below the dropdown */
}

#loginPassword {
    margin-bottom: 1rem; /* Add space below the password field */
}

#registerPassword+p {
    margin-top: -0.8rem;
    margin-bottom: 1rem;
}

#registerEmail+p {
    margin-top: -0.8rem;
    margin-bottom: 1rem;
}

.auth-section h2 {
    margin-top: 2rem; /* Add space between Register and Login sections */
}

.auth-section h2:first-of-type {
    margin-top: 0; /* No extra space above the first h2 */
}

#uploadStatus,
#conversionStatus {
    text-align: center;
    margin-top: 1rem;
    font-weight: 500;
}

#targetFormatSelect {
    margin-top: 1rem; /* Space above the format selector */
}

#fileInput {
    display: block;
    margin: 0 auto; /* Center the file input */
}

.storage-indicator h3 {
    margin-top: 0;
    text-align: center;
}

#storageText {
    text-align: center;
    margin-top: 0.5rem;
}

.conversion-history-section h2 {
    text-align: center;
}

/* Style for the scrollbar */
#historyList::-webkit-scrollbar {
    width: 8px;
}

#historyList::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#historyList::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#historyList::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.download-btn {
    background-color: #28a745; /* A green color */
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 10px; /* Space from the text */
}

.download-btn:hover {
    background-color: #218838; /* Darker green on hover */
}

.delete-btn {
    background-color: #dc3545; /* A red color */
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 10px; /* Space from the text */
}

.delete-btn:hover {
    background-color: #c82333; /* Darker red on hover */
}

.ad-space,
.ad-space-bottom {
    /* Initially hidden, but occupies space */
    visibility: hidden;
}

.ad-space:not(.hidden),
.ad-space-bottom:not(.hidden) {
    visibility: visible;
}

.hidden {
    display: none;
}

.ad-container {
    margin-bottom: 2rem;
    text-align: center;
}

.ad-container-bottom {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    background-color: #f8f9fa;
    text-align: center;
    padding: 5px 0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 1001;
    position: relative; /* Add this */
}

.close-ad-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #000;
}