:root {
    --primary-color: #D4DE95;
    --secondary-color: #ffffff;
    --accent-color: #636B2F;
    --text-color: #3D4127;
    --muted-color: #6b6e51;
    --success-color: #636B2F;
    --danger-color: #ef4444;
    --glass-bg: rgba(212, 222, 149, 0.9);
    --glass-border: #BAC095;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Modern Clean Card */
.glass-card {
    background: var(--secondary-color);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Auth Pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #BAC095 0%, #D4DE95 100%);
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

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

.logo-container img {
    max-width: 120px;
    border-radius: 50%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

h1,
h2,
h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    /* Use dark text for headers in light theme for better readability */
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.875rem;
}

input,
select,
textarea {
    width: 100%;
    background: #fbfcf4;
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    outline: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

input:focus,
select:focus {
    border-color: var(--accent-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 107, 47, 0.1);
}

select option {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 10px;
}

/* Fix for disabled/placeholder options visibility */
select:disabled {
    opacity: 0.6;
    background: #e2e8f0;
    cursor: not-allowed;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: #4a5123;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: white;
    color: var(--text-color);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background-color: #f8fafc;
}

.btn:hover {
    opacity: 1;
    /* Override old opacity hover */
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    width: auto;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
}

/* Navigation */
nav {
    background: var(--secondary-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

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

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--accent-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.mobile-menu-toggle:hover {
    background: rgba(186, 192, 149, 0.2);
}

.nav-links a {
    color: var(--muted-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-color);
    background: rgba(186, 192, 149, 0.2);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

.dropdown:hover .dropdown-toggle,
.dropdown.active .dropdown-toggle {
    color: var(--accent-color);
    background: rgba(186, 192, 149, 0.2);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--secondary-color);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    margin-top: 0;
    padding-top: 0.5rem;
    /* Invisible bridge due to padding */
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.dropdown-menu a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-color) !important;
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: #f8fafc;
    color: var(--accent-color) !important;
    padding-left: 1.25rem;
    /* Subtle slide effect */
}

.dropdown-menu a.active {
    background: rgba(186, 192, 149, 0.2);
    color: var(--accent-color) !important;
    font-weight: 600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--glass-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--secondary-color);
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: #fbfcf4;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover td {
    background-color: #fbfcf4;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .nav-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
    }

    .nav-brand-box {
        padding: 0.5rem 1rem;
    }

    .nav-links {
        display: none;
        width: 100%;
        order: 3;
        margin-top: 0;
        gap: 0;
        background: var(--secondary-color);
        border-top: 1px solid var(--glass-border);
    }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-links a,
    .dropdown-toggle {
        font-size: 1rem;
        padding: 1rem 1.5rem;
        width: 100%;
        justify-content: flex-start;
        border-radius: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-user-info {
        margin: 0 !important;
        padding: 1rem 1.5rem !important;
        border-left: none !important;
        border-top: 1px solid var(--glass-border);
        justify-content: space-between;
    }

    .dropdown {
        display: block;
        width: 100%;
    }

    .dropdown.active-mobile .dropdown-menu {
        display: block;
        position: static;
        width: 100%;
        box-shadow: none;
        padding-left: 2rem;
        border: none;
        margin-top: 0;
        background: rgba(0, 0, 0, 0.02);
        animation: none;
    }
}

/* Modal for Preview */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Lighter backdrop */
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--secondary-color);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

.modal-header h3 {
    margin-bottom: 0;
}

.modal-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.close-modal {
    color: var(--muted-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

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

/* Mobile App & Responsive Layout for Lottery Entry */
.entry-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.entry-sidebar {
    flex: 0 0 280px;
    padding: 1.5rem;
    border-left: 5px solid var(--primary-color);
}

.entry-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

/* Mobile adjustments */
@media (max-width: 992px) {
    .entry-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .entry-sidebar {
        flex: 0 0 auto;
        width: 100%;
        border-left: none;
        border-top: 5px solid var(--primary-color);
        padding: 1rem;
    }

    .entry-main {
        width: 100%;
        gap: 0.5rem;
    }

    /* Improve touch targets */
    select,
    input,
    .btn {
        min-height: 48px;
        font-size: 16px;
        /* prevent zoom on iOS */
    }

    /* Better table scrolling */
    .table-container {
        max-height: 400px !important;
    }

    /* Make table rows more compact or card-like if needed */
    td,
    th {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    /* Hide Brand Name on Mobile to save space */
    .nav-content>div:first-child span {
        display: none;
    }

    .hide-mobile {
        display: none !important;
    }

    /* Ensure high specificity for nav links */
    .nav-links a.hide-mobile,
    .dropdown.hide-mobile {
        display: none !important;
    }
}

.hide-mobile-force {
    display: none !important;
}