:root {
    --bg-color: #050505;
    --card-bg: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --hover-bg: #1a1a1a;
    --border-color: #222;
    --modal-bg: #0f0f0f;
}

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

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

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

/* Header */
header {
    padding: 80px 0 60px;
}

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

.profile-section {
    display: flex;
    align-items: center;
    gap: 40px;
    max-width: 900px;
    text-align: left;
}

.profile-image {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.intro-text h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    line-height: 1.2;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.bio {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
}

.accent {
    color: var(--accent-color);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Filter Nav */
.filter-nav {
    padding: 20px 0;
    margin-bottom: 40px;
    position: sticky;
    top: 0;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.filter-nav .container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

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

.filter-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: #444;
}

.filter-btn.active {
    background: var(--text-primary);
    color: var(--bg-color);
    border-color: var(--text-primary);
    font-weight: 600;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding-bottom: 80px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: #333;
}

.card-image {
    width: 100%;
    height: 200px;
    background-color: #222;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    font-weight: 600;
}

.card-date {
    font-size: 0.8rem;
    color: #666;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.card-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.tag {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
    color: #ccc;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 900px) {
    .profile-section {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Prevent body scroll when modal is open */
    background-color: rgba(0, 0, 0, 0.95);
    /* Darker background */
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: var(--modal-bg);
    margin: 0;
    padding: 0;
    border: none;
    width: 100%;
    height: 100%;
    /* Full screen */
    max-width: none;
    border-radius: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.close-modal {
    color: #fff;
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    z-index: 100;
    transition: color 0.3s;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-modal:hover {
    color: var(--accent-color);
    background: rgba(0, 0, 0, 0.8);
}

.modal-body {
    display: flex;
    flex-direction: row;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* Left Side - Details */
.modal-left {
    padding: 60px 40px;
    width: 35%;
    /* Narrower details pane */
    overflow-y: auto;
    border-right: 1px solid #222;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
}

/* Right Side - Image Slider */
.modal-right {
    width: 65%;
    /* Wider image area */
    background-color: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.modal-category {
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 15px;
}

#modal-title {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: 10px;
}

.modal-date {
    color: #666;
    font-size: 1rem;
    margin-bottom: 25px;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.modal-description h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #fff;
    margin-top: auto;
    /* Push to bottom if space allows */
}

.meta-item {
    margin-bottom: 12px;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.meta-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.meta-item strong {
    color: #ddd;
}

.meta-item span {
    color: var(--text-secondary);
    text-align: right;
    max-width: 60%;
}

/* Image Slider Improvements */
.image-slider {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #000;
}

.slider-container {
    display: flex;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    /* Smooth easing */
}

.slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.slide img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    /* Ensure full image is visible */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.slide iframe {
    width: 90%;
    height: 90%;
    max-width: 1000px;
    border: none;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.video-thumbnail-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.play-icon {
    position: absolute;
    font-size: 2rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, background 0.3s ease;
}

.project-card:hover .play-icon {
    transform: scale(1.1);
    background: var(--accent-color);
    border-color: transparent;
}

/* Slider Navigation Buttons */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 60px;
    height: 60px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.prev {
    left: 30px;
}

.next {
    right: 30px;
}

/* Slider Dots */
.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot:hover {
    background-color: rgba(255, 255, 255, 0.6);
}

.dot.active {
    background-color: var(--accent-color);
    transform: scale(1.2);
}

/* Responsive Modal */
@media (max-width: 1024px) {
    .modal-body {
        flex-direction: column-reverse;
        /* Image on top, details below */
        overflow-y: auto;
        /* Allow scrolling for the whole body */
    }

    .modal-left {
        width: 100%;
        height: auto;
        padding: 30px 20px;
        overflow-y: visible;
    }

    .modal-right {
        width: 100%;
        height: 50vh;
        /* Half screen for image */
        min-height: 300px;
    }

    .close-modal {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 30px;
        background: rgba(0, 0, 0, 0.6);
    }

    .slider-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .prev {
        left: 10px;
    }

    .next {
        right: 10px;
    }
}

/* GitHub Button in Modal */
.github-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #24292e;
    /* GitHub brand color */
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 20px;
    transition: background-color 0.2s;
    width: fit-content;
}

.github-btn:hover {
    background-color: #444;
    /* Slightly lighter on hover */
    color: #fff;
}

.github-btn svg {
    margin-right: 8px;
    /* Ensure space between icon and text */
}