/* ==================== Global Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0e27;
    --bg-card: #151937;
    --blue: #4FB3F6;
    --purple: #8B5CF6;
    --orange: #FF6B35;
    --text: #E8EBF7;
    --text-dim: #9CA3C5;
    --success: #25D366;
    --danger: #FF6B35;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(79, 179, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    animation: gradientShift 15s ease infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.8; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(50px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes scaleIn { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ==================== Navigation ==================== */
nav {
    position: sticky;
    top: 0;
    background: rgba(21, 25, 55, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    z-index: 100;
    border-bottom: 1px solid rgba(79, 179, 246, 0.2);
    animation: slideDown 0.5s ease;
}

nav .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeIn 0.8s ease;
    text-decoration: none;
    white-space: nowrap;
}

.logo img {
    height: 45px;
    width: 45px;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(79, 179, 246, 0.3));
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), var(--purple));
    transition: width 0.3s ease;
}

nav a:hover::after { width: 100%; }
nav a:hover { color: var(--blue); }

.nav-login-btn a {
    border: 1px solid var(--blue);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
}

.nav-login-btn a:hover {
    background-color: var(--blue);
    color: var(--bg-dark);
}

.nav-login-btn a:hover::after { width: 0; }

/* ==================== Container & Layout ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
    flex: 1;
}

/* ==================== Hero Section ==================== */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    animation: fadeIn 1s ease;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--blue), var(--purple), var(--orange));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: slideUp 0.8s ease;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: slideUp 0.8s ease 0.2s backwards;
}

.hero a { color: var(--text-dim); }

/* ==================== Buttons ==================== */
.btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.8s ease 0.4s backwards;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before { width: 300px; height: 300px; }
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(79, 179, 246, 0.4);
}

/* ==================== Cards ==================== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(79, 179, 246, 0.2);
    transition: all 0.3s ease;
    animation: fadeIn 0.8s ease backwards;
}

.card:nth-child(1) { animation-delay: 0.2s; }
.card:nth-child(2) { animation-delay: 0.4s; }
.card:nth-child(3) { animation-delay: 0.6s; }
.card:nth-child(4) { animation-delay: 0.8s; }

.card:hover {
    transform: translateY(-8px);
    border-color: var(--blue);
    box-shadow: 0 20px 40px rgba(79, 179, 246, 0.2);
}

.card h3 {
    color: var(--blue);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.card p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* ==================== Content Boxes ==================== */
.booking-container {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
    border: 1px solid rgba(79, 179, 246, 0.2);
    animation: fadeIn 0.8s ease;
}

.widget-box {
    background: var(--bg-card);
    border-radius: 15px;
    margin-top: 2rem;
    border: 1px solid rgba(79, 179, 246, 0.2);
    overflow: hidden;
    line-height: 0;
}

.game-hero { padding: 2rem 1rem; }

/* ==================== Confirmation Page ==================== */
.confirmation {
    text-align: center;
    padding: 3rem 1rem;
    animation: fadeIn 1s ease;
}

.confirmation-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: scaleIn 0.6s ease;
}

.confirmation h1 {
    color: var(--blue);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.confirmation p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

/* ==================== Contact Section ==================== */
.contact {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--bg-card);
    border-radius: 15px;
    margin-top: 2rem;
    border: 1px solid rgba(79, 179, 246, 0.2);
    animation: fadeIn 0.8s ease;
}

.contact h2 {
    color: var(--blue);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.contact img {
    border-radius: 8px;
    max-width: 150px;
    margin-top: 1rem;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    background: var(--success);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.whatsapp-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
}

/* ==================== Footer ==================== */
footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid rgba(79, 179, 246, 0.2);
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: auto;
}

footer a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover { color: var(--purple); }

/* ==================== Games Page Styles ==================== */
.game-container { position: relative; z-index: 1; }

.game-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.game-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 15px;
    border: 2px solid rgba(79, 179, 246, 0.3);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease backwards;
}

.game-card:hover {
    border-color: var(--blue);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(79, 179, 246, 0.3);
}

.game-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.game-card h3 {
    color: var(--blue);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.game-card p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

#active-game-area {
    text-align: center;
    padding: 2rem 1rem;
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    color: var(--blue);
    flex-wrap: wrap;
    gap: 1rem;
}

.hidden { display: none !important; }

/* ==================== Terms Text ==================== */
.terms-text h2 {
    color: var(--blue);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.terms-text h2:first-child { margin-top: 0; }
.terms-text p, .terms-text li {
    color: var(--text-dim);
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.terms-text ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.terms-text strong { color: var(--blue); }

/* ==================== Mobile Responsive ==================== */
@media (max-width: 768px) {
    nav { padding: 0.8rem; }
    nav .container {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0 0.5rem;
    }

    .logo { font-size: 0.9rem; }
    .logo img { height: 40px; width: 40px; }
    nav ul {
        gap: 0.8rem;
        font-size: 0.8rem;
        justify-content: center;
    }

    .hero h1 { font-size: 2rem; margin-bottom: 1rem; }
    .hero p { font-size: 1rem; }
    .btn { padding: 0.8rem 1.5rem; font-size: 0.95rem; }
    .cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card { padding: 1.2rem; }
    .booking-container { padding: 1.5rem; }
    footer { font-size: 0.85rem; padding: 1.5rem 0.5rem; }
    .game-selection { grid-template-columns: 1fr; gap: 1rem; }
    .game-card { padding: 1rem; }
    .contact { padding: 1.5rem 1rem; }
    .contact h2 { font-size: 1.5rem; }
    .confirmation h1 { font-size: 1.5rem; }
    .confirmation-icon { font-size: 3rem; }
    .terms-text h2 { font-size: 1.1rem; margin-top: 1rem; }
    .score-board { font-size: 1rem; }
}

@media (max-width: 480px) {
    .container { padding: 1rem; }
    nav ul { gap: 0.5rem; font-size: 0.75rem; }
    .hero h1 { font-size: 1.5rem; }
    .hero p { font-size: 0.95rem; }
    .btn { padding: 0.7rem 1.2rem; font-size: 0.9rem; }
    .logo span { font-size: 0.8rem; }
    .nav-login-btn a { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
    .hero { padding: 2rem 0.5rem; }
    .card h3 { font-size: 1rem; }
    .card p { font-size: 0.85rem; }
}

/* ==================== Game-Specific Styles ==================== */
.problem-display {
    font-size: 3.5rem;
    font-weight: bold;
    margin: 2rem 0;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    min-height: 80px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(79, 179, 246, 0.3);
    padding: 1rem;
    font-size: 1.5rem;
    color: var(--text);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background: rgba(79, 179, 246, 0.2);
}

#answer-input {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--blue);
    padding: 0.5rem 1rem;
    font-size: 1.5rem;
    color: white;
    border-radius: 5px;
    width: 150px;
    text-align: center;
}

#angle-canvas {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    border: 1px solid var(--text-dim);
    margin: 0 auto;
    cursor: crosshair;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    max-width: 100%;
}

.angle-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 200px;
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--blue);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--blue);
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.memory-card {
    aspect-ratio: 1;
    background: var(--bg-card);
    border: 2px solid rgba(79, 179, 246, 0.3);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.4s;
    transform-style: preserve-3d;
    position: relative;
    min-height: 80px;
}

.memory-card.flipped, .memory-card.matched {
    background: linear-gradient(135deg, rgba(79, 179, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-color: var(--purple);
    transform: rotateY(180deg);
}

.memory-card.matched {
    border-color: var(--success);
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.3);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.card-front {
    transform: rotateY(180deg);
    font-weight: bold;
    color: var(--text);
    font-size: 1.1rem;
    padding: 5px;
}

.card-back {
    background: rgba(255,255,255,0.05);
    font-size: 2rem;
}

.correct { background: rgba(37, 211, 102, 0.2) !important; border-color: #25D366 !important; }
.wrong { background: rgba(255, 107, 53, 0.2) !important; border-color: var(--orange) !important; }

.tutor-promo {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.tutor-promo p {
    color: var(--text-dim);
    margin-bottom: 1rem;
}
