/* ===== WORK PAGE STYLES - ENHANCED MASONRY GRID ===== */

/* ===== MAIN CONTENT PADDING ===== */
main {
    padding-top: 100px;
    min-height: 100vh;
}

/* ===== SECTION HEADERS ===== */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h1,
.section-header h2 {
    font-family: 'Sugar Snow', cursive;
    font-size: 3.5rem;
    color: var(--text-light, #ffffff);
    margin-bottom: 15px;
    font-weight: normal;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-gray, #a0a0aa);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== GALLERY SECTION ===== */
#gallery-section {
    padding: 80px 20px 100px;
    background: var(--bg-dark, #0a0a0f);
}

/* ===== SHOWREEL SECTION ===== */
#showreel-section {
    padding: 100px 20px;
    background: var(--card-bg, #1a1a24);
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

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

.showreel-video-wrapper {
    position: relative;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.showreel-video-wrapper:hover {
    transform: translateY(-5px);
}

.showreel-thumbnail {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.showreel-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.showreel-video-wrapper:hover .showreel-thumbnail img {
    transform: scale(1.05);
}

.showreel-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.showreel-video-wrapper:hover .showreel-play-overlay {
    background: rgba(0, 0, 0, 0.6);
}

.showreel-play-button {
    width: 80px;
    height: 80px;
    background: var(--green, #8B5CF6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.showreel-video-wrapper:hover .showreel-play-button {
    transform: scale(1.1);
}

.showreel-play-button svg {
    width: 35px;
    height: 35px;
    fill: var(--text-light, #ffffff);
    margin-left: 3px;
}

.showreel-video-player {
    display: none;
}

.showreel-video-player.active {
    display: block;
}

.showreel-video-player video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 15px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 60px;
    flex-wrap: wrap;
    position: sticky;
    top: 80px;
    background: var(--bg-dark, #0a0a0f);
    padding: 20px 0;
    z-index: 100;
}

.filter-btn {
    padding: 12px 28px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: var(--text-gray, #a0a0aa);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
}

.filter-btn:hover {
    border-color: var(--green, #24FF72);
    color: var(--text-light, #ffffff);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--green, #24FF72);
    border-color: var(--green, #24FF72);
    color: var(--bg-dark, #0a0a0f);
}

/* ===== ENHANCED MASONRY GRID - COLUMNS LAYOUT ===== */
.masonry-grid {
    column-count: 4;
    column-gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Masonry Item */
.masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: var(--card-bg, #1a1a24);
    cursor: pointer;
    transition: transform 0.3s ease;
    will-change: transform, opacity;
}

.masonry-item:hover {
    z-index: 10;
}

.masonry-item-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.masonry-item-inner img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.masonry-item:hover img {
    transform: scale(1.08);
}

/* Video Indicator */
.video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--green, #24FF72);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 5;
}

.video-indicator svg {
    stroke: var(--bg-dark, #0a0a0f);
    padding-left: 4px;
}

.masonry-item:hover .video-indicator {
    opacity: 1;
}

/* Overlay on hover */
.masonry-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
}

.masonry-item:hover .masonry-overlay {
    transform: translateY(0);
}

.masonry-title {
    color: var(--text-light, #ffffff);
    font-size: 1rem;
    font-weight: 600;
}

.masonry-category {
    color: var(--green, #24FF72);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hidden items (when filtered) */
.masonry-item.hidden {
    opacity: 0 !important;
    transform: scale(0.8);
}

/* ===== PROJECTS SECTION - VERTICAL LAYOUT ===== */
#projects-section {
    padding: 100px 20px;
    background: var(--card-bg, #1a1a24);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.projects-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Individual Project Card - Vertical Stack */
.project-card {
    background: var(--bg-dark, #0a0a0f);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s ease;
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Project Banner Image */
.project-banner {
    width: 100%;
    height: 400px;
    overflow: hidden;
    position: relative;
}

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

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

/* Project Header Info */
.project-header {
    padding: 30px 35px;
}

.project-header h3 {
    font-family: 'Sugar Snow', cursive;
    font-size: 2rem;
    color: var(--text-light, #ffffff);
    margin-bottom: 12px;
    font-weight: normal;
    line-height: 1.2;
}

.project-category {
    display: inline-block;
    color: var(--green, #24FF72);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 18px;
    font-weight: 500;
}

.project-short-description {
    font-size: 1.063rem;
    line-height: 1.7;
    color: var(--text-gray, #a0a0aa);
    margin-bottom: 25px;
}

/* Expand/Collapse Button */
.project-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: transparent;
    border: 2px solid var(--green, #24FF72);
    color: var(--text-light, #ffffff);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
}

.project-toggle-btn:hover {
    background: var(--green, #24FF72);
    color: var(--bg-dark, #0a0a0f);
    transform: translateY(-2px);
}

.project-toggle-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.project-card.expanded .project-toggle-btn svg {
    transform: rotate(180deg);
}

/* Expanded Content Area */
.project-expanded-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease;
    padding: 0 35px;
}

.project-card.expanded .project-expanded-content {
    max-height: 5000px;
    padding: 0 35px 35px 35px;
}

.project-description {
    font-size: 1.063rem;
    line-height: 1.8;
    color: var(--text-gray, #a0a0aa);
    margin-bottom: 30px;
}

/* Project Images Grid */
.project-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.project-images-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.project-images-grid img:hover {
    transform: scale(1.03);
}

/* Project Tools */
.project-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}

.project-tool-tag {
    padding: 8px 18px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--purple, #8B5CF6);
    font-size: 0.875rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Before/After Slider */
.before-after-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 30px auto;
    overflow: hidden;
    border-radius: 10px;
}

.before-after-container h4 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.25rem;
}

.before-after-slider {
    position: relative;
    width: 100%;
    padding-bottom: 60%;
    overflow: hidden;
}

.before-image,
.after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.after-image {
    clip-path: inset(0 50% 0 0);
}

.slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: var(--green, #24FF72);
    cursor: ew-resize;
    z-index: 10;
}

.slider-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--green, #24FF72);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.slider-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 20;
}

/* Video Embed */
.project-video-embed {
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
}

.project-video-embed iframe {
    width: 100%;
    height: 450px;
    border: none;
}

/* ===== LIGHTBOX MODAL ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.lightbox.active {
    display: flex;
    animation: lightboxFadeIn 0.4s ease forwards;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    opacity: 0;
    transform: scale(0.8);
    animation: fadeInScale 0.4s ease 0.2s forwards;
}

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-close:hover {
    background: var(--green, #24FF72);
    border-color: var(--green, #24FF72);
    transform: scale(1) rotate(90deg);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-light, #ffffff);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    opacity: 0;
    animation: fadeInScale 0.4s ease 0.3s forwards;
}

.lightbox-nav:hover {
    background: var(--green, #24FF72);
    border-color: var(--green, #24FF72);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-nav svg {
    width: 28px;
    height: 28px;
    stroke: var(--text-light, #ffffff);
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.9);
    animation: contentZoomIn 0.4s ease 0.1s forwards;
}

@keyframes contentZoomIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-content iframe {
    width: 90vw;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-light, #ffffff);
    font-size: 1rem;
    text-align: center;
    max-width: 80%;
    opacity: 0;
    animation: fadeInUp 0.4s ease 0.4s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 2;
        column-gap: 15px;
    }
    
    .projects-container {
        max-width: 700px;
    }
}

@media (max-width: 768px) {
    main {
        padding-top: 80px;
    }
    
    .section-header h1,
    .section-header h2 {
        font-size: 2.5rem;
    }
    
    .filter-bar {
        top: 60px;
        gap: 10px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 0.938rem;
    }
    
    .masonry-grid {
        column-count: 2;
        column-gap: 12px;
    }
    
    .masonry-item {
        margin-bottom: 12px;
    }
    
    .project-banner {
        height: 280px;
    }
    
    .project-header {
        padding: 25px;
    }
    
    .project-header h3 {
        font-size: 1.75rem;
    }
    
    .project-expanded-content {
        padding: 0 25px;
    }
    
    .project-card.expanded .project-expanded-content {
        padding: 0 25px 25px 25px;
    }
    
    .project-video-embed iframe {
        height: 300px;
    }
    
    .lightbox-nav {
        width: 50px;
        height: 50px;
    }
    
    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    #gallery-section,
    #projects-section {
        padding: 60px 15px;
    }
    
    .section-header h1,
    .section-header h2 {
        font-size: 2rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .filter-bar {
        gap: 8px;
        padding: 15px 0;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.875rem;
    }
    
    .masonry-grid {
        column-count: 1;
    }
    
    .video-indicator {
        width: 60px;
        height: 60px;
    }
    
    .project-banner {
        height: 220px;
    }
    
    .project-header {
        padding: 20px;
    }
    
    .project-header h3 {
        font-size: 1.5rem;
    }
    
    .project-short-description {
        font-size: 1rem;
    }
    
    .project-toggle-btn {
        padding: 12px 24px;
        font-size: 0.938rem;
    }
    
    .project-expanded-content {
        padding: 0 20px;
    }
    
    .project-card.expanded .project-expanded-content {
        padding: 0 20px 20px 20px;
    }
    
    .project-images-grid {
        grid-template-columns: 1fr;
    }
    
    .project-video-embed iframe {
        height: 220px;
    }
    
    .lightbox-nav {
        width: 45px;
        height: 45px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
}