:root {
    --background: #000000;
    --foreground: #e2e8f0;
    --muted: #1e293b;
    --muted-foreground: #94a3b8;
    --primary: #3b82f6;
    --primary-foreground: #ffffff;
    --secondary: #0f172a;
    --secondary-foreground: #e2e8f0;
    --border: #334155;
    --input: #1e293b;
    --accent: #2563eb;
    --glow: #06b6d4;
    --sidebar-width: 260px;
    --header-height: 60px;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --card-bg: rgba(15, 23, 42, 0.7);
    --card-border: rgba(59, 130, 246, 0.2);
    --card-shadow: 0 8px 32px rgba(6, 182, 212, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    touch-action: manipulation; /* Improves touch responsiveness */
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    display: grid;
    grid-template-rows: var(--header-height) 1fr;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-areas:
        "header header"
        "sidebar main";
    position: relative;
    width: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(6, 182, 212, 0.05) 0%, transparent 25%),
        radial-gradient(circle at 80% 60%, rgba(59, 130, 246, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.03) 0%, transparent 40%);
}

header {
    grid-area: header;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    height: var(--header-height);
    z-index: 100;
    width: 100%;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    left: 0;
}

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

/* Ambient blue light effects */
body::before {
    content: '';
    position: absolute;
    top: 25%;
    left: 40%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--glow) 0%, rgba(6, 182, 212, 0.15) 20%, transparent 70%);
    filter: blur(120px);
    opacity: 0.4;
    z-index: -1;
    pointer-events: none;
    animation: float 15s ease-in-out infinite alternate;
}

body::after {
    content: '';
    position: absolute;
    bottom: 10%;
    right: 15%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--primary) 0%, rgba(37, 99, 235, 0.15) 20%, transparent 70%);
    filter: blur(100px);
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
    animation: float 20s ease-in-out infinite alternate-reverse;
}

/* Link styling */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s, border-bottom 0.2s;
    border-bottom: 1px dotted var(--primary);
    padding-bottom: 1px;
}

a:hover {
    color: var(--glow);
    border-bottom: 1px solid var(--glow);
}

strong {
    color: var(--primary-foreground);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* Additional ambient lights */
.ambient-light-1 {
    position: absolute;
    top: 70%;
    left: 15%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent) 0%, rgba(37, 99, 235, 0.1) 30%, transparent 70%);
    filter: blur(90px);
    opacity: 0.2;
    z-index: -1;
    pointer-events: none;
    animation: float 18s ease-in-out infinite;
}

.ambient-light-2 {
    position: absolute;
    top: 20%;
    right: 30%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--glow) 0%, rgba(6, 182, 212, 0.1) 20%, transparent 60%);
    filter: blur(80px);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
    animation: pulse 25s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0) translateX(0); filter: blur(120px); }
    25% { filter: blur(100px); }
    50% { transform: translateY(-20px) translateX(15px); filter: blur(130px); }
    75% { filter: blur(110px); }
    100% { transform: translateY(10px) translateX(-15px); filter: blur(120px); }
}

@keyframes pulse {
    0% { opacity: 0.1; width: 250px; height: 250px; }
    50% { opacity: 0.25; width: 300px; height: 300px; }
    100% { opacity: 0.1; width: 250px; height: 250px; }
}

header {
    grid-area: header;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    height: var(--header-height);
    z-index: 100;
    width: 100%;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    left: 0;
}

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: bold;
    font-size: 1.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: linear-gradient(90deg, var(--primary), var(--glow));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.logo img {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.sidebar {
    grid-area: sidebar;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(51, 65, 85, 0.5);
    padding: 1.5rem 0;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    height: calc(100vh - var(--header-height));
    z-index: 50;
    width: var(--sidebar-width);
    box-shadow: inset -5px 0 15px -5px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: var(--header-height);
    left: 0;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    padding: 0.5rem 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav ul {
    list-style-type: none;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--foreground);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    font-size: 0.95rem;
    position: relative;
    border-bottom: none;
}

.sidebar-link:hover {
    border-bottom: none;
    background-color: rgba(30, 41, 59, 0.7);
}

.sidebar-link.active {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--primary-foreground);
    font-weight: 500;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: var(--primary);
}

.main-content {
    grid-area: main;
    padding: 2rem 3rem;
    overflow-y: auto;
    overflow-x: hidden;
    height: calc(100vh - var(--header-height));
    z-index: 10;
    width: calc(100% - var(--sidebar-width));
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--secondary);
    line-height: 1.7;
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    transform: translateZ(0); /* Triggers hardware acceleration */
    backface-visibility: hidden; /* Reduces paint during scrolling */
}

section {
    margin-bottom: 5rem;
    position: relative;
    z-index: 5;
    padding: 1rem 0;
    max-width: 1200px;
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: var(--secondary);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 4px;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, var(--primary-foreground), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    position: relative;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--glow));
    border-radius: 2px;
}

h2 {
    font-size: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    color: var(--primary);
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), transparent);
    border-radius: 3px;
}

h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--glow);
    position: relative;
    display: inline-block;
    padding-left: 1rem;
}

h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.5em;
    background: linear-gradient(to bottom, var(--primary), var(--glow));
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

p {
    margin-bottom: 1.25rem;
    max-width: 90ch;
    line-height: 1.7;
}

code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background-color: var(--muted);
    color: var(--glow);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    word-break: break-word;
    border-bottom: 1px solid rgba(6, 182, 212, 0.3);
}

pre {
    background-color: var(--muted);
    border-radius: 0.5rem;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.75rem 0;
    max-width: 100%;
    border: 1px solid rgba(51, 65, 85, 0.5);
    box-shadow: 0 4px 20px -5px rgba(6, 182, 212, 0.15);
    position: relative;
}

pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--glow), transparent);
    border-radius: 3px 3px 0 0;
}

pre code {
    background-color: transparent;
    padding: 0;
    color: var(--foreground);
    white-space: pre-wrap;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    display: block;
    overflow-x: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px -5px rgba(6, 182, 212, 0.15);
    border: 1px solid var(--border);
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.3), rgba(15, 23, 42, 0.5));
}

th, td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: var(--secondary);
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    letter-spacing: 0.03em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(59, 130, 246, 0.1);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--foreground);
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 1rem;
    z-index: 200;
    flex-shrink: 0;
}

.feature-item {
    margin-bottom: 2.5rem;
    position: relative;
    padding: 1.25rem 1.5rem 1.25rem 1.5rem;
    border-left: 3px solid var(--primary);
    transition: transform 0.3s ease, border-left-color 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.05), transparent);
    border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 15px -8px rgba(0, 0, 0, 0.2);
}

.feature-item:hover {
    transform: translateX(5px);
    border-left-color: var(--glow);
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.08), transparent);
    box-shadow: 0 6px 20px -8px rgba(6, 182, 212, 0.25);
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    left: -0.5rem;
    width: 1rem;
    height: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--glow));
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.feature-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--primary-foreground);
    position: relative;
    display: inline-block;
    letter-spacing: 0.02em;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.features-list {
    display: flex;
    flex-direction: column;
    margin: 2rem 0;
    width: 100%;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.tech-badge {
    display: inline-block;
    color: var(--primary-foreground);
    padding: 0.5rem 1.25rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--primary);
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
    margin-right: 0.75rem;
    position: relative;
    background: linear-gradient(to right, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.05));
    font-weight: 500;
    letter-spacing: 0.02em;
}

.tech-badge:hover {
    color: var(--glow);
    transform: translateY(-2px);
    border-bottom-color: var(--glow);
    background: linear-gradient(to right, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.05));
    box-shadow: 0 4px 12px -2px rgba(6, 182, 212, 0.2);
}

ul {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
    list-style-type: none;
}

li {
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 0.5rem;
}

li::before {
    content: '•';
    color: var(--primary);
    position: absolute;
    left: -1rem;
    font-weight: bold;
}

ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
    counter-reset: item;
    list-style-type: none;
}

ol > li {
    counter-increment: item;
    position: relative;
    padding-left: 0.5rem;
}

ol > li::before {
    content: counter(item) ".";
    color: var(--primary);
    position: absolute;
    left: -1.5rem;
    font-weight: bold;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
}

@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main";
        width: 100vw;
        overflow-x: hidden;
        overscroll-behavior-y: none; /* Prevents bounce effect on some mobile browsers */
    }

    .main-content {
        scroll-padding-top: var(--header-height); /* Ensures scrolling to anchors accounts for fixed header */
        will-change: transform; /* Hint to browser to use hardware acceleration */
    }

    .sidebar {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 85%;
        max-width: 300px;
        height: calc(100vh - var(--header-height));
        z-index: 100;
        transition: left 0.3s ease;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .overlay.active {
        display: block;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .features-list {
        padding: 0 0.5rem;
    }

    .main-content {
        padding: 1.5rem;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-top: var(--header-height);
    }

    p, ul, ol {
        max-width: 100%;
    }

    pre {
        max-width: calc(100vw - 2rem);
    }

    .feature-item {
        margin-bottom: 1.5rem;
    }
}

/* Fix for extra small screens */
@media (max-width: 400px) {
    .logo span {
        font-size: 1rem;
    }

    .header {
        padding: 0 0.5rem;
    }

    .main-content {
        padding: 1rem;
    }
}
