/* CSS Variables (Dark Mode Only) */
:root {
    --bg-color: #022c22;
    --text-primary: #ecfdf5;
    --text-secondary: #a7f3d0;
    --glass-bg: rgba(0, 0, 0, 0.4);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    --accent: #34d399;
    --accent-hover: #10b981;

    --btn-bg: #064e3b;
    --btn-text: #a7f3d0;
    --btn-active-bg: #10b981;
    --btn-active-text: #022c22;
}

/* Global Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    width: 100%;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Offset for sticky header */
    overflow-x: hidden;
    width: 100%;
}

/* Matrix Background */
#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -5;
    opacity: 0.6; /* Visible in dark mode */
    pointer-events: none;
}

/* Background Blobs for Visual Interest */
.blob {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    border-radius: 50%;
    animation: float 10s ease-in-out infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(52,211,153,0.3) 0%, rgba(16,185,129,0) 70%);
}

.blob-2 {
    bottom: 20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(6,78,59,0.2) 0%, rgba(4,120,87,0) 70%);
    animation-delay: -5s;
}

@keyframes float {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(50px, 30px) scale(1.05); }
}

/* Layout */
.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Header & Navigation */
header {
    padding: 2rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 101;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    padding-bottom: 4px;
}

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

.nav-link:hover {
    color: var(--accent);
}

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

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
}

.icon-btn:hover {
    color: var(--accent);
}

.lang-switch {
    display: flex;
    background: var(--btn-bg);
    border-radius: 20px;
    padding: 4px;
}

.lang-switch button {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--btn-text);
    cursor: pointer;
}

.lang-switch button.active {
    background: var(--btn-active-bg);
    color: var(--btn-active-text);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
}

/* Hero Section */
.hero {
    margin-top: 4rem;
    margin-bottom: 4rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

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

.summary {
    font-size: 1.15rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* General Sections */
.section-block {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

/* Timeline (Education) */
.timeline {
    position: relative;
    padding-left: 4.5rem !important;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 2.5rem;
    top: 2.5rem;
    bottom: 2.5rem;
    width: 2px;
    transform: translateX(-50%);
    background: var(--accent);
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    margin-bottom: 1rem;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 0.15rem; /* Moved up to align better with the text center */
    width: 16px;
    height: 16px;
    transform: translateX(-50%);
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--bg-color);
}

.timeline-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: var(--text-secondary);
    font-weight: 600;
}

.badge {
    background: var(--btn-bg);
    color: var(--btn-text);
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

/* Cards (Experience) */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.card {
    padding: 2rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.card-header h3 {
    font-size: 1.4rem;
}

.location {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

.subtitle {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.bullet-list {
    list-style: none;
}

.bullet-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.bullet-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* Project Links & Gallery */
.mt-3 {
    margin-top: 1.5rem;
}

.text-center {
    text-align: center;
}

.steam-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #171a21;
    color: #c7d5e0;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid #2a475e;
    transition: all 0.3s ease;
}

.steam-btn:hover {
    background: #2a475e;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

/* --- Carousel System --- */
.carousel-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.carousel-track-wrapper {
    overflow: hidden;
    width: 100%;
    border-radius: 8px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    min-width: calc(100% / 3);
    padding: 0 5px; 
    box-sizing: border-box;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent);
    font-size: 1.2rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.carousel-btn:hover {
    background: rgba(0, 255, 204, 0.3);
    color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    border-color: var(--accent);
}

.gallery-link {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.comm-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

@media (hover: hover) {
    .gallery-link:hover {
        transform: scale(1.05);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
    
    .gallery-link:hover .comm-img {
        transform: scale(1.1);
    }
}

/* Skills */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-group h4 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    background: var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: default;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--accent);
    color: var(--btn-active-text);
    transform: translateY(-2px);
}

/* References */
.references-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.ref-card {
    text-align: center;
    padding: 2rem;
}

.ref-company {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.ref-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ref-contact {
    color: var(--text-secondary);
}

/* Interactive Elements */
.interactive {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

@media (hover: hover) {
    .interactive:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--glass-border);
    margin-top: 2rem;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-block:nth-child(1) { animation-delay: 0.1s; }
.section-block:nth-child(2) { animation-delay: 0.2s; }
.section-block:nth-child(3) { animation-delay: 0.3s; }
.section-block:nth-child(4) { animation-delay: 0.4s; }

/* Responsive adjustments */
@media (max-width: 900px) {
    .hamburger-btn {
        display: block;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-color);
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        border-bottom: 1px solid transparent;
        box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    }

    .main-nav.active {
        padding: 1.5rem 0;
        max-height: 400px;
        border-bottom: 1px solid var(--glass-border);
    }

    .nav-link {
        font-size: 1.2rem;
    }

    .controls {
        width: auto;
    }
}

@media (max-width: 768px) {
    .glass-panel {
        padding: 1.5rem;
    }
    
    .timeline {
        padding-left: 2rem !important;
    }

    .timeline::before {
        left: 1rem;
        top: 1rem;
        bottom: 1rem;
    }
    
    .timeline-dot {
        left: -1rem;
        top: 0.5rem; /* Exactly aligned for mobile font size */
    }

    .hero h1 {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    .contact-info {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }

    .card-header {
        flex-direction: column;
    }

    .location {
        margin-top: 0.5rem;
    }
    .carousel-item {
        min-width: 100%; /* Only 1 item visible at a time on mobile */
    }

    .comm-img {
        height: 200px; /* Slightly larger for mobile full width */
    }
    .gallery-img.showcase-img {
        height: auto;
        max-height: 250px;
        width: 100%;
        object-fit: cover;
    }
    
    .lang-switch {
        width: auto;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 90vh;
    }

    .lightbox-close {
        top: 15px;
        right: 25px;
    }
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.3); /* Made this much more transparent */
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.show .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}
