/* Global Styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-y: auto;
}

/* Page Layout */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Top Navigation Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    flex-wrap: wrap;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100%;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.lang-select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
}

.welcome-text {
    color: white;
    font-size: 0.9rem;
    white-space: nowrap;
}

.logout-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    cursor: pointer;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}


/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

/* Glassmorphism Container */
.container {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 3rem;
    width: calc(100% - 40px);
    max-width: 500px;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

p.subtitle {
    color: #e0e0e0;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Form Elements */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    transform: translateY(-2px);
}

.upload-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 1rem;
    display: block;
}

.upload-text {
    color: #fff;
    font-weight: 500;
}

/* Button */
button.submit-btn {
    margin-top: 2rem;
    background: #fff;
    color: #764ba2;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

button.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #f0f0f0;
}

button.submit-btn:active {
    transform: translateY(1px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer/Credit */
.footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Selected File Display */
#file-name {
    margin-top: 1rem;
    color: #fff;
    font-style: italic;
    min-height: 1.5em;
    /* reserve space */
}

/* Additional Form Elements for Order Extraction */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    /* Increased padding */
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.15);
    /* Slightly more opaque */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    /* Softer corners */
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    appearance: none;
    /* Remove default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right .7em top 50%;
    background-size: .65em auto;
}

select option {
    background-color: #667eea;
    /* Solid background for options */
    color: #fff;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
textarea:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

label {
    display: block;
    text-align: left;
    margin-bottom: 5px;
    color: #fff;
    font-weight: 500;
}

/* Table Styles */
.table-container {
    margin-top: 30px;
    overflow-y: auto;
    /* Vertical scroll */
    overflow-x: auto;
    /* Horizontal scroll */
    max-height: 500px;
    /* Limit height */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
    /* Custom Scrollbar for container */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) rgba(255, 255, 255, 0.1);
}

.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: separate;
    /* Required for sticky header border */
    border-spacing: 0;
    color: #fff;
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    /* Vertical line */
}

th:last-child,
td:last-child {
    border-right: none;
    /* Remove right border for last column */
}

th {
    background: rgba(255, 255, 255, 0.95);
    /* Solid-like opaque background */
    color: #333;
    /* Dark text for contrast against white header */
    backdrop-filter: blur(10px);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* Shadow for separation */
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Download Button & Link Styles */
a.download-btn {
    display: inline-block;
    background: rgba(40, 167, 69, 0.8);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

a.download-btn:hover {
    background: rgba(40, 167, 69, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.back-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #fff;
    text-decoration: underline;
}

.nav-btn {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.error-message {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: 5px;
    text-align: left;
}

.help-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
    text-align: left;
}

@media (max-width: 768px) {
    .top-bar {
        padding: 10px;
        gap: 8px;
        row-gap: 8px;
    }

    .content-area {
        padding: 10px 0;
    }

    .container {
        padding: 1.5rem;
        width: calc(100% - 20px);
        border-radius: 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .upload-area {
        padding: 1rem;
    }

    .upload-icon {
        font-size: 2rem;
    }

    /* Stack radio buttons on mobile if needed or keep flex row but wrap */
    .radio-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px !important;
    }

    .table-container {
        padding: 5px;
    }

    th,
    td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    /* Results download buttons stack on mobile */
    .results-section [style*="display: flex"] {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .top-bar {
        gap: 8px;
        padding: 8px;
        font-size: 0.85rem;
    }

    .content-area {
        padding: 5px 0;
    }

    .container {
        padding: 1rem;
        width: calc(100% - 16px);
        border-radius: 12px;
    }

    h1 {
        font-size: 1.5rem;
    }

    p.subtitle {
        font-size: 0.9rem;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px;
        /* Prevent iOS zoom */
        padding: 10px;
    }

    button.submit-btn {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }

    .nav-btn {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .back-link {
        font-size: 0.85rem;
    }
}

/* Authentication Links */
.auth-link {
    display: block;
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* Password Toggle Styles */
.password-wrapper {
    position: relative;
    display: block;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"].password-visible {
    padding-right: 40px;
    /* Make space for the eye icon */
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    z-index: 10;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #fff;
}

/* ========== About Page Styles ========== */

.about-container {
    max-width: 800px;
    text-align: left;
}

.about-hero {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.about-hero h1 {
    font-size: 2rem;
    line-height: 1.3;
}

.about-section {
    margin-bottom: 2.5rem;
}

.about-section h2 {
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.about-section h2 i {
    font-size: 1.2rem;
    opacity: 0.8;
}

.about-text {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-size: 1rem;
}

/* Feature Cards */
.feature-cards {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 0.8rem;
    opacity: 0.9;
}

.feature-card h3 {
    color: #fff;
    font-size: 1.15rem;
    margin: 0 0 0.5rem 0;
}

.feature-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 0.8rem 0;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    color: rgba(255, 255, 255, 0.85);
    padding: 6px 0;
    font-size: 0.92rem;
    line-height: 1.5;
}

.feature-list li i {
    color: #a8e6a3;
    margin-right: 8px;
    font-size: 0.85rem;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.step-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.step-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.step-number {
    position: absolute;
    top: -10px;
    left: -10px;
    background: #fff;
    color: #764ba2;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.step-icon {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 0.8rem;
    opacity: 0.9;
}

.step-card h3 {
    color: #fff;
    font-size: 1rem;
    margin: 0 0 0.4rem 0;
}

.step-card p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    padding: 15px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.05);
}

.faq-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.faq-item.open .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 200px;
    padding: 0 18px 15px;
}

.faq-answer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* CTA */
.about-cta {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.about-cta h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    justify-content: center;
}

/* About Page Navigation Link */
.about-nav-link {
    display: inline-block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
    margin-top: 15px;
}

.about-nav-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* About page mobile overrides */
@media (max-width: 768px) {
    .about-container {
        max-width: 100%;
    }

    .about-hero h1 {
        font-size: 1.6rem;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .about-section h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .about-hero h1 {
        font-size: 1.3rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .step-card {
        padding: 1rem;
    }

    .faq-question {
        font-size: 0.88rem;
        padding: 12px 14px;
    }
}