/* ===================================================================
   NEW MODERN STYLES (v2) - COMPLETE
   This file now contains ALL styles for the entire site.
   ==================================================================== */

/* --- 1. Root Variables & Base Setup --- */
:root {
    --primary-color: #007BFF; /* A vibrant blue for main actions */
    --primary-green: #28a745; /* Green for success/positive actions */
    --primary-red: #dc3545; /* Red for danger/errors */
    --secondary-color: #6c757d; /* For secondary buttons, subtle text */
    --background-light: #f4f7f6; /* Light background for the overall page */
    --card-background: rgba(255, 255, 255, 0.9); /* Slightly transparent white for glass effect */
    --border-color: #e1e8ed; /* Light border for cards, inputs */
    --text-color: #34495e; /* Darker text for readability */
    --subtle-text-color: #7f8c8d; /* Lighter text for descriptions, small notes */
    --focus-ring-color: rgba(0, 123, 255, 0.4); /* Focus outline for accessibility */
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.08); /* Light shadow for depth */
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.12); /* Medium shadow for modals */

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-light);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* overflow-x: hidden;  <-- removed on purpose so transforms can animate without clipping */
}

.modern-container {
    max-width: 960px;
    margin: 20px auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box; /* Include padding in width */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 700;
}

p {
    margin-bottom: 10px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Utility Classes */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

/* --- Navigation --- */
.modern-nav {
    background: linear-gradient(90deg, #007BFF, #00C897); /* Gradient background */
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-menu li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: color 0.2s ease;
}

.nav-menu li a:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 2px;
    background-color: white;
    transition: width 0.3s ease-out;
}

.nav-menu li a:hover::after,
.nav-menu li a.active::after {
    width: 100%;
}

.nav-menu .nav-user {
    color: white;
    font-weight: 500;
}

/* --- Mobile Navigation (Hamburger) --- */
.hamburger-menu {
    display: none; /* Hidden by default on larger screens; shown via media query */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    z-index: 3100; /* Above regular nav */
}

.hamburger-menu .bar {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Off-canvas menu styles (uses transform for robust hiding) */
.off-canvas-menu {
    position: fixed;
    top: 0;
    right: 0;                    /* keep element aligned to the right edge */
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #007BFF, #00C897);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    padding-top: 80px;
    transition: transform 0.35s cubic-bezier(.2,.9,.2,1), opacity 0.25s;
    z-index: 3000;               /* higher than header to guarantee it's on top */
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;

    /* start off-screen using transform */
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;        /* don't let it catch clicks when closed */
    -webkit-overflow-scrolling: touch;
}

.off-canvas-menu.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.off-canvas-menu li {
    padding: 15px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.off-canvas-menu li:last-child {
    border-bottom: none;
}

.off-canvas-menu li a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    display: block;
    width: 100%;
    font-weight: 500;
}

.off-canvas-menu li a:hover {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
}

.off-canvas-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* --- Page Header --- */
.modern-header {
    background-color: #fff;
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.modern-header h1 {
    font-size: 2.8rem;
    color: var(--text-color);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.modern-header p {
    font-size: 1.1rem;
    color: var(--subtle-text-color);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Cards / Glass Effect --- */
.glass-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(8px); /* Frosted glass effect */
    border: 1px solid rgba(255, 255, 255, 0.3); /* Lighter border */
}

/* --- Alerts --- */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
.alert-success h4 { color: #155724; }

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}
.alert-danger h4 { color: #721c24; }

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}
.alert-warning h4 { color: #856404; }

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}
.alert-info h4 { color: #0c5460; }

/* --- Buttons --- */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    color: white;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
    text-decoration: none;
    color: white; /* Ensure text remains white on hover */
}

.btn-primary {
    background: var(--primary-color);
}
.btn-primary:hover {
    background: #0069d9;
}

.btn-success {
    background: var(--primary-green);
}
.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--primary-red);
}
.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: var(--secondary-color);
}
.btn-secondary:hover {
    background: #5a6268;
}

.btn-full-width {
    width: 100%;
    margin-top: 15px;
}

.btn-submit {
    background: linear-gradient(45deg, var(--primary-green), #00C897);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 25px;
}

.btn-submit:hover {
    background: linear-gradient(45deg, #218838, #00B180);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* --- Forms --- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--text-color);
    background-color: white;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box; /* Include padding in width */
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring-color);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #007BFF, #00C897); /* Full screen gradient */
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    text-align: center;
}

.auth-header {
    font-size: 2.2rem;
    margin-bottom: 30px;
    color: var(--text-color);
}

.auth-link {
    margin-top: 25px;
    font-size: 0.95rem;
    color: var(--subtle-text-color);
}

.auth-link a {
    font-weight: 600;
}

.password-container {
    position: relative;
}

.password-container .form-control {
    padding-right: 45px; /* Make space for the button */
}

.toggle-password {
    position: absolute;
    right: 1px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    color: var(--subtle-text-color);
    font-size: 1rem;
    z-index: 2; /* Ensure it's above the input */
}

.toggle-password:focus {
    outline: none;
}

.toggle-password .eye-icon {
    font-size: 1.1em;
}

/* OTP Section Specific Styles */
.otp-section {
    display: none; /* Hidden by default */
    background: #fdfdfd;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.otp-input {
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 5px;
    padding-left: 10px; /* Adjust for letter spacing */
}

.countdown {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-red);
    margin-top: 10px;
}

.resend-otp {
    margin-top: 15px;
    text-align: center;
}

.success-message {
    padding: 15px;
    background-color: #e6ffed;
    color: #1a6d34;
    border: 1px solid #b3e6c3;
    border-radius: var(--radius-md);
    margin-top: 20px;
    font-weight: 600;
}

/* Dashboard Specific Styles */
.amount-display {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #00C897, #007BFF);
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
}

.amount-display .label {
    font-size: 1.1em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.amount-display .amount {
    font-size: 3.5em;
    font-weight: 700;
    line-height: 1;
}

/* Tables */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
    border-radius: var(--radius-md);
    overflow: hidden; /* Ensures rounded corners */
    box-shadow: var(--shadow-light);
}

.modern-table th,
.modern-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.modern-table th {
    background-color: #f2f5f7;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    font-size: 0.9em;
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

.modern-table tbody tr:hover {
    background-color: #f8fbfd;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
}

.status-approved { background-color: #e6ffe6; color: #1a6d34; } /* Light green */
.status-pending { background-color: #fff3cd; color: #856404; } /* Light yellow */
.status-denied { background-color: #f8d7da; color: #721c24; } /* Light red */
.status-outstanding { background-color: #ffe6e6; color: #cc0000; } /* Slightly darker red */
.status-repaid { background-color: #d1ecf1; color: #0c5460; } /* Light blue */
.status-overdue { background-color: #f8d7da; color: #721c24; } /* red */

/* Apply page specific */
.amount-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.amount-input-container .currency-symbol {
    position: absolute;
    left: 15px;
    color: var(--subtle-text-color);
    font-size: 1.2rem;
    font-weight: 600;
    z-index: 1;
}

.amount-input-container .amount-input {
    padding-left: 35px; /* Make space for the currency symbol */
    text-align: left;
    font-size: 1.2rem;
    font-weight: 600;
}

.terms-highlight {
    background: #eaf7f2;
    border: 1px solid #d0f0e0;
    border-left: 5px solid var(--primary-green);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 25px;
    color: #34495e;
}

.terms-highlight strong {
    color: #1a6d34;
    font-size: 1.1em;
    display: block;
    margin-bottom: 10px;
}

.terms-highlight ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.terms-highlight li {
    margin-bottom: 8px;
    padding-left: 25px;
    position: relative;
    font-size: 0.95em;
}

.terms-highlight li::before {
    content: '•';
    color: var(--primary-green);
    position: absolute;
    left: 0;
    font-size: 1.2em;
    line-height: 1;
    top: 0;
}

.agreement-box {
    background: #fcfcfc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-top: 30px;
    max-height: 400px; /* Fixed height for scrollability */
    overflow-y: auto; /* Enable vertical scrolling */
    margin-bottom: 25px;
    box-shadow: inset 0 1px 5px rgba(0,0,0,0.05);
}

.agreement-box h4 {
    text-align: center;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agreement-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #e1e8ed;
}

.agreement-section:last-child {
    border-bottom: none;
}

.agreement-section h5 {
    font-size: 1.05rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

.agreement-section p {
    font-size: 0.9rem;
    color: var(--subtle-text-color);
    line-height: 1.6;
}

.signature-line {
    text-align: right;
    font-style: italic;
    font-size: 0.85rem;
    color: #555;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px dashed #e1e8ed;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    margin-top: 25px;
    padding: 15px;
    background-color: #f7f9fb;
    border: 1px solid #e1e8ed;
    border-radius: var(--radius-md);
}

.checkbox-group input[type="checkbox"] {
    margin-right: 15px;
    min-width: 18px;
    min-height: 18px;
    cursor: pointer;
    transform: translateY(2px); /* Align checkbox with text */
}

.checkbox-group label {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.5;
    cursor: pointer;
}

.checkbox-group label strong {
    color: var(--primary-green);
}

/* Profile specific */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.profile-grid > div {
    background: white;
    padding: 25px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
}

.file-info {
    font-size: 0.9em;
    color: var(--subtle-text-color);
    margin-top: 5px;
}

.file-info.required-note {
    color: var(--primary-red);
    font-weight: 600;
}

#camera-container {
    background-color: #333;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 15px;
    display: none; /* Hidden by default */
}

#live-video-feed {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
}

#selfie-preview {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 10px;
    display: block;
}

#selfie-status {
    font-size: 0.9em;
    color: var(--subtle-text-color);
    margin-top: 10px;
}

/* Repay Page Specific */
.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.payment-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.payment-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.payment-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.payment-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
}

.payment-description {
    font-size: 0.95rem;
    color: var(--subtle-text-color);
    margin-bottom: 20px;
    flex-grow: 1; /* Pushes button to bottom */
}

.payment-btn {
    width: 100%;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    color: white;
}

.payment-card.ecocash .payment-btn {
    background-color: #00A352; /* EcoCash Green */
}
.payment-card.ecocash .payment-btn:hover {
    background-color: #008744;
}

.payment-card.innbucks .payment-btn {
    background-color: #8C479B; /* InnBucks Purple */
}
.payment-card.innbucks .payment-btn:hover {
    background-color: #713c7f;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    display: none; /* Hidden by default */
}

.modal-content {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-medium);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--subtle-text-color);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: var(--text-color);
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.instructions-box {
    background: var(--light-color, #fff);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    margin: 15px 0;
    text-align: left;
}

/* ===================================================================
   RESPONSIVE MEDIA QUERIES - FIXED
   ==================================================================== */

/* Hide off-canvas on large screens (desktop) */
@media (min-width: 769px) {
    .off-canvas-menu {
        display: none !important;
    }
}

/* Mobile Nav Breakpoint: <= 768px */
@media (max-width: 768px) {
    /* Hide desktop links, show hamburger */
    .modern-nav .nav-menu {
        display: none;
    }

    .hamburger-menu {
        display: flex;   /* show hamburger on mobile */
        z-index: 3100;   /* keep it above header / content */
    }

    /* smaller header text on mobile */
    .modern-header h1 {
        font-size: 2rem;
    }
    .modern-header p {
        font-size: 1rem;
    }

    /* stack grids on mobile */
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .payment-method-grid {
        grid-template-columns: 1fr;
    }

    /* reduce padding for mobile cards */
    .glass-card,
    .auth-card {
        padding: 1.5rem;
    }

    /* flatter table on mobile */
    .modern-table {
        box-shadow: none;
    }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
    .modern-container {
        padding: 1rem;
    }
    .modern-header {
        padding: 2rem 1rem;
    }
    .modern-nav .nav-container {
        padding: 0 1rem;
    }
    .auth-card {
        padding: 1rem;
    }
    .modern-header h1 {
        font-size: 1.8rem;
    }
    .amount-display .amount {
        font-size: 2.5em;
    }

    /* slightly narrower off-canvas on very small phones */
    .off-canvas-menu {
        width: 220px;
    }
}
/* Add this to your modern-styles.css file */
.nav-logo:hover::after {
    width: 0 !important;
}

.nav-logo::after {
    display: none !important;
}

.nav-logo {
    text-decoration: none !important;
}

.nav-logo:hover {
    text-decoration: none !important;
}
