/* =========================================
   VARIABLES & GLOBAL RESET
   ========================================= */
:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --text-color: #333333;
    --text-light: #666666;
    --bg-light: #F9FAFB;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   LOGIN PAGE STYLES
   ========================================= */
.login-page {
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 480px;
    padding: 20px;
}

.login-container {
    text-align: center;
}

/* Logo Styles */
.logo {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 2rem;
    letter-spacing: -1px;
}

.logo-pix {
    color: var(--primary-color);
}

.login-box {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #111827;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Form Styles */
.login-form {
    text-align: left;
}

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

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #D1D5DB;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.login-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background: var(--primary-dark);
}

.secure-badge {
    margin-top: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #4CAF50;
    background: #f0fdf4;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.login-footer {
    font-size: 0.85rem;
    color: #9CA3AF;
}

.login-footer a {
    color: #9CA3AF;
    text-decoration: none;
    margin: 0 0.5rem;
}

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

/* =========================================
   APP & PAGE STYLES (RECREATED)
   ========================================= */

/* =========================================
   APP & ASSESSMENT STYLES
   ========================================= */

/* Header */
.evaluation-header {
    background: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #E5E7EB;
    position: sticky;
    top: 0;
    z-index: 100;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: #f0f2f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4CAF50;
    /* Green Icon */
}

.greeting-text {
    font-size: 1rem;
    font-weight: 800;
    color: #000;
}

.balance-btn {
    background: #4CAF50;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    /* Slightly squarer than before */
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
    border: none;
}

/* Progress Bar */
.progress-section {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.progress-container {
    background: #f0f0f0;
    height: 12px;
    /* Thicker */
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
}

.progress-bar {
    background: #4CAF50;
    height: 100%;
    width: 0%;
    border-radius: 10px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #F3F4F6;
    color: #1F2937;
    padding-bottom: 80px;
    /* Space for bottom nav */
}

/* Utilities */
.d-none {
    display: none !important;
}

.d-flex {
    display: flex !important;
}

/* LAYOUT & CONTAINERS */

/* Main Content Area */
.app-content {
    padding: 1.5rem;
    padding-bottom: 80px;
    /* Space for bottom nav */
    max-width: 600px;
    margin: 0 auto;
}

/* Instruction Header */
.instruction-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.check-icon-circle {
    background: #4CAF50;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.instruction-title {
    font-weight: 800;
    color: #444;
    text-transform: uppercase;
    font-size: 1rem;
    line-height: 1.4;
}

/* COUPON CARD DESIGN */
.coupon-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.coupon-header {
    background: #4CAF50;
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
}

.coupon-body {
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
    border-bottom: 2px dashed #e0e0e0;
    /* Dashed line effect */
}

.code-title {
    font-weight: 800;
    font-size: 1rem;
    color: #000;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.code-display-large {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: 0.5rem;
    color: #000;
    margin: 1rem 0;
}

/* Input Section */
.input-label {
    text-align: center;
    font-weight: 800;
    color: #000;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.mobile-input-container,
.code-input-container {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.mobile-input {
    width: 60px;
    height: 60px;
    background: #FFFFFF;
    border: 2px solid #E5E7EB;
    /* Visible grey border */
    border-radius: 12px;
    text-align: center;
    font-size: 1.8rem;
    /* Larger text */
    font-weight: 800;
    color: #000000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.mobile-input:focus {
    outline: 2px solid #4CAF50;
    background: white;
}

/* Footer Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    padding: 0.8rem 0;
    z-index: 500;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 0.75rem;
    gap: 4px;
}

.nav-item.active {
    color: #4CAF50;
}

.nav-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Product/Video Card */
.video-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    border: 1px solid #E5E7EB;
}

.video-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.card-body {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #111827;
}

.product-description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    gap: 1rem;
}

.btn-action {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-like {
    background-color: #10B981;
}

.btn-dislike {
    background-color: #F59E0B;
}

.btn-hate {
    background-color: #EF4444;
}

/* Utilities */
.hidden,
.d-none {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

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

/* Responsive adjustments */
@media (max-width: 480px) {
    .logo {
        font-size: 2rem;
    }

    .login-box {
        padding: 1.5rem;
    }
}

/* =========================================
   MODALS & OVERLAYS
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 90%;
    width: 340px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

.balance-update-content {
    text-align: center;
}

.success-icon {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.balance-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #333;
    margin-bottom: 0.5rem;
}

.balance-subtitle {
    color: #666;
    margin-bottom: 0.5rem;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 900;
    color: #4CAF50;
    margin-top: 0.5rem;
}

/* Loading Overlay */
.page-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    flex-direction: column;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* =========================================
   APP FOOTER (Copyright)
   ========================================= */
.app-footer {
    background: #4CAF50;
    color: white;
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: 2rem;
    padding-bottom: 90px;
    /* Extra space so it sits well above the fixed nav if it's the last element */
    font-size: 0.9rem;
}

.app-footer p {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.app-footer-links {
    margin-top: 0.5rem;
}

.app-footer a {
    color: white;
    text-decoration: underline;
    font-weight: 500;
    font-size: 0.9rem;
    margin: 0 5px;
}

.app-footer a:hover {
    color: #e8f5e9;
}

/* =========================================
   SUCCESS ANIMATION (Checkmark + Confetti Explosion)
   ========================================= */
.success-animation-container {
    position: fixed;
    /* Covers viewport */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    /* Slightly more opaque */
    backdrop-filter: blur(4px);
    /* Premium glass effect */
    z-index: 9999;
    /* Top of everything */
    overflow: hidden;
    /* Keep confetti mainly inside viewport */
}

/* Checkmark POP animation */
.checkmark-circle {
    width: 90px;
    height: 90px;
    background: #4CAF50;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px rgba(76, 175, 80, 0.5);
    z-index: 25;
    transform: scale(0);
    animation: elasticPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes elasticPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    70% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.checkmark-icon {
    width: 48px;
    height: 48px;
    fill: white;
}

/* Confetti Particles (Explosion) */
.confetti-piece {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Start from center */
    width: 10px;
    height: 10px;
    background-color: var(--color);
    border-radius: 2px;
    /* Slight roundness */
    transform: translate(-50%, -50%) scale(0);
    /* Start hidden/centered */
    /* --tx and --ty will be set by JS for direction */
    /* --r will be set by JS for rotation */
    animation: explode 0.8s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) rotate(var(--r));
        opacity: 0;
    }
}

/* =========================================
   SEARCHING ANIMATION (Pulse)
   ========================================= */
.searching-container {
    display: none;
    /* Hidden by default, shown via JS */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    min-height: 300px;
}

.pulse-loader {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.pulse-circle {
    position: absolute;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    opacity: 0;
    animation: pulseRipple 2s linear infinite;
}

.pulse-circle:nth-child(1) {
    width: 50px;
    height: 50px;
    animation-delay: 0s;
}

.pulse-circle:nth-child(2) {
    width: 100px;
    height: 100px;
    animation-delay: 0.5s;
}

.pulse-circle:nth-child(3) {
    width: 150px;
    height: 150px;
    animation-delay: 1s;
}

.pulse-circle:nth-child(4) {
    width: 200px;
    height: 200px;
    animation-delay: 1.5s;
}

.pulse-icon {
    width: 40px;
    height: 40px;
    color: #bdbdbd;
    z-index: 2;
}

@keyframes pulseRipple {
    0% {
        transform: scale(0.5);
        opacity: 1;
        border-color: #bdbdbd;
    }

    100% {
        transform: scale(1.1);
        opacity: 0;
        border-color: #f5f5f5;
    }
}

.searching-text {
    font-size: 1rem;
    font-weight: 700;
    color: #9e9e9e;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.searching-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #9e9e9e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* SCANNING ANIMATION SECTION */
.scanning-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
    background: #fff;
    /* Ensure white background */
    width: 100%;
    min-height: 60vh;
    /* Ensure it takes up vertical space */
    border-radius: 15px;
    /* Match other cards */
    margin-top: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.qr-scan-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin-bottom: 2rem;
    padding: 10px;
}

.qr-code-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.9;
}

/* Red Laser Line */
.scan-line {
    position: absolute;
    width: 90%;
    height: 4px;
    background: linear-gradient(to right, transparent, #FF3B30, transparent);
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.8);
    left: 5%;
    top: 10%;
    animation: scanMove 2s infinite linear;
    z-index: 10;
    border-radius: 50%;
}

@keyframes scanMove {
    0% {
        top: 10%;
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    95% {
        opacity: 1;
    }

    100% {
        top: 90%;
        opacity: 0;
    }
}

/* Corners */
.corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-radius: 4px;
}

.tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-radius: 20px 0 0 0;
}

.tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
    border-radius: 0 20px 0 0;
}

.bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 20px;
}

.br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-radius: 0 0 20px 0;
}

/* Status Text */
.scanning-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #888;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 3px solid #ddd;
    border-top: 3px solid #888;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.pulse-text {
    animation: pulseText 1.5s infinite;
}

@keyframes pulseText {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}