/* ==========================================================
   FILE: style_visitor_works.css
   TEMA: Works Gallery & Interactive Grid Media
   DESKRIPSI: Full Responsif, Auto-Center di semua layar
========================================================== */

:root {
    --bg-dark: #070a13;
    --card-bg: rgba(13, 18, 30, 0.7);
    --cyan-glow: #00f0ff;
    --orange-glow: #ff8c00;
    --text-main: #ffffff;
    --text-muted: #8b9bb4;
    --border-glass: rgba(0, 240, 255, 0.2);
}

.hide-element { display: none !important; }
.show-flex { display: flex !important; }
.no-scroll { overflow: hidden; }

/* Global Page Layout */
.works-page { padding-top: 150px; padding-bottom: 100px; min-height: 100vh; }
.page-header { text-align: center; margin-bottom: 50px; }
.page-header h1 { font-size: 3.5rem; font-weight: 900; color: var(--text-main); margin-bottom: 10px; }
.text-gradient { background: linear-gradient(90deg, var(--cyan-glow), var(--orange-glow)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.page-header p { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* Tombol Kembali */
.btn-back {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted); text-decoration: none; padding: 10px 20px;
    border-radius: 10px; font-weight: 600; transition: 0.3s; margin-bottom: 30px;
}
.btn-back:hover {
    background: rgba(0, 240, 255, 0.1); border-color: var(--cyan-glow);
    color: var(--cyan-glow); transform: translateX(-5px); box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}


/* ==========================================================
   1. FILTER PANEL SCI-FI (CENTERED)
========================================================== */
.filter-panel {
    background: var(--card-bg); border: 1px solid var(--border-glass);
    border-radius: 16px; padding: 25px; margin-bottom: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-width: 1000px; margin-left: auto; margin-right: auto; /* Posisi Form ke Tengah */
}

/* Form Item Center Align */
.filter-form { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; justify-content: center; }

.f-group { display: flex; flex: 1; min-width: 200px; position: relative; }
.f-group input, .f-select {
    width: 100%; padding: 14px 15px; border-radius: 10px;
    background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main); font-family: inherit; outline: none; transition: 0.3s; font-size: 0.95rem;
}
.f-group input:focus, .f-select:focus { border-color: var(--cyan-glow); box-shadow: 0 0 15px rgba(0, 240, 255, 0.2); }
.f-select option { background: #070a13; color: #fff; }

.input-search i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.1rem;}
.input-search input { padding-left: 45px; }

.date-group { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-muted); flex: 1.5; min-width: 300px;}
.date-separator { font-weight: 700; color: var(--cyan-glow); }

.btn-filter { background: linear-gradient(45deg, var(--cyan-glow), var(--orange-glow)); color: #000; border: none; padding: 14px 30px; border-radius: 10px; font-weight: 800; cursor: pointer; transition: 0.3s; font-family: inherit; font-size: 1rem;}
.btn-filter:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0, 240, 255, 0.4); color: #fff;}

.btn-reset { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid rgba(255,255,255,0.1); padding: 14px 18px; border-radius: 10px; text-decoration: none; transition: 0.3s; display: flex; align-items: center; justify-content: center; font-size: 1.2rem;}
.btn-reset:hover { background: rgba(255, 71, 87, 0.2); color: #ff4757; border-color: #ff4757; box-shadow: 0 0 15px rgba(255, 71, 87, 0.3);}


/* ==========================================================
   2. GRID KARYA INTERAKTIF (CENTERED)
========================================================== */
.works-grid { 
    display: grid; 
    /* Menggunakan auto-fit agar grid cerdas menyesuaikan ruang kosong */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 40px; 
    justify-content: center; /* Memaksa item ke tengah jika jumlahnya sedikit */
    align-items: start;
}

.work-card { 
    display: flex; flex-direction: column; gap: 15px; transition: 0.3s; 
    width: 100%; max-width: 450px; margin: 0 auto; /* Membatasi lebar maksimal & rata tengah */
}
.work-card:hover { transform: translateY(-5px); }

/* Bingkai Media 16:9 */
.work-frame {
    position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px;
    background: #0d121a; border: 2px solid rgba(255, 255, 255, 0.05); overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.work-card:hover .work-frame { border-color: var(--cyan-glow); box-shadow: 0 10px 30px rgba(0, 240, 255, 0.25); }

/* Media Elements */
.work-img { width: 100%; height: 100%; object-fit: cover; transition: 0.6s; }
.work-card:hover .work-img { transform: scale(1.08); filter: brightness(0.8); }
.grid-media-player { width: 100%; height: 100%; object-fit: cover; border: none; z-index: 5; }

/* Bintang & Ikon Fallback */
.featured-badge { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,0.8); color: #ffca28; width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.9rem; border: 1px solid rgba(255,202,40,0.4); backdrop-filter: blur(5px); z-index: 10; pointer-events: none;}
.fallback-icon { position: absolute; inset: 0; align-items: center; justify-content: center; background: #070a13; font-size: 4rem; color: rgba(255,255,255,0.1); transition: 0.3s; pointer-events: none;}
.work-card:hover .fallback-icon { color: var(--cyan-glow); transform: scale(1.1); }

/* Info Bawah Grid (Judul & Tombol Detail) */
.work-info { display: flex; justify-content: space-between; align-items: center; padding: 0 5px; }
.w-info-left { flex: 1; overflow: hidden; }
.w-info-left h3 { font-size: 1.25rem; color: var(--text-main); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 800; transition: 0.3s;}
.work-card:hover .w-info-left h3 { color: var(--cyan-glow); }
.w-info-left p { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }

.w-info-right { margin-left: 15px; }
.btn-open-modal {
    background: rgba(0, 240, 255, 0.1); color: var(--cyan-glow); border: 1px solid var(--border-glass);
    padding: 10px 18px; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.3s;
    display: inline-flex; align-items: center; gap: 8px; font-family: inherit; font-size: 0.9rem;
}
.btn-open-modal:hover { background: var(--cyan-glow); color: #000; box-shadow: 0 5px 15px rgba(0, 240, 255, 0.4); transform: translateY(-2px); }

.empty-state { grid-column: 1/-1; text-align: center; padding: 80px 20px; color: var(--text-muted); font-size: 1.2rem; background: var(--card-bg); border-radius: 16px; border: 1px dashed var(--border-glass); margin: 0 auto; max-width: 600px;}
.empty-state i { font-size: 4rem; color: var(--cyan-glow); margin-bottom: 15px; opacity: 0.5;}


/* ==========================================================
   3. MODAL POP-UP (KARYA DETAIL & KOMENTAR)
========================================================== */
.work-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); backdrop-filter: blur(15px); display: flex; align-items: center; justify-content: center; z-index: 3000; opacity: 0; visibility: hidden; transition: 0.4s; }
.work-modal-overlay.active { opacity: 1; visibility: visible; }

.work-modal-box { position: relative; width: 95%; max-width: 1200px; height: 85vh; background: #0b0f19; border: 1px solid var(--border-glass); border-radius: 20px; overflow: hidden; transform: scale(0.9); transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); display: flex; flex-direction: column; box-shadow: 0 0 50px rgba(0, 240, 255, 0.15); }
.work-modal-overlay.active .work-modal-box { transform: scale(1); }

.modal-close { position: absolute; top: 15px; right: 20px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; width: 45px; height: 45px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; z-index: 10; transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: #ff4757; color: #fff; border-color: #ff4757; transform: rotate(90deg); box-shadow: 0 0 15px rgba(255,71,87,0.5);}

.modal-split { display: flex; height: 100%; }

/* --- KIRI: Media Viewer Modal --- */
.modal-media-section { flex: 1.6; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--border-glass); position: relative; padding: 20px;}
.modal-media-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px;}
.modal-media-video, .modal-media-iframe { width: 100%; height: 100%; border: none; border-radius: 8px;}
.modal-link-box { text-align: center; color: var(--text-muted); }
.modal-link-box i { font-size: 6rem; margin-bottom: 25px; color: var(--cyan-glow); opacity: 0.8;}
.fallback-icon-modal { display: flex; flex-direction: column; align-items: center; gap: 15px; color: var(--text-muted); font-size: 5rem; opacity: 0.5;}

/* --- KANAN: Detail & Komentar Modal --- */
.modal-info-section { flex: 1; padding: 40px 35px; display: flex; flex-direction: column; overflow-y: auto; background: linear-gradient(180deg, #0b0f19 0%, #070a13 100%); }
.modal-info-section::-webkit-scrollbar { width: 6px; }
.modal-info-section::-webkit-scrollbar-thumb { background: rgba(0, 240, 255, 0.3); border-radius: 10px; }

.m-info-header { display: flex; justify-content: space-between; margin-bottom: 15px; align-items: center; }
.m-badge { background: rgba(0, 240, 255, 0.1); color: var(--cyan-glow); padding: 6px 14px; border-radius: 6px; font-size: 0.85rem; font-weight: 700; border: 1px solid rgba(0, 240, 255, 0.2); }
.m-date { color: var(--text-muted); font-size: 0.9rem; font-weight: 500;}

.m-title { font-size: 2.2rem; font-weight: 900; color: var(--text-main); margin-bottom: 15px; line-height: 1.2; }
.m-desc { color: var(--text-muted); line-height: 1.7; font-size: 1rem; margin-bottom: 30px; padding-bottom: 25px; border-bottom: 1px solid rgba(255,255,255,0.05); }

/* Komentar UI */
.m-comments-title { font-size: 1.3rem; color: var(--text-main); margin-bottom: 25px; display: flex; align-items: center; gap: 10px; font-weight: 800;}
.m-comments-list { display: flex; flex-direction: column; gap: 15px; margin-bottom: 35px; }
.empty-k { font-style: italic; color: var(--text-muted); font-size: 0.95rem; text-align: center; padding: 20px; background: rgba(0,0,0,0.2); border-radius: 10px;}
.k-item { display: flex; gap: 15px; background: rgba(255,255,255,0.02); padding: 18px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); transition: 0.3s; }
.k-avatar { width: 45px; height: 45px; border-radius: 50%; background: rgba(0, 240, 255, 0.1); color: var(--cyan-glow); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.k-body strong { display: block; color: var(--text-main); font-size: 1rem; margin-bottom: 5px; }
.k-body p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

/* Form Komentar */
.m-comment-form { display: flex; flex-direction: column; gap: 18px; background: rgba(0,0,0,0.4); padding: 25px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); }
.f-row { display: flex; gap: 15px; }
.f-col { display: flex; flex-direction: column; gap: 8px; flex: 1;}
.f-col label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;}
.m-comment-form input, .m-comment-form textarea { width: 100%; padding: 14px 15px; border-radius: 8px; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.1); color: var(--text-main); font-family: inherit; outline: none; transition: 0.3s; font-size: 0.95rem;}
.m-comment-form input:focus, .m-comment-form textarea:focus { border-color: var(--cyan-glow); box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);}
.m-comment-form textarea { resize: vertical; min-height: 80px;}
.btn-full { width: 100%; justify-content: center; font-size: 1.05rem; padding: 15px; background: linear-gradient(45deg, var(--cyan-glow), var(--orange-glow)); color: #000; border: none; border-radius: 8px; font-weight: 800; cursor: pointer; transition: 0.3s;}
.btn-full:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 240, 255, 0.4); color: #fff;}


/* ==========================================================
   RESPONSIVE DESIGN (AUTO CENTER)
========================================================== */

/* Tablet & Laptop Medium */
@media (max-width: 1024px) {
    .modal-split { flex-direction: column; overflow-y: auto; }
    .modal-split::-webkit-scrollbar { width: 6px; }
    .modal-split::-webkit-scrollbar-thumb { background: var(--cyan-glow); }
    .modal-media-section { flex: none; height: 50vh; border-right: none; border-bottom: 1px solid var(--border-glass); }
    .modal-info-section { flex: none; height: auto; overflow-y: visible; }
    .work-modal-box { height: 90vh; }
}

/* Tablet Kecil & Layar HP Horizontal */
@media (max-width: 768px) {
    .page-header h1 { font-size: 2.8rem; }
    
    /* FORM FILTER CENTER DI HP */
    .filter-form { flex-direction: column; align-items: stretch; text-align: center; }
    .f-group, .date-group { width: 100%; min-width: unset; }
    .date-group { flex-direction: column; align-items: stretch; gap: 10px;}
    .date-separator { display: none; }
    
    /* GRID KARYA CENTER DI HP */
    .works-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
    .work-card { max-width: 100%; }
    
    .modal-close { top: 10px; right: 10px; background: rgba(0,0,0,0.8); border-color: rgba(255,255,255,0.2);}
    .f-row { flex-direction: column; }
    .modal-info-section { padding: 25px 20px; }
    .m-title { font-size: 1.6rem; }
}

/* Layar HP Vertikal (Sangat Kecil) */
@media (max-width: 576px) {
    .page-header h1 { font-size: 2.2rem; }
    .works-grid { grid-template-columns: 1fr; } /* Paksa 1 kolom di layar sangat kecil */
    .work-frame { aspect-ratio: 16/10; } /* Sedikit disesuaikan agar tidak terlalu tinggi di HP */
    
    .work-info { flex-direction: column; align-items: flex-start; gap: 12px; }
    .w-info-right { margin-left: 0; width: 100%; }
    .btn-open-modal { width: 100%; justify-content: center; }
}