/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Fira+Code:wght@400;500;600&display=swap');

/* Root Variables */
:root {
    --transition-speed: 0.3s;
    --border-radius: 0.5rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #0a0e27;
}

::-webkit-scrollbar-thumb {
    background: #0ea5e9;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0284c7;
}

/* Base Styles */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

/* Navigation Links */
.nav-link {
    position: relative;
    padding: 0.5rem 0;
    color: #4b5563;
    transition: color var(--transition-speed);
}

.dark .nav-link {
    color: #9ca3af;
}

.nav-link:hover {
    color: #0ea5e9;
}

.dark .nav-link:hover {
    color: #38bdf8;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #0ea5e9, #3b82f6);
    transition: width var(--transition-speed);
}

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

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    color: white;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #0ea5e9;
    font-weight: 600;
    border: 2px solid #0ea5e9;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

.dark .btn-secondary {
    background: #141b2d;
    color: #38bdf8;
    border-color: #38bdf8;
}

.btn-secondary:hover {
    background: #0ea5e9;
    color: white;
    transform: translateY(-2px);
}

.dark .btn-secondary:hover {
    background: #38bdf8;
    color: #0a0e27;
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Cards */
.skill-card {
    padding: 1.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

.dark .skill-card {
    background: #141b2d;
    border-color: #1e293b;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #0ea5e9;
}

.dark .skill-card:hover {
    border-color: #38bdf8;
}

.education-card {
    padding: 2rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

.dark .education-card {
    background: #141b2d;
    border-color: #1e293b;
}

.education-card:hover {
    box-shadow: var(--shadow-xl);
    border-color: #0ea5e9;
}

.dark .education-card:hover {
    border-color: #38bdf8;
}

.experience-card {
    padding: 2.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.dark .experience-card {
    background: #141b2d;
    border-color: #1e293b;
}

.achievement-item {
    padding: 1.5rem;
    background: #f9fafb;
    border-left: 4px solid #0ea5e9;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

.dark .achievement-item {
    background: #0a0e27;
    border-left-color: #38bdf8;
}

.achievement-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.publication-card {
    padding: 2rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

.dark .publication-card {
    background: #141b2d;
    border-color: #1e293b;
}

.publication-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: #0ea5e9;
}

.dark .publication-card:hover {
    border-color: #38bdf8;
}

.project-card {
    position: relative;
    padding: 2rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dark .project-card {
    background: #141b2d;
    border-color: #1e293b;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9, #3b82f6);
    transform: scaleX(0);
    transition: transform var(--transition-speed);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: #e0f2fe;
    color: #075985;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.dark .badge {
    background: #0c4a6e;
    color: #bae6fd;
}

/* Filter Buttons */
.filter-btn {
    padding: 0.5rem 1.25rem;
    background: white;
    color: #4b5563;
    border: 2px solid #e5e7eb;
    border-radius: 9999px;
    font-weight: 500;
    transition: all var(--transition-speed);
    cursor: pointer;
}

.dark .filter-btn {
    background: #141b2d;
    color: #9ca3af;
    border-color: #1e293b;
}

.filter-btn:hover,
.filter-btn.active {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
    transform: scale(1.05);
}

.dark .filter-btn:hover,
.dark .filter-btn.active {
    background: #38bdf8;
    border-color: #38bdf8;
}

/* Contact Links */
.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

.dark .contact-link {
    background: #141b2d;
    border-color: #1e293b;
}

.contact-link:hover {
    transform: translateX(10px);
    border-color: #0ea5e9;
    box-shadow: var(--shadow-md);
}

.dark .contact-link:hover {
    border-color: #38bdf8;
}

/* Code Block Styling */
pre[class*="language-"] {
    border-radius: var(--border-radius);
    margin: 1rem 0;
    max-height: 400px;
}

code[class*="language-"] {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDelay {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.fade-in-delay {
    animation: fadeInDelay 0.8s ease-out 0.3s both;
}

/* Intersection Observer Animation Classes */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Tech Stack Grid */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: #0369a1;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #bae6fd;
}

.dark .tech-tag {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    color: #bae6fd;
    border-color: #075985;
}

/* Project Image Container */
.project-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.dark .project-image {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(14, 165, 233, 0.3);
    border-radius: 50%;
    border-top-color: #0ea5e9;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Metrics Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Code Snippet Card */
.code-snippet {
    position: relative;
    margin-top: 1rem;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.code-snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #1e293b;
    color: #f1f5f9;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
}

.dark .code-snippet-header {
    background: #0a0e27;
}

.copy-btn {
    padding: 0.25rem 0.75rem;
    background: #334155;
    color: #f1f5f9;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.copy-btn:hover {
    background: #475569;
}

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

/* Accessibility */
:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

.dark :focus-visible {
    outline-color: #38bdf8;
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Utility Classes */
.glass-effect {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dark .glass-effect {
    background: rgba(20, 27, 45, 0.8);
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hover-scale {
    transition: transform var(--transition-speed);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* GIF Preview */
.gif-preview {
    width: 100%;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    cursor: pointer;
    transition: transform var(--transition-speed);
}

.gif-preview:hover {
    transform: scale(1.02);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    padding: 2rem;
    position: relative;
}

.dark .modal-content {
    background: #141b2d;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.modal-close:hover {
    background: #dc2626;
    transform: rotate(90deg);
}
/* ====================================
   Image Gallery Styles
   ==================================== */

/* Gallery Grid for Thumbnails */
.image-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .image-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

.gallery-thumbnail-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    background: #f3f4f6;
}

.dark .gallery-thumbnail-wrapper {
    background: #1e293b;
}

.gallery-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
    border: 2px solid transparent;
    display: block;
}

.gallery-thumbnail:hover {
    transform: scale(1.05);
    border-color: #0ea5e9;
    box-shadow: var(--shadow-lg);
}

/* Lightbox Viewer */
#imageLightbox {
    background: rgba(0, 0, 0, 0.95);
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

@media (max-width: 768px) {
    .lightbox-content {
        padding: 1rem;
    }
}

.lightbox-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
}

@media (max-width: 768px) {
    .lightbox-image {
        max-height: 70vh;
    }
}

/* Lightbox Navigation Buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(14, 165, 233, 0.8);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-speed);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(14, 165, 233, 1);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
    left: 2rem;
}

.lightbox-nav.next {
    right: 2rem;
}

@media (max-width: 768px) {
    .lightbox-nav {
        padding: 0.75rem;
        font-size: 1.25rem;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-nav.prev {
        left: 1rem;
    }
    
    .lightbox-nav.next {
        right: 1rem;
    }
}

/* Lightbox Counter */
.lightbox-counter {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 10;
    backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
    .lightbox-counter {
        bottom: 1rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
}

/* Lightbox Close Button (override modal-close for lightbox) */
#imageLightbox .modal-close {
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(4px);
    z-index: 10;
}

#imageLightbox .modal-close:hover {
    background: rgba(220, 38, 38, 1);
}