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

/* Variables */
:root {
    --primary: #343a40; /* Base color */
    --text: #212529; /* Dark text for light mode */
    --background: #e9ecef; /* Light mode background */
    --card: #f1f3f5; /* Light mode card */
    --border: #ced4da; /* Light mode border */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease-in-out;
    --accent: #007bff; /* Blue for buttons/links */
    --hover: #0056b3; /* Darker blue for hover */
}

body.dark {
    --text: #ffffff; /* White text for dark mode */
    --background: #1c2526; /* Dark mode background */
    --card: #2d3539; /* Dark mode card */
    --border: #3f4b4f; /* Dark mode border */
    --primary: #4a5459; /* Lighter for dark mode */
    --accent: #0d6efd;
    --hover: #3b8afd;
}

/* Base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text); /* Dynamic text color */
    line-height: 1.7;
    font-size: clamp(15px, 3.5vw, 16px);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 12px;
    width: 100%;
}

/* Header */
.header {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.6rem 0;
    box-shadow: var(--shadow);
    height: 44px;
    display: flex;
    align-items: center;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.logo {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 800;
    color: #ffffff; /* White logo for contrast */
    text-decoration: none;
}

.nav {
    display: flex;
}

.nav ul {
    display: flex;
    gap: clamp(12px, 1.5vw, 14px);
    list-style: none;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Buttons */
.theme-toggle, .menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
}

.theme-toggle:hover, .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.theme-toggle i, .menu-toggle i {
    width: 18px;
    height: 18px;
}

.menu-toggle {
    display: none;
}

/* Mobile Nav */
.mobile-nav {
    display: none;
    background: var(--primary);
    position: fixed;
    top: 44px;
    left: 0;
    width: 100%;
    z-index: 999;
    padding: 10px 12px;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    box-shadow: var(--shadow);
    overflow-y: auto;
    max-height: calc(100vh - 44px);
    opacity: 0;
}

.mobile-nav.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav ul {
    flex-direction: column;
    gap: 6px;
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

.mobile-nav .nav-link, .mobile-nav .btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 14px;
    color: #ffffff;
    text-decoration: none;
    font-size: clamp(0.85rem, 3vw, 0.9rem);
    font-weight: 500;
    transition: var(--transition);
    width: 100%;
    text-align: left;
}

.mobile-nav .nav-link:hover, .mobile-nav .btn-primary:hover {
    color: var(--accent);
    background: none;
    transform: translateX(4px);
}

.mobile-nav .theme-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 14px;
    font-size: clamp(0.85rem, 3vw, 0.9rem);
    font-weight: 500;
    color: #ffffff;
    width: 100%;
    text-align: left;
    transition: var(--transition);
}

.mobile-nav .theme-toggle:hover {
    color: var(--accent);
    transform: translateX(4px);
}

.mobile-nav .theme-toggle i {
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

/* Main */
.main {
    padding: 1.5rem 0;
}

/* Hero */
.hero {
    text-align: center;
    padding: clamp(32px, 6vw, 48px) 12px;
    background: var(--primary);
    color: #ffffff; /* White text in hero */
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.hero p {
    font-size: clamp(0.95rem, 3vw, 1.1rem);
    max-width: 85%;
    margin: 0 auto 1rem;
}

/* Section */
.section {
    margin-bottom: 2rem;
}

.section h2 {
    font-size: clamp(1.5rem, 3.5vw, 1.7rem);
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

/* Card */
.card {
    background: var(--card);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
}

.card h3 {
    font-size: clamp(1rem, 3vw, 1.1rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card p, .card ul {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
}

.card ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.card ul li {
    margin-bottom: 0.4rem;
}

/* Table */
.table-container {
    overflow-x: auto;
    margin: 1rem 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    border-radius: 6px;
    overflow: hidden;
}

.table th, .table td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    color: var(--text);
}

.table th {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
background: transparent;
color: var(--text) #ffffff;
border: 2px solid var(--text);
}

.btn-primary:hover {
    background: var(--text);
    color: var(--primary);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--text);
}

.btn-secondary:hover {
    background: var(--text);
    color: var(--primary);
}

.btn i {
    margin-left: 6px;
    width: 14px;
    height: 14px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    background: var(--primary);
    color: #ffffff;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.social-links a {
    color: #ffffff;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent);
}

.social-links i {
    width: 20px;
    height: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: clamp(0.75rem, 2.5vw, 0.85rem);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .theme-toggle {
        display: none;
    }

    .mobile-nav .theme-toggle {
        display: flex;
    }

    .header {
        padding: 0.5rem 0;
        height: 40px;
    }

    .header .container {
        padding: 0 10px;
    }

    .mobile-nav {
        top: 40px;
        padding: 8px 10px;
        max-height: calc(100vh - 40px);
    }

    .mobile-nav ul {
        gap: 5px;
    }

    .mobile-nav .nav-link, .mobile-nav .btn, .mobile-nav .theme-toggle {
        padding: 8px 12px;
        font-size: clamp(0.8rem, 2.8vw, 0.85rem);
    }

    .hero {
        padding: 24px 10px;
    }

    .hero h1 {
        font-size: clamp(1.6rem, 3.5vw, 2rem);
    }

    .hero p {
        font-size: clamp(0.85rem, 2.8vw, 0.95rem);
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .section {
        margin-bottom: 1.5rem;
    }

    .section h2 {
        font-size: clamp(1.3rem, 3vw, 1.5rem);
    }

    .card ul {
        padding-left: 1.2rem;
        font-size: clamp(0.75rem, 2.5vw, 0.85rem);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }

    .logo {
        font-size: clamp(1rem, 2.8vw, 1.1rem);
    }

    .mobile-nav {
        padding: 6px 8px;
    }

    .mobile-nav .nav-link, .mobile-nav .btn, .mobile-nav .theme-toggle {
        padding: 6px 10px;
        font-size: clamp(0.75rem, 2.5vw, 0.8rem);
    }

    .hero {
        padding: 20px 8px;
    }

    .card {
        padding: 0.8rem;
    }

    .card ul {
        padding-left: 1rem;
        font-size: clamp(0.7rem, 2.5vw, 0.8rem);
    }

    .table th, .table td {
        padding: 6px 8px;
        font-size: clamp(0.75rem, 2.5vw, 0.85rem);
    }
}