/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #e5e7eb;
    line-height: 1.6;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c4a6b 25%, #1a2f4a 50%, #2d4a6b 75%, #1e3a5f 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Heading Styles */
h1, h2, h3, h4, h5, h6 {
    color: #ffffff;
}

h1 {
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h2 {
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h3 {
    font-weight: 600;
    color: #e0e7ff;
}

h4 {
    font-weight: 600;
    color: #c7d2fe;
}

/* Page Load Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    animation: fadeIn 0.6s ease-out;
}

/* Header and Navigation */
header {
    background-color: rgba(15, 23, 42, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #93c5fd;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #e5e7eb;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #93c5fd;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #e5e7eb;
}

.mobile-menu {
    display: none;
    max-height: 0;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    padding: 0 2rem;
    transition: max-height 0.3s ease, padding 0.3s ease;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu.active {
    max-height: 500px;
    padding: 2rem;
}

.mobile-menu-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-menu-links a {
    text-decoration: none;
    color: #e5e7eb;
    font-weight: 500;
    font-size: 1.1rem;
    display: block;
    padding: 0.5rem 0;
}

/* Hero Section */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    display: flex;
    align-items: center;
    gap: 3rem;
    min-height: 500px;
}

.hero-content {
    flex: 0 0 45%;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.hero-image {
    flex: 0 0 55%;
    position: relative;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ffffff;
    line-height: 1.2;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero p {
    font-size: 1.1rem;
    color: #d1d5db;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Card Animations */
@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.card {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease-out both;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: block;
}

/* Fixed height for images in grid-4 cards (Daily Logic Challenges) */
.grid-4 .card .card-image {
    height: 200px;
    object-fit: cover;
}

.card h3 {
    margin-bottom: 0.5rem;
    color: #e0e7ff;
    font-weight: 600;
}

.card p {
    color: #d1d5db;
    margin-bottom: 1rem;
}

/* Section Styles */
section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Add divider lines between sections */
section:not(:first-of-type) {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* Ensure hero section doesn't have a line above it */
section.hero {
    border-top: none;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    text-align: center;
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-2.align-center {
    align-items: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem auto;
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    table-layout: auto;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

table tr:hover {
    background-color: rgba(30, 41, 59, 1);
}

table tr:last-child td {
    border-bottom: none;
}

/* Accordion Styles */
.accordion {
    margin: 2rem 0;
}

.accordion-item {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.accordion-header {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 41, 59, 0.6);
    transition: background 0.3s ease;
}

.accordion-header:hover {
    background: rgba(30, 41, 59, 0.9);
}

.accordion-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #e0e7ff;
    font-weight: 600;
}

.accordion-icon {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
    color: #93c5fd;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 1000px;
}

.accordion-body {
    padding: 1.5rem;
    color: #d1d5db;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(147, 197, 253, 0.5);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    animation: fadeIn 0.6s ease-out both;
}

.timeline-item:nth-child(even) {
    padding-left: 50%;
    padding-right: 2rem;
}

.timeline-item:nth-child(odd) {
    padding-right: 50%;
    padding-left: 2rem;
}

.timeline-content {
    background: rgba(30, 41, 59, 0.8);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

.timeline-content::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #93c5fd;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.3);
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -10px;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -10px;
}

.timeline-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: #93c5fd;
    color: #1e3a5f;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-weight: bold;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(147, 197, 253, 0.4);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #e5e7eb;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: rgba(30, 41, 59, 0.6);
    color: #e5e7eb;
}

.form-group input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(15, 23, 42, 0.98);
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeIn 0.3s ease 0.1s both;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    color: #ffffff;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #d1d5db;
}

/* Memory Game */
.memory-game {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 2rem auto;
}

.memory-card {
    aspect-ratio: 1;
    background: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    transition: all 0.3s ease;
    transform: rotateY(180deg);
    transform-style: preserve-3d;
}

.memory-card.flipped {
    transform: rotateY(0deg);
    background: var(--accent-color);
}

.memory-card.matched {
    background: #10b981;
    cursor: default;
}

/* Game Completion Modal */
@keyframes fadeInCenter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.game-completion {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 3000;
    text-align: center;
    animation: fadeInCenter 0.3s ease;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-section a:hover {
    color: white;
}

.footer-legal {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.footer-legal a:hover {
    color: white;
}

.footer-note {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-menu {
        display: block;
    }

    .hero {
        flex-direction: column;
        padding: 2rem 1rem;
    }

    .hero-content,
    .hero-image {
        flex: 1 1 100%;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item:nth-child(even),
    .timeline-item:nth-child(odd) {
        padding-left: 3rem;
        padding-right: 1rem;
    }

    .timeline-item:nth-child(even) .timeline-content::before,
    .timeline-item:nth-child(odd) .timeline-content::before {
        left: 10px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .memory-game {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Mobile Table Styles - Compact and Centered */
    section {
        overflow-x: hidden;
        padding: 2rem 1rem;
    }

    .card {
        overflow-x: visible;
        padding: 1.5rem 1rem;
    }

    table {
        width: 100%;
        max-width: 100%;
        font-size: 0.7rem;
        margin: 1.5rem auto;
        display: table;
        table-layout: fixed;
    }

    table th,
    table td {
        padding: 0.5rem 0.35rem;
        text-align: center;
        font-size: 0.65rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        line-height: 1.3;
    }

    table th {
        font-size: 0.7rem;
        padding: 0.6rem 0.35rem;
        white-space: normal;
        line-height: 1.2;
    }

    table td {
        font-size: 0.6rem;
    }

    /* Ensure table container doesn't overflow */
    .card table {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    /* Additional compact styles for very small screens */
    @media (max-width: 480px) {
        table {
            font-size: 0.6rem;
        }

        table th,
        table td {
            padding: 0.4rem 0.25rem;
            font-size: 0.55rem;
        }

        table th {
            font-size: 0.6rem;
            padding: 0.5rem 0.25rem;
        }

        table td {
            font-size: 0.5rem;
        }
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Stagger Animation for Cards */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

