/* Portfolio Section Title - Stylish dengan Gradasi Teal Semi Putih */
.portfolio-section h2 {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    background: linear-gradient(135deg, #1e3a8a 0%, #008080 30%, #9AD0C2 70%, #f8fafc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    margin-bottom: 2rem;
    position: relative;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

/* Animation untuk title */
@keyframes titleGlow {
    0% {
        filter: drop-shadow(0 0 5px rgba(0, 128, 128, 0.3));
        transform: translateY(0);
    }
    100% {
        filter: drop-shadow(0 0 20px rgba(248, 250, 252, 0.8));
        transform: translateY(-2px);
    }
}

/* Decorative line under title */
.portfolio-section h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #008080, transparent);
    border-radius: 2px;
    animation: lineExpand 2s ease-in-out infinite alternate;
}

@keyframes lineExpand {
    0% { width: 60px; opacity: 0.6; }
    100% { width: 120px; opacity: 1; }
}

/* Modern Filter Buttons */
.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 40px 0 30px 0;
    justify-content: center;
    padding: 20px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.filter-btn {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: none;
    color: #475569;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 80px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

/* Glassmorphism effect */
.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    background: linear-gradient(145deg, #f8fafc, #ffffff);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.filter-btn.active:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 12px 35px rgba(102, 126, 234, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Alternative color schemes for filter buttons */
.filter-btn:nth-child(2).active {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.filter-btn:nth-child(3).active {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.filter-btn:nth-child(4).active {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #212529;
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
}

.filter-btn:nth-child(5).active {
    background: linear-gradient(135deg, #17a2b8, #6f42c1);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
}

/* Portfolio Modal Styles */
.portfolio-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.portfolio-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 95vw;
    max-height: 95vh;
    width: 1000px;
    overflow: hidden;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { 
        transform: scale(0.8);
        opacity: 0;
    }
    to { 
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.modal-header {
    padding: 20px 20px 10px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.modal-body {
    padding: 0;
}

/* Gallery Container */
.gallery-container {
    position: relative;
    margin-bottom: 20px;
}

.gallery-wrapper {
    display: flex;
    min-height: 500px;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #f8f9fa;
}

.gallery-image {
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    display: none; /* Hidden by default */
    border-radius: 8px;
}

.gallery-image.active {
    display: block; /* Show active image */
}

.gallery-image:hover {
    transform: scale(1.02);
}

/* Navigation Buttons */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 30px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-prev {
    left: 15px;
}

.gallery-next {
    right: 15px;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Gallery Dots */
.gallery-dots {
    text-align: center;
    padding: 15px;
    background: #fff;
}

.gallery-dot {
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.gallery-dot:hover {
    background-color: #717171;
    transform: scale(1.2);
}

.gallery-dot.active {
    background-color: #333;
    transform: scale(1.3);
}

/* Project Description */
.project-description {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.project-description p {
    margin: 0;
    line-height: 1.6;
    color: #555;
}

/* Loading State */
.gallery-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #666;
    font-size: 16px;
}

/* Empty State */
.gallery-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #999;
    font-style: italic;
}

/* Fullscreen Overlay */
.fullscreen-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fullscreen-overlay img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 4px;
}

/* Portfolio Item Hover Effect */
.portfolio-item {
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

/* CSS untuk overlay yang selalu muncul */
.portfolio-overlay {
    /* Overlay selalu terlihat */
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    
    /* Posisi di bawah gambar */
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 15px;
    margin-top: -5px; /* Sedikit overlap dengan gambar */
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-top: 3px solid rgba(0,123,255,0.3);
    transition: all 0.3s ease;
}

/* Hover effect - hanya sedikit enhance */
.masonry-item:hover .portfolio-overlay {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 25px rgba(0,0,0,0.15);
    border-top: 3px solid #007bff;
    transform: translateY(-2px);
}

/* Style untuk judul */
.portfolio-overlay h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #2c3e50;
    line-height: 1.3;
}

/* Style untuk kategori */
.project-category {
    font-size: 11px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
    margin: 0 5px 5px 0;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,123,255,0.3);
}

/* Style untuk jumlah gambar */
.portfolio-overlay small {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    display: block;
    margin-top: 5px;
}

.no-projects {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    width: 100%;
    grid-column: 1 / -1;
}

/* Animation untuk portfolio items */
.portfolio-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.portfolio-item.filtering {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Variasi warna kategori yang cantik */
.masonry-item:nth-child(5n+1) .project-category {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    box-shadow: 0 2px 6px rgba(40,167,69,0.3);
}

.masonry-item:nth-child(5n+2) .project-category {
    background: linear-gradient(135deg, #dc3545, #c82333);
    box-shadow: 0 2px 6px rgba(220,53,69,0.3);
}

.masonry-item:nth-child(5n+3) .project-category {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
    box-shadow: 0 2px 6px rgba(255,193,7,0.3);
}

.masonry-item:nth-child(5n+4) .project-category {
    background: linear-gradient(135deg, #17a2b8, #138496);
    box-shadow: 0 2px 6px rgba(23,162,184,0.3);
}

.masonry-item:nth-child(5n+5) .project-category {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    box-shadow: 0 2px 6px rgba(111,66,193,0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .portfolio-section h2 {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: 1.5rem;
    }
    
    .portfolio-section h2::after {
        width: 80px;
        bottom: -12px;
    }
    
    .portfolio-filters {
        gap: 10px;
        padding: 15px;
        margin: 30px 0 20px 0;
        border-radius: 15px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 10px;
    }
    
    .modal-header h2 {
        font-size: 20px;
        padding-right: 50px;
    }
    
    .gallery-wrapper {
        min-height: 300px;
    }
    
    .gallery-image {
        max-height: 350px;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .gallery-prev {
        left: 10px;
    }
    
    .gallery-next {
        right: 10px;
    }
    
    .project-description {
        padding: 15px;
    }
    
    .masonry-grid {
        gap: 10px !important;
    }
    
    .masonry-item[style*="display: none"] {
        display: none !important;
    }
    
    .portfolio-overlay {
        padding: 10px 12px;
        margin-top: -3px;
    }
    
    .portfolio-overlay h3 {
        font-size: 14px;
    }
    
    .project-category {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .portfolio-overlay small {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .portfolio-section h2 {
        font-size: clamp(1.8rem, 10vw, 2.5rem);
        letter-spacing: -0.01em;
    }
    
    .portfolio-section h2::after {
        width: 60px;
        height: 3px;
        bottom: -10px;
    }
    
    .portfolio-filters {
        gap: 8px;
        padding: 12px;
        margin: 25px 0 15px 0;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .modal-content {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .gallery-wrapper {
        min-height: 250px;
    }
    
    .gallery-image {
        max-height: 300px;
    }
    
    .gallery-nav {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .modal-header {
        padding: 15px 15px 10px;
    }
    
    .modal-close {
        top: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}