/* Custom CSS Variables */
:root {
  /* Dark theme: Deep Academic */
  --bg-primary: #0f172a;
  --bg-secondary: #1a273a;
  --bg-tertiary: #2a3b50;
  --text-primary: #f8fafc;
  --text-primary-rgb: 248, 250, 252;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --accent-color: #00d4ff;
  --card-bg: linear-gradient(145deg, #1a273a, #0f172a);
  --shadow-color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  /* Light theme: Clean Paper */
  --bg-primary: #ffffff;
  --bg-secondary: #f0f4f8;
  --bg-tertiary: #e2e8f0;
  --text-primary: #1a202c;
  --text-primary-rgb: 26, 32, 44;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border-color: #cbd5e0;
  --accent-color: #00d4ff;
  --card-bg: linear-gradient(145deg, #ffffff 0%, #f0f4f8 100%);
  --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Font Families */
.font-inter {
    font-family: 'Inter', sans-serif;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* Loading Screen */
#loading {
    transition: opacity 0.5s ease-in-out;
}

.loading-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background-color: var(--text-primary);
    border-radius: 50%;
    animation: loading 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scroll Progress Bar */
#scroll-progress {
    width: 0%;
    transition: width 0.3s ease;
    background-color: var(--text-primary);
}

/* Navigation */
.nav-link {
    position: relative;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

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

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background-color: var(--accent-color);
    color: var(--bg-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--accent-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background-color: transparent;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

/* Social Links */
.social-link {
    color: var(--text-muted);
    transition: all 0.3s ease;
    display: inline-block;
}

.social-link:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* Typewriter Effect */
.cursor {
    animation: blink 1s infinite;
}

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

/* Scroll Indicator */
.scroll-indicator {
    width: 2px;
    height: 50px;
    background-color: var(--text-muted);
    position: relative;
    border-radius: 1px;
}

.scroll-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-primary);
    border-radius: 50%;
    position: absolute;
    left: -2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        top: 0;
        opacity: 1;
    }
    100% {
        top: 44px;
        opacity: 0;
    }
}

/* Matrix Background */
#matrix-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Project Cards */
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--text-primary-rgb), 0.1), transparent);
    transition: left 0.5s ease;
}

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

.project-card:hover {
    transform: translateY(-8px);
    border-color: #666;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-image {
    width: 100%;
    height: 200px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 24px;
}

.tech-tag {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    margin: 2px;
    border: 1px solid var(--border-color);
}

/* Blog Cards */
.blog-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
    box-shadow: 0 12px 30px var(--shadow-color);
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.blog-tags {
    margin-top: auto;
}

.blog-tag {
    display: inline-block;
    padding: 4px 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 11px;
    margin: 2px;
}

/* Filter Buttons */
.filter-btn {
    padding: 8px 16px;
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--accent-color);
    color: var(--bg-primary);
    border-color: var(--accent-color);
}

/* Search Input */
.search-input {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    width: 100%;
    max-width: 400px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 8px;
    width: 12px;
    height: 12px;
    background-color: var(--accent-color);
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Skills Grid */
.skill-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.skill-icon {
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .project-card,
    .blog-card {
        margin-bottom: 24px;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Back to Top Button */
#back-to-top {
    transition: all 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Code Blocks */
.code-block {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    overflow-x: auto;
}

/* Highlight Effect */
.highlight {
    background: linear-gradient(120deg, transparent 0%, rgba(var(--text-primary-rgb), 0.1) 50%, transparent 100%);
    background-size: 200% 200%;
    animation: highlight 2s ease-in-out;
}

@keyframes highlight {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Print Styles */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    nav, footer, #back-to-top {
        display: none !important;
    }
    
    .no-print {
        display: none !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Theme Variables */
:root {
  /* Dark theme (default) */
  --bg-primary: #000000;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --border-color: #374151;
  --accent-color: #ffffff;
  --card-bg: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  --shadow-color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  /* Light theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --accent-color: #000000;
  --card-bg: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  --shadow-color: rgba(0, 0, 0, 0.1);
}



/* Update existing styles to use CSS variables */

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}

.theme-switch input {
    display:none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}


/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}

.theme-switch input {
    display:none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}


/* Name SVG */
.name-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 80px;
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 1;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}
