@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;700;900&family=Manrope:wght@400;500;700&display=swap');

:root {
    --primary: #26854d;
    --primary-dark: #1e6a3d;
    --secondary: #546E7A;
    --tertiary: #FBC02D;
    --neutral: #F5F7F5;
    --white: #ffffff;
    --text-dark: #1a1a1a;
    --text-muted: #546E7A;
    --card-bg: rgba(255, 255, 255, 0.9);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Manrope', sans-serif;
}

body {
    background: linear-gradient(135deg, #26854d 0%, #1e6a3d 100%) fixed;
    color: var(--white);
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    padding-top: 1rem; /* Reduced to pull logo slightly up */
    display: flex;
    flex-direction: column;
    margin: 0;
}

body::before {
    content: "";
    display: block;
    width: 90px;
    height: 60px;
    background: url('../img/jti-logo.png') no-repeat center center;
    background-size: contain;
    margin: 0 auto 1rem auto; /* Reduced from 1.5rem */
}

@media (max-width: 768px) {
    body {
        padding-top: 1.5rem;
    }
    body::before {
        width: 70px;
        height: 45px;
        margin-bottom: 1rem;
    }
}

body.has-custom-bg {
    color: var(--white);
}

/* Background Animations / Gradients */
.theme-camel-yellow-tropical,
.theme-tropical,
.theme-camel-legend,
.theme-winston-xstyle,
.theme-legend {
    background: linear-gradient(135deg, #26854d 0%, #13522e 100%) fixed !important;
}

/* Theme Overrides (Unified) */
.title {
    font-family: 'Lexend', sans-serif;
    color: var(--text-dark);
    text-shadow: none;
}

.option.selected {
    background: var(--primary) !important;
    color: var(--white) !important;
}

/* Common UI Elements */
.screen {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Move from center to top by default to tighten gap */
    align-items: center;
    flex: 1; /* Take remaining space */
    padding: 1rem 2rem 2rem 2rem; /* Less padding on top */
    text-align: center;
    width: 100%;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    color: var(--text-dark);
}

body.has-custom-bg .card {
    background: var(--card-bg);
    color: var(--text-dark);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

body.has-custom-bg .title {
    color: #fff;
}

.btn {
    display: block;
    width: 100%;
    padding: 1.2rem;
    border: none;
    border-radius: 12px;
    font-family: 'Lexend', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: scale(0.98);
}

/* Tropical/Unified Buttons */
.btn-tropical,
.btn-legend {
    background-color: var(--primary);
    color: var(--white);
}

.btn-tropical:hover,
.btn-legend:hover {
    background-color: var(--primary-dark);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    color: var(--text-dark);
    font-size: 1.1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Quiz Options */
.option {
    display: block;
    width: 100%;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.2rem;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    text-align: left;
    color: var(--text-dark);
}

.option:hover {
    background: #f8faf8;
    transform: translateY(-2px);
    border-color: var(--primary);
}

.option.selected {
    background: var(--primary);
    color: var(--white);
    transform: scale(0.98);
    border-color: var(--primary);
}

/* Theme specific overrides */


/* Legend Theme Overrides (Unifying with new Green Theme) */
.theme-legend .title {
    color: var(--primary);
}

.theme-legend .form-group input {
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

.theme-legend .btn-legend {
    background-color: var(--primary);
    color: var(--white);
}

.theme-legend .option {
    background: var(--white);
    color: var(--text-dark);
}

/* ========================================
   MOBILE RESPONSIVE (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    .screen {
        padding: 1rem;
        min-height: 100vh;
        min-height: 100dvh;
        /* Dynamic viewport height for mobile browsers */
    }

    .card {
        padding: 1.5rem;
        border-radius: 18px;
        max-width: 100%;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    }

    .title {
        font-size: 1.8rem;
        margin-bottom: 1.2rem;
        letter-spacing: 1px;
    }

    .btn {
        padding: 1rem;
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }

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

    .form-group input {
        padding: 0.85rem;
        font-size: 1rem;
    }

    .option {
        padding: 1.1rem;
        border-radius: 12px;
        margin-bottom: 0.8rem;
        font-size: 0.95rem;
    }

    .theme-legend .title {
        font-size: 1.6rem;
    }

    .theme-legend .btn-legend {
        padding: 1.1rem;
        font-size: 1.2rem;
    }
}

/* Extra small phones (max-width: 400px) */
@media (max-width: 400px) {
    .screen {
        padding: 0.75rem;
    }

    .card {
        padding: 1.2rem;
        border-radius: 14px;
    }

    .title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .btn {
        padding: 0.9rem;
        font-size: 1rem;
    }

    .form-group input {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .option {
        padding: 0.9rem;
        font-size: 0.9rem;
    }
}

/* Promoter Floating Button */
.promoter-floating-btn {
    position: fixed;
    bottom: 15px;
    right: 15px;
    background: var(--white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 6px 16px;
    border-radius: 20px;
    color: var(--text-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    z-index: 9999;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.promoter-floating-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    opacity: 1;
    transform: translateY(-1px);
}

.promoter-name {
    font-weight: 400;
}

@media (max-width: 768px) {
    .promoter-floating-btn {
        bottom: 10px;
        right: 10px;
        padding: 3px 10px;
        font-size: 0.6rem;
    }
}

/* ========================================
   MODAL / LIGHTBOX
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dark);
    text-align: left;
}

.modal-close {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: var(--text-dark);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ========================================
   CUSTOM CHECKBOX (MOBILE FRIENDLY)
   ======================================== */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
    cursor: pointer;
    text-align: left;
    user-select: none;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    min-width: 28px;
    height: 28px;
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: 8px;
    position: relative;
    transition: all 0.2s;
}

.checkbox-container:hover .checkmark {
    background: #f1f8f1;
}

.checkbox-container input:checked+.checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.theme-winston-xstyle .checkbox-container input:checked+.checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 9px;
    top: 5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked+.checkmark:after {
    display: block;
}

.checkbox-label {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 500;
}

.checkbox-label a,
button[onclick*="open"] {
    color: var(--primary) !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

/* Home Page Overrides (targeting elements in index.php) */
.side-camel {
    background: linear-gradient(135deg, #26854d 0%, #207241 100%) !important;
}

.side-winston {
    background: linear-gradient(135deg, #1e6a3d 0%, #17522f 100%) !important;
    border-top: 1px solid rgba(255,255,255,0.1) !important;
}

.side h2 {
    font-family: 'Lexend', sans-serif !important;
    color: #fff !important;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
}

.brand-logo {
    color: #fff !important;
    opacity: 1 !important;
}

.overlay-text {
    font-family: 'Lexend', sans-serif !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
}

/* Global Store Bar */
.active-store-bar {
    position: fixed;
    bottom: 20px; 
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6); /* Slightly darker for bottom visibility */
    color: rgba(255,255,255,0.9);
    padding: 10px 20px;
    display: flex;
    gap: 15px;
    border-radius: 40px;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    z-index: 9999;
    font-size: 0.8rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
@media (max-width: 480px) {
    .active-store-bar {
        font-size: 0.7rem;
        padding: 8px 15px;
        bottom: 15px;
        gap: 10px;
    }
}
.active-store-bar a {
    color: #fff;
    text-decoration: none;
    font-weight: normal;
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    transition: 0.3s;
}
.active-store-bar a:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}