/* Portfolio Gallery - Secure & Offline-first CSS */
/* No external dependencies, performance optimized */

/* ====== Portfolio Header ====== */
.portfolio-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e5e5e5;
    transition: box-shadow 0.3s ease;
}

.portfolio-header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* ====== Portfolio Hero ====== */
.portfolio-hero {
    background: linear-gradient(135deg, #1e40af 0%, #172554 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
}

.portfolio-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.portfolio-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ====== Filter Buttons ====== */
.portfolio-filters {
    background: white;
    padding: 30px 0;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 70px;
    z-index: 90;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-btn {
    background: transparent;
    border: 2px solid #1e40af;
    color: #1e40af;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    outline: none;
}

.filter-btn:hover {
    background: #1e40af;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.4);
}

.filter-btn.active {
    background: #1e40af;
    color: white;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.4);
}

.filter-btn:focus {
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.3);
}

/* ====== Projects Grid ====== */
.portfolio-gallery {
    padding: 60px 0;
    background: #f8f9fa;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* ====== Project Card ====== */
.project-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    opacity: 1;
    transform: scale(1);
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.project-card.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* ====== Project Images ====== */
.project-images {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(30, 64, 175, 0.8) 0%, rgba(23, 37, 84, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.project-card:hover .image-overlay {
    opacity: 1;
}

.project-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #1e40af;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* ====== Project Info ====== */
.project-info {
    padding: 25px;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.project-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 20px;
}

.project-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-cta {
    background: #1e40af;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.project-cta:hover {
    background: #172554;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.4);
}

/* ====== Portfolio Stats ====== */
.portfolio-stats {
    background: #1e40af;
    color: white;
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    text-align: center;
}

.stat-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.stat-item.animate {
    opacity: 1;
    transform: translateY(0);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #fff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ====== Portfolio CTA ====== */
.portfolio-cta {
    background: white;
    padding: 80px 0;
    text-align: center;
}

.portfolio-cta h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
}

.portfolio-cta p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn.primary {
    background: #25d366;
    color: white;
}

.btn.primary:hover {
    background: #22c55e;
    transform: translateY(-3px);
}

.btn.secondary {
    background: transparent;
    color: #1e40af;
    border: 2px solid #1e40af;
}

.btn.secondary:hover {
    background: #1e40af;
    color: white;
}

/* ====== Lightbox Modal ====== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-container {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.lightbox-content {
    display: flex;
    height: 600px;
}

.lightbox-image-container {
    flex: 2;
    position: relative;
    background: #f5f5f5;
}

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

.image-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.control-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: all;
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.lightbox-info {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lightbox-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

.lightbox-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

.lightbox-meta {
    margin-bottom: 30px;
}

.lightbox-meta span {
    display: block;
    margin-bottom: 8px;
    color: #999;
    font-size: 0.9rem;
}

.lightbox-cta {
    margin-top: auto;
}

/* ====== Loading State ====== */
.loading-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 2s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ====== Responsive Design ====== */
@media (max-width: 768px) {
    .portfolio-hero h1 {
        font-size: 2rem;
    }
    
    .portfolio-hero p {
        font-size: 1rem;
    }
    
    .filter-buttons {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .filter-btn {
        white-space: nowrap;
        min-width: auto;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .lightbox-content {
        flex-direction: column;
        height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .lightbox-image-container {
        height: 300px;
    }
    
    .lightbox-info {
        padding: 30px 20px;
    }
    
    .lightbox-title {
        font-size: 1.4rem;
    }
    
    .image-controls {
        left: 10px;
        right: 10px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .portfolio-filters {
        padding: 20px 0;
    }
    
    .portfolio-gallery {
        padding: 40px 0;
    }
    
    .portfolio-cta h2 {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* ====== Focus Accessibility ====== */
.project-card:focus,
.filter-btn:focus,
.lightbox-close:focus,
.control-btn:focus {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
}

/* ====== Reduced Motion ====== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transform: none !important;
    }
}

/* ====== Print Styles ====== */
@media print {
    .portfolio-filters,
    .lightbox,
    .image-controls {
        display: none !important;
    }
    
    .project-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ====== Video Showcase (Instagram embed) ====== */
/* Warna biru disamakan dengan page utama: --clr-primary #1e40af */
.portfolio-video {
    background: #f8f9fa;
    padding: 60px 0;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
}

.video-heading {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 10px;
}

.video-subheading {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 40px;
}

.video-card {
    display: flex;
    flex-wrap: wrap;
    gap: 35px;
    align-items: center;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    padding: 35px;
    text-align: left;
}

.video-embed {
    flex: 0 0 auto;
    width: 100%;
    max-width: 380px;
}

.video-embed iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 12px;
    background: #f0f0f0;
}

.video-caption {
    flex: 1 1 260px;
}

.video-caption h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 12px;
}

.video-caption p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
}

.video-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1e40af;
    color: white;
    padding: 14px 26px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.video-cta:hover {
    background: #172554;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.4);
}

.video-cta:focus {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .portfolio-video {
        padding: 40px 0;
    }

    .video-heading {
        font-size: 1.7rem;
    }

    .video-card {
        flex-direction: column;
        padding: 22px;
        text-align: center;
    }

    .video-caption {
        flex-basis: auto;
    }
}

@media print {
    .portfolio-video {
        display: none !important;
    }
}

/* ====== Galeri Proyek — heading ====== */
.gallery-heading {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1e40af;
    text-align: center;
    margin-bottom: 10px;
}

.gallery-subheading {
    font-size: 1.1rem;
    color: #666;
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}

/* ====== Kartu proyek — placeholder foto (sebelum dokumentasi asli ada) ====== */
.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #1e40af 0%, #172554 100%);
    color: rgba(255, 255, 255, 0.9);
}

.project-placeholder i {
    font-size: 2.6rem;
    opacity: 0.85;
}

.project-placeholder span {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Badge before/after pada kartu yang sudah punya foto */
.project-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.78rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
}

/* Kartu draft (belum ada foto) — tidak interaktif */
.project-card.is-draft {
    cursor: default;
}

/* Deskripsi placeholder saat detail proyek belum diisi */
.project-description.is-pending {
    font-style: italic;
    color: #9aa1ab;
}

/* ====== Testimoni klien di kartu ====== */
.project-quote {
    margin: 0 0 20px;
    padding: 4px 0 4px 16px;
    border-left: 3px solid #fbbf24;
}

.project-quote p {
    font-style: italic;
    color: #444;
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 6px;
}

.project-quote cite {
    font-style: normal;
    font-weight: 700;
    font-size: 0.85rem;
    color: #1e40af;
}

@media (max-width: 768px) {
    .gallery-heading {
        font-size: 1.7rem;
    }
}