:root {
    --bg-color: #0f1115;
    --text-color: #f8f9fa;
    --accent-blue: #00d4ff;
    --accent-amber: #ffb347;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-blur: 12px;
    --card-hover-shadow: 0 20px 40px rgba(0, 212, 255, 0.15);
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    font-family: 'Source Sans Pro', sans-serif;
    /* Subtle background gradient */
    background-image: radial-gradient(circle at 50% 0%, rgba(0, 212, 255, 0.05) 0%, transparent 50%);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
}

.font-display { font-family: 'Inter', sans-serif; }
.font-body { font-family: 'Source Sans Pro', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* Neural Background */
.neural-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}

/* Glassmorphism Utility */
.glass {
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Highlight top border */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Navigation - Floating Island Style */
nav {
    position: fixed;
    top: 1.5rem; /* Floating from top */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    z-index: 50;
    border-radius: 1rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    /* Glass Effect */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(15, 17, 21, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Adjust top padding for content since nav is floating */
section:first-of-type {
    padding-top: 8rem;
}

/* Nav Links */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-amber));
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Text Gradient */
.hero-text {
    background: linear-gradient(135deg, #00d4ff 0%, #ffb347 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block; /* Fix for gradient text sometimes getting cut off */
}

/* Cards (Skills, Projects, etc.) */
.skill-card, .project-card, .timeline-item, .contact-card, .demo-card, .suggestion-card {
    border-radius: 1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Apply Glass Style */
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden; /* For inner effects */
}

/* Hover Effects */
.skill-card:hover, .project-card:hover, .timeline-item:hover, .contact-card:hover, .demo-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow);
    border-color: rgba(0, 212, 255, 0.3);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.05), transparent);
    transition: left 0.6s;
    pointer-events: none;
}

.project-card:hover::before {
    left: 100%;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #00a3cc 100%);
    color: #0f1115;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.btn-outline {
    border: 2px solid var(--accent-amber);
    color: var(--accent-amber);
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    background: transparent;
}

.btn-outline:hover {
    background: var(--accent-amber);
    color: #0f1115;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 179, 71, 0.3);
}

/* Animations */
.floating {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.typing-cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Skill Category Items */
.skill-category-item {
    transition: all 0.3s ease;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
}

.skill-category-item:hover {
    background-color: rgba(0, 212, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.1);
    transform: translateX(5px);
}

/* Light Mode Overrides */
body.light-mode {
    --bg-color: #f8f9fa;
    --text-color: #1a1a1a;
    --accent-blue: #007bff;
    --accent-amber: #ff8c00;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 20px 40px rgba(0, 123, 255, 0.15);

    background-image: radial-gradient(circle at 50% 0%, rgba(0, 123, 255, 0.05) 0%, transparent 50%);
}

body.light-mode .neural-bg {
    opacity: 0.05;
    filter: invert(1); /* Invert the canvas drawing if possible, or just opacity */
}

body.light-mode nav {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

body.light-mode .text-gray-300 { color: #4b5563; }
body.light-mode .text-gray-400 { color: #6b7280; }
body.light-mode .text-ai-white { color: #1a1a1a; }
body.light-mode .text-ai-blue { color: var(--accent-blue); }
body.light-mode .text-ai-amber { color: var(--accent-amber); }

body.light-mode .skill-card,
body.light-mode .project-card,
body.light-mode .timeline-item,
body.light-mode .contact-card,
body.light-mode .demo-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

body.light-mode .skill-card:hover,
body.light-mode .project-card:hover {
    box-shadow: 0 20px 40px rgba(0, 123, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.2);
    background: #ffffff;
}

/* Form Styles */
.form-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    color: var(--text-color);
}

.form-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

body.light-mode .form-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Timeline specific */
.project-timeline {
    position: relative;
}

.project-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-blue), var(--accent-amber));
    transform: translateX(-50%);
}

.timeline-node {
    position: relative;
    z-index: 2;
}

.timeline-node::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 2rem;
    width: 12px;
    height: 12px;
    background: var(--accent-blue);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* Code Editor specific */
.code-editor {
    background: #1e1e1e; /* Consistent dark bg for code */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Filter Buttons */
.filter-btn {
    transition: all 0.3s ease;
    backdrop-filter: blur(var(--glass-blur));
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-btn:hover, .filter-btn.active {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Contact Form Specific */
.submit-btn {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-amber));
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.4);
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Demos Specific */
.output-panel {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    min-height: 200px;
}

.run-btn {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-amber));
    transition: all 0.3s ease;
}

.run-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.4);
}

.demo-selector {
    backdrop-filter: blur(var(--glass-blur));
    background: rgba(248, 249, 250, 0.05);
    border: 1px solid rgba(255, 179, 71, 0.3);
}

.loading {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
