/* Import Font Google Modern */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    color: #2c3e50;
    line-height: 1.6;
    padding-bottom: 60px;
    background: linear-gradient(rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.65)), 
                url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat fixed;
    min-height: 100vh;
}

/* =========================================================
   1. HEADER & NAVIGASI BAR UTAMA
   ========================================================= */
.site-header {
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    color: #ffffff !important;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex !important;
    flex-direction: row !important;
    list-style: none !important;
    gap: 10px !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-wrap: wrap;
}

.nav-links li {
    display: inline-block;
}

.nav-links a {
    color: #cbd5e1 !important;
    text-decoration: none !important;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: block;
    white-space: nowrap;
}

.nav-links a:hover, 
.nav-links a.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.2);
}

.btn-add-memory {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 7px 16px;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    white-space: nowrap;
}

.btn-add-memory:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}

.btn-logout {
    background-color: #ff5252 !important;
    color: white !important;
    padding: 7px 16px !important;
    border-radius: 20px !important;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(255, 82, 82, 0.3);
    white-space: nowrap;
    text-decoration: none;
}

/* =========================================================
   2. BANNER & LAYOUT UTAMA
   ========================================================= */
.page-title-banner {
    text-align: center;
    color: #ffffff;
    padding: 35px 20px 25px 20px;
}

.page-title-banner h1 {
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.page-title-banner p {
    color: #e2e8f0;
    font-weight: 300;
    margin-top: 5px;
    margin-bottom: 18px;
    font-size: 0.95rem;
}

.btn-hero-add {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    padding: 10px 22px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
    transition: all 0.3s ease;
}

.btn-hero-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.45);
}

.main-container {
    max-width: 1100px;
    margin: 15px auto 0 auto;
    padding: 0 15px;
}

/* =========================================================
   3. GALERI CARD GRID (INDEX.PHP)
   ========================================================= */
.section-title {
    text-align: center;
    font-size: 1.6rem;
    color: #ffffff;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-6px);
}

.card-img-wrapper {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #000;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover img {
    transform: scale(1.05);
}

.badge-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.card-body {
    padding: 18px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
}

.card-meta {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 10px;
}

.card-text {
    font-size: 0.88rem;
    color: #475569;
    white-space: pre-line;
}

.empty-state {
    text-align: center;
    grid-column: 1 / -1;
    padding: 40px 20px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* =========================================================
   4. POPUP MODAL WINDOW & FORM
   ========================================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #ffffff;
    border-radius: 20px;
    width: 90%;
    max-width: 650px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    font-size: 1.25rem;
    color: #0f172a;
}

.close-btn {
    font-size: 1.6rem;
    font-weight: bold;
    color: #64748b;
    cursor: pointer;
}

.close-btn:hover {
    color: #ef4444;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.85rem;
    color: #475569;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
}

.file-upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    position: relative;
}

.file-upload-box input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 1.4rem;
    color: #0ea5e9;
    display: block;
}

.file-preview-text {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 4px;
}

button.btn-submit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 8px;
}

/* =========================================================
   5. PETAK PRALIHAT KECIL 85px & BUTANG '➕ Add More' SEBELAH KANAN
   ========================================================= */

.dynamic-upload-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    background: #f8fafc !important;
    border: 2px dashed #cbd5e1 !important;
    border-radius: 12px !important;
    padding: 12px !important;
    align-items: center !important;
    min-height: 110px !important;
    max-height: 250px !important;
    overflow-y: auto !important;
}

.preview-thumb-card {
    width: 85px !important;
    height: 85px !important;
    min-width: 85px !important;
    min-height: 85px !important;
    max-width: 85px !important;
    max-height: 85px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    position: relative !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15) !important;
    background: #000 !important;
    flex-shrink: 0 !important;
}

.preview-thumb-card img, 
.preview-thumb-card video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.upload-add-card {
    width: 85px !important;
    height: 85px !important;
    min-width: 85px !important;
    min-height: 85px !important;
    border: 2px dashed #0ea5e9 !important;
    background: #f0f9ff !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
}

.upload-add-card:hover {
    background: #e0f2fe !important;
    transform: scale(1.04) !important;
}

.thumb-badge {
    position: absolute !important;
    bottom: 3px !important;
    right: 3px !important;
    font-size: 0.65rem !important;
    background: rgba(15, 23, 42, 0.8) !important;
    color: #ffffff !important;
    padding: 1px 5px !important;
    border-radius: 4px !important;
    z-index: 2 !important;
}

/* =========================================================
   6. PAGE TRIP DETAIL (TRIP_DETAIL.PHP) & LIGHTBOX SLIDER
   ========================================================= */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ffffff !important;
    text-decoration: none !important;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateX(-3px);
}

.trip-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-delete {
    background: #ef4444 !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 10px !important;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none !important;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #dc2626 !important;
    transform: translateY(-2px);
}

.media-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 12px !important;
    margin-top: 15px !important;
}

.media-item {
    height: 140px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    position: relative !important;
    cursor: pointer !important;
    background: #000 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12) !important;
    transition: transform 0.3s ease;
}

.media-item:hover {
    transform: scale(1.03);
}

.media-item img, 
.media-item video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Lightbox Modal Fullscreen */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.lightbox-content-wrapper {
    position: relative;
    max-width: 95%;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content-wrapper img, 
.lightbox-content-wrapper video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 2.2rem;
    cursor: pointer;
    z-index: 3010;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    user-select: none;
    z-index: 3010;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }

/* =========================================================
   7. PERATURAN RESPANSIF (MEDIA QUERIES)
   ========================================================= */
@media (max-width: 992px) {
    .header-container {
        justify-content: center;
    }
    .page-title-banner h1 {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .header-container {
        flex-direction: column !important;
        align-items: center !important;
        padding: 10px;
    }

    .nav-links {
        justify-content: center;
        gap: 6px !important;
        width: 100%;
    }

    .nav-links a {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .btn-add-memory, .btn-logout {
        padding: 5px 12px !important;
        font-size: 0.78rem;
    }

    .page-title-banner h1 {
        font-size: 1.6rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .glass-card {
        padding: 18px;
    }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 8px !important;
    }

    .media-item {
        height: 100px !important;
    }

    
}

/* Gaya Butang Edit Memory */
.btn-edit {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    color: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    font-family: inherit !important;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3) !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    text-decoration: none !important;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(14, 165, 233, 0.4) !important;
}