@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Orbitron:wght@400;700&display=swap');

:root {
    --bg-color: #0a0b10;
    --surface-color: rgba(255, 255, 255, 0.05);
    --primary-color: #00f2ff;
    --secondary-color: #adff2f;
    --accent-color: #ff4d4d;
    --text-color: #ffffff;
    --text-muted: #a0a0b0;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glow-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
}

html {
    scroll-behavior: smooth;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Background Animation */
.bg-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 50%, rgba(0, 242, 255, 0.05) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 450px;
    z-index: -1;
    overflow: hidden;
    opacity: 0.3;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(2px);
}

.hero-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--bg-color));
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 11, 16, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

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

/* Hero Section */
header {
    text-align: center;
    padding: 4rem 1rem;
    position: relative;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.3));
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Simulation Section */
.simulation-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-bottom: 4rem;
}

.grid-visualizer {
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    aspect-ratio: 1/1;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#grid {
    display: grid;
    gap: 1px;
    background-color: var(--glass-border);
    border: 1px solid var(--glass-border);
}

.cell {
    width: 15px;
    height: 15px;
    background-color: var(--bg-color);
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.cell:hover {
    background-color: var(--glass-border);
}

.cell.wall {
    background-color: var(--accent-color);
    box-shadow: 0 0 5px var(--accent-color);
}

.cell.start {
    background-color: var(--secondary-color);
    box-shadow: 0 0 10px var(--secondary-color);
}

.cell.end {
    background-color: #ffaa00;
    box-shadow: 0 0 10px #ffaa00;
}

.cell.visited {
    background-color: rgba(0, 242, 255, 0.3);
    animation: visitedAnim 0.5s ease-out forwards;
}

.cell.path {
    background-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

@keyframes visitedAnim {
    0% { transform: scale(0.3); background-color: rgba(173, 255, 47, 0.5); border-radius: 100%; }
    50% { background-color: rgba(0, 242, 255, 0.5); }
    100% { transform: scale(1); background-color: rgba(0, 242, 255, 0.3); border-radius: 0; }
}

/* Controls */
.controls {
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 242, 255, 0.4);
}

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

.btn-secondary:hover {
    background: var(--glass-border);
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature-card {
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.feature-title {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.feature-desc {
    color: var(--text-muted);
}

/* Detailed Sections */
.video-section {
    padding: 4rem 0;
    text-align: center;
}

.video-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--surface-color);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
}

.split-layout {
    display: flex;
    gap: 4rem;
    align-items: center;
    text-align: left;
}

.video-info {
    flex: 1;
}

.video-info p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.algo-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.algo-features li {
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.algo-features li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.algo-features strong {
    color: var(--primary-color);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
}

.video-wrapper {
    flex: 1.2;
    position: relative;
    padding-bottom: 33.75%; /* Adjusted for flex height */
    height: 0;
    min-height: 350px;
    overflow: hidden;
    border-radius: 12px;
    border: 3px solid var(--glass-border);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.detailed-section {
    padding: 6rem 0;
    border-top: 1px solid var(--glass-border);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    background: linear-gradient(90deg, var(--primary-color), #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.algo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
}

.algo-content {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.algo-content h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.code-block {
    background: #000;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    color: var(--primary-color);
    margin-top: 1rem;
    border-left: 3px solid var(--primary-color);
}

.video-card {
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.1), var(--surface-color));
    border-color: var(--primary-color);
}

.video-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.8rem 1.2rem;
    background: var(--primary-color);
    color: var(--bg-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    font-family: 'Orbitron', sans-serif;
}

.video-link:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.5);
}

.play-icon {
    font-size: 1.2rem;
}

.docs-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.doc-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.doc-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-family: 'Orbitron', sans-serif;
}

/* Responsive */
@media (max-width: 1000px) {
    .split-layout {
        flex-direction: column;
        gap: 2rem;
    }
    
    .video-wrapper {
        width: 100%;
        padding-bottom: 56.25%;
    }
}

@media (max-width: 900px) {
    .simulation-container, .algo-grid, .docs-container {
        grid-template-columns: 1fr;
    }
}
