:root { 
    --primary-color: #D32F2F; 
    --primary-dark: #B71C1C; 
    --accent-color: #FF5252; 
    --text-color: #333; 
    --hero-bg: linear-gradient(135deg, #8E0000 0%, #D32F2F 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

.admin-theme {
    --primary-color: #6A1B9A;
    --primary-dark: #4A148C;
    --accent-color: #D32F2F;
    --hero-bg: linear-gradient(135deg, #4A148C 0%, #6A1B9A 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: #fcfcfc; color: var(--text-color); overflow-x: hidden; }

/* Entrance Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; ansform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(211, 47, 47, 0.3); }
    50% { box-shadow: 0 0 25px rgba(211, 47, 47, 0.6); }
}

.animate-up { animation: fadeInUp 0.8s ease-out forwards; }
.animate-scale { animation: fadeInScale 0.6s ease-out forwards; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

header { 
    background: var(--hero-bg); 
    color: white; 
    padding: 20px 0; 
    box-shadow: 0 4px 30px rgba(0,0,0,0.1); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s ease;
}

.admin-theme header {
    background: var(--hero-bg) !important;
}

.header-content { display: flex; align-items: center; justify-content: space-between; position: relative; }
.terms-link { color: white; text-decoration: none; font-size: 14px; opacity: 0.8; transition: opacity 0.2s; }
.terms-link:hover { opacity: 1; text-decoration: underline; }

.header-promo { font-size: 14px; font-weight: 700; color: #FFEB3B; background: rgba(255,255,255,0.1); padding: 6px 15px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.2); display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 20px; }
.pulse-text { color: #fff; background: var(--accent-color); padding: 2px 8px; border-radius: 6px; animation: textPulse 1.5s infinite ease-in-out; display: inline-block; }
@keyframes textPulse { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7); } 70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 82, 82, 0); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 82, 82, 0); } }

.logo { display: flex; align-items: center; gap: 20px; }
.logo-text { 
    font-size: 28px; 
    font-weight: 800; 
    letter-spacing: -1px;
    background: linear-gradient(to bottom, #fff, #ffcdd2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.admin-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(255,255,255,0.08);
    padding: 6px 8px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
}
.admin-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    background: transparent;
    border-radius: 9px;
    border: 1px solid transparent;
    transition: all 0.22s ease;
    white-space: nowrap;
    display: inline-block;
    letter-spacing: 0.2px;
}
.admin-nav a:hover {
    color: white;
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}
.admin-nav a.active-tab {
    background: white;
    color: var(--primary-color);
    border-color: rgba(255,255,255,0.9);
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18), 0 1px 3px rgba(0,0,0,0.12);
    transform: none;
}
.admin-nav .nav-sep {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.2);
    margin: 0 2px;
}
.admin-nav a.logout-btn {
    color: #FFCDD2;
    border-color: rgba(239, 83, 80, 0.35);
    background: rgba(239, 83, 80, 0.15);
}
.admin-nav a.logout-btn:hover {
    background: rgba(239, 83, 80, 0.3);
    border-color: rgba(239, 83, 80, 0.5);
    color: white;
}

/* Global Form Elements for Admin */
.admin-theme input:not([type="file"]):not([type="checkbox"]),
.admin-theme textarea,
.admin-theme select {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}
.admin-theme input:not([type="file"]):not([type="checkbox"]):focus,
.admin-theme textarea:focus,
.admin-theme select:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(106,27,154,0.12);
}
.admin-theme input[type="file"] {
    font-size: 13px;
    color: #666;
}
.btn-primary {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    text-align: center;
    text-decoration: none;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    filter: brightness(1.05);
}

.hero { 
    background: var(--hero-bg); 
    background-size: 400% 400%;
    animation: animate-gradient 15s ease infinite;
    color: white; 
    padding: 80px 0 140px; 
    margin-bottom: -60px;
    border-radius: 0 0 80px 80px; 
    position: relative; 
    overflow: hidden; 
}

.hero-content { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 2; }
.hero-left { width: 50%; opacity: 0; animation-delay: 0.2s; }
.hero-left h1 { font-size: 64px; font-weight: 900; margin-bottom: 15px; line-height: 1; letter-spacing: -2px; }
.hero-subheader { font-size: 22px; font-weight: 500; color: #FFCDD2; margin-bottom: 30px; }

.scratch-card-container { 
    width: 100%; 
    height: 100%; 
    position: relative; 
    border-radius: 24px; 
    overflow: hidden; 
    box-shadow: 0 30px 60px rgba(0,0,0,0.5); 
    border: 4px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
}

.hero-right { 
    width: 440px; 
    height: 320px; 
    position: relative; 
    z-index: 3; 
    opacity: 0;
    animation-delay: 0.4s;
}

/* Floating Elements */
.floating-cards { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.f-card { 
    position: absolute; 
    width: 140px; 
    height: 90px; 
    background: var(--glass-bg); 
    border: 1px solid var(--glass-border); 
    border-radius: 16px; 
    backdrop-filter: blur(8px); 
    animation: floatAnim 8s infinite ease-in-out; 
}
@keyframes floatAnim {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(20px, -30px) rotate(5deg); }
    66% { transform: translate(-15px, 20px) rotate(-5deg); }
}

/* New Animations */
@keyframes shimmer-gold {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes rotate-y {
    0% { transform: perspective(400px) rotateY(0deg); }
    100% { transform: perspective(400px) rotateY(360deg); }
}

@keyframes animate-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes tagline-pulse {
    0%, 100% { transform: scale(1); text-shadow: 0 0 5px rgba(255,255,255,0.2); }
    50% { transform: scale(1.05); text-shadow: 0 0 15px rgba(255,255,255,0.5); }
}

.mini-card-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 30px;
    margin-right: 15px;
    vertical-align: middle;
}

.mini-card {
    width: 35px;
    height: 22px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.4);
    animation: rotate-y 4s infinite linear;
    position: relative;
    overflow: hidden;
}

.mini-card::after {
    content: "";
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,0.4) 50%, transparent 60%);
    background-size: 200% 100%;
    animation: shimmer-gold 2s infinite linear;
}

.scratch-card-wrapper {
    position: relative;
    padding: 10px;
    height: 100%;
    transition: transform 0.3s ease;
}

.scratch-card-wrapper:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg);
}

.scratch-surface {
    position: relative;
    overflow: hidden;
}

.scratch-surface::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
    background-size: 200% 100%;
    animation: shimmer-gold 3s infinite linear;
    pointer-events: none;
}

.tagline-animated {
    display: inline-block;
    animation: tagline-pulse 3s infinite ease-in-out;
    color: #FFCDD2;
    font-weight: 600;
}

/* Simulated Scratch Animations */
.scratch-card-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    background: #fff; /* Prize background */
    border: 3px solid rgba(0,0,0,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-radius: 24px;
}

.scratch-hand {
    position: absolute;
    width: 70px;
    height: 70px;
    background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
    border-radius: 50%;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 0 10px rgba(255,255,255,0.5);
    border: 2px solid #daa520;
    opacity: 0;
    animation: hand-zigzag 5s infinite ease-in-out;
}

.scratch-overlay-animated {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffd700 0%, #f1c40f 50%, #ffd700 100%);
    background-size: 200% 200%;
    z-index: 5;
    pointer-events: none;
    animation: shimmer-gold 3s infinite linear, reveal-zigzag 5s infinite ease-in-out;
    border: 1px solid rgba(255,255,255,0.3);
}

.scratch-prize-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: 900;
    color: #4A148C;
    z-index: 1;
    text-align: center;
    width: 100%;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
    letter-spacing: 2px;
}

@keyframes hand-zigzag {
    0% { top: -10%; left: -10%; opacity: 0; transform: scale(0.8); }
    5% { opacity: 1; transform: scale(1); top: 10%; left: 0%; }
    20% { top: 10%; left: 90%; }
    40% { top: 40%; left: -10%; }
    60% { top: 40%; left: 90%; }
    80% { top: 80%; left: -10%; }
    90% { top: 80%; left: 50%; opacity: 1; }
    100% { top: 110%; left: 110%; opacity: 0; }
}

@keyframes reveal-zigzag {
    0% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    5% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    20% { clip-path: polygon(100% 0, 100% 0, 100% 100%, 0 100%, 0 20%, 100% 20%); }
    40% { clip-path: polygon(100% 0, 100% 0, 100% 100%, 0 100%, 0 40%, 100% 40%, 100% 20%, 0 20%); }
    60% { clip-path: polygon(100% 0, 100% 0, 100% 100%, 0 100%, 0 70%, 100% 70%, 100% 40%, 0 40%); }
    80% { clip-path: polygon(100% 100%, 100% 100%, 100% 100%, 0 100%, 0 100%, 100% 100%); opacity: 1; }
    90% { opacity: 0; }
    100% { opacity: 0; }
}

.products { margin: 100px 0; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px; }

.product-card { 
    background: white; 
    padding: 10px; 
    border-radius: 28px; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    border: 1px solid #eee;
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    position: relative;
    opacity: 0;
}

.product-card:hover { 
    transform: translateY(-15px); 
    box-shadow: 0 40px 80px rgba(0,0,0,0.1); 
    border-color: var(--primary-color);
}

.product-img-wrapper {
    width: 100%;
    height: 380px;
    background: #f8f8f8;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.product-img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    transition: transform 0.6s ease;
    padding: 20px;
}

.product-card:hover .product-img { transform: scale(1.1); }

.product-info { padding: 0 15px 20px; text-align: center; }
.product-info h3 { font-size: 22px; font-weight: 800; margin-bottom: 8px; color: #1a1a1a; }
.product-desc { font-size: 15px; color: #666; margin-bottom: 20px; min-height: 42px; }

.price-tag {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.pay-btn { 
    width: 100%; 
    padding: 18px; 
    background: var(--primary-color); 
    color: white; 
    border: none; 
    border-radius: 18px; 
    font-size: 18px; 
    font-weight: 800; 
    cursor: pointer; 
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.3);
}

.pay-btn:hover { 
    background: var(--primary-dark); 
    transform: scale(1.02);
    box-shadow: 0 15px 30px rgba(211, 47, 47, 0.4);
}

.cta-instruction { 
    text-align: center; 
    margin: 60px auto 20px; 
    font-size: 28px; 
    font-weight: 900; 
    color: #1a1a1a;
    letter-spacing: -1px;
}

.toast { 
    visibility: hidden; 
    min-width: 300px; 
    background: #333; 
    color: white; 
    text-align: center; 
    border-radius: 50px; 
    padding: 16px 30px; 
    position: fixed; 
    z-index: 1000; 
    left: 50%; 
    bottom: 40px; 
    transform: translateX(-50%); 
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.toast.show { visibility: visible; animation: fadeInUp 0.5s, fadeOut 0.5s 2.5s; }

@keyframes fadeOut { from {opacity: 1;} to {opacity: 0;} }

/* Login */
.login-container { 
    max-width: 420px; 
    margin: 100px auto; 
    padding: 50px 40px; 
    background: white; 
    border-radius: 32px; 
    box-shadow: 0 40px 100px rgba(0,0,0,0.1); 
    text-align: center; 
}
.login-title { font-size: 28px; font-weight: 900; margin-bottom: 30px; }
.login-form input { 
    width: 100%; 
    padding: 16px; 
    margin-bottom: 20px; 
    border: 2px solid #f0f0f0; 
    border-radius: 16px; 
    font-size: 16px; 
    transition: all 0.3s; 
}
.login-form input:focus { border-color: var(--primary-color); outline: none; background: #fff; }

.login-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #6A1B9A 0%, #D32F2F 100%);
    color: white;
    border: none;
    border-radius: 18px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(106, 27, 154, 0.2);
    margin-top: 10px;
    text-align: center;
    text-decoration: none;
    display: block;
}

.login-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px rgba(106, 27, 154, 0.3);
    filter: brightness(1.1);
}

.forgot-link {
    display: block;
    margin-top: 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Crackers Effect */
.crackers-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}
.cracker-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    animation: burst 1s ease-out forwards;
}
@keyframes burst {
    0% { transform: scale(0) translate(0, 0); opacity: 1; }
    50% { opacity: 1; }
    100% { transform: scale(1.2) translate(var(--tx), var(--ty)); opacity: 0; }
}
