:root {
    --bg-light: #f8f9fa;
    --border-color: #e2e8f0;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    
    --emerald-deep: #0a3a2a;
    --emerald-medium: #137a56;
    --lime-accent: #68a82c;
    --gold-accent: #d4a017;
    --gold-light: #fff9e6;
    
    --glass-blur: blur(12px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* NAVBAR KORPORAT */
.apple-nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.5px;
    color: var(--emerald-deep);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--emerald-deep);
}

/* HERO SECTION BOLD & BLEND IN (TANPA PETAK) */
.hero {
    padding: 8.5rem 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 2rem;
}

.hero-text-content {
    flex: 1.3;
    text-align: left;
    position: relative;
    z-index: 10;
}

.hero-text-content h1 {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -1.2px;
    margin: 0.6rem 0 1.2rem;
    color: var(--emerald-deep);
    line-height: 1.18;
}

.hero-text-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 580px;
    margin-bottom: 2.2rem;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: flex-start;
    gap: 3.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

/* POTRET BLEND IN INTERAKTIF */
.hero-portrait-wrapper {
    position: relative;
    width: 360px;
    height: 420px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex-shrink: 0;
    z-index: 5;
}

.portrait-bg-shape {
    position: absolute;
    bottom: 0;
    right: 10px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(10, 58, 42, 0.15) 0%, rgba(212, 160, 23, 0.18) 50%, transparent 75%);
    border-radius: 50%;
    z-index: 1;
    filter: blur(15px);
    animation: pulseGlow 6s ease-in-out infinite alternate;
}

.hero-portrait-img {
    position: relative;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    z-index: 6;
    filter: drop-shadow(0 15px 25px rgba(10, 58, 42, 0.15));
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.hero-portrait-wrapper:hover .hero-portrait-img {
    transform: translateY(-8px) scale(1.02);
    filter: drop-shadow(0 20px 30px rgba(10, 58, 42, 0.22));
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); opacity: 0.7; }
    100% { transform: scale(1.05); opacity: 1; }
}

/* PORTFOLIO SECTION & FILTERS */
.portfolio-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 5rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--emerald-deep);
    margin-bottom: 0.5rem;
}

.filter-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: #ffffff;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--emerald-deep);
    color: #ffffff;
    border-color: var(--emerald-deep);
    font-weight: 600;
}

/* GRID KAD EVIDENS */
.evidens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.card {
    border-radius: 16px;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.35;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-tag-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 0.8rem;
}

.btn-galeri-theme {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-galeri-theme:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.18);
}

/* PALET WARNA KHUSUS MENGIKUT KATEGORI */
.card.kat-antarabangsa { background: linear-gradient(135deg, #f2f8f5 0%, #ffffff 100%); border: 2px solid #0a3a2a; border-left: 8px solid #0a3a2a; }
.card.kat-antarabangsa .card-title { color: #0a3a2a; }
.card.kat-antarabangsa .card-tag-badge { background: #e2f0ec; color: #0a3a2a; }
.card.kat-antarabangsa .btn-galeri-theme { background: #0a3a2a; color: #ffffff; }

.card.kat-kebangsaan { background: linear-gradient(135deg, #f5fbf0 0%, #ffffff 100%); border: 2px solid #52932a; border-left: 8px solid #52932a; }
.card.kat-kebangsaan .card-title { color: #3d6e1e; }
.card.kat-kebangsaan .card-tag-badge { background: #eaf5e4; color: #3d6e1e; }
.card.kat-kebangsaan .btn-galeri-theme { background: #52932a; color: #ffffff; }

.card.kat-negeri { background: linear-gradient(135deg, #f0fbf9 0%, #ffffff 100%); border: 2px solid #0d7a70; border-left: 8px solid #0d7a70; }
.card.kat-negeri .card-title { color: #08544d; }
.card.kat-negeri .card-tag-badge { background: #e0f5f3; color: #08544d; }
.card.kat-negeri .btn-galeri-theme { background: #0d7a70; color: #ffffff; }

.card.kat-daerah { background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%); border: 2px solid #0284c7; border-left: 8px solid #0284c7; }
.card.kat-daerah .card-title { color: #0369a1; }
.card.kat-daerah .card-tag-badge { background: #e0f2fe; color: #0369a1; }
.card.kat-daerah .btn-galeri-theme { background: #0284c7; color: #ffffff; }

.card.kat-institusi { background: linear-gradient(135deg, #fffdf0 0%, #ffffff 100%); border: 2px solid #b8860b; border-left: 8px solid #b8860b; }
.card.kat-institusi .card-title { color: #785b07; }
.card.kat-institusi .card-tag-badge { background: #fef7d9; color: #785b07; }
.card.kat-institusi .btn-galeri-theme { background: #b8860b; color: #ffffff; }

.card.kat-latihan { background: linear-gradient(135deg, #f0f5ff 0%, #ffffff 100%); border: 2px solid #2563eb; border-left: 8px solid #2563eb; }
.card.kat-latihan .card-title { color: #1d4ed8; }
.card.kat-latihan .card-tag-badge { background: #dbeabe; color: #1d4ed8; }
.card.kat-latihan .btn-galeri-theme { background: #2563eb; color: #ffffff; }

.card.kat-penulisan { background: linear-gradient(135deg, #f9f5ff 0%, #ffffff 100%); border: 2px solid #7c3aed; border-left: 8px solid #7c3aed; }
.card.kat-penulisan .card-title { color: #6d28d9; }
.card.kat-penulisan .card-tag-badge { background: #ede9fe; color: #6d28d9; }
.card.kat-penulisan .btn-galeri-theme { background: #7c3aed; color: #ffffff; }

.card.kat-anugerah { background: linear-gradient(135deg, #fdf2f4 0%, #ffffff 100%); border: 2px solid #8b1e2b; border-left: 8px solid #8b1e2b; }
.card.kat-anugerah .card-title { color: #66151f; }
.card.kat-anugerah .card-tag-badge { background: #fbe2e5; color: #66151f; }
.card.kat-anugerah .btn-galeri-theme { background: #8b1e2b; color: #ffffff; }

.card.kat-inovasi { background: linear-gradient(135deg, #fffbe6 0%, #ffffff 100%); border: 2px solid #d4a017; border-left: 8px solid #d4a017; }
.card.kat-inovasi .card-title { color: #8a6800; }
.card.kat-inovasi .card-tag-badge { background: #fff5cc; color: #8a6800; }
.card.kat-inovasi .btn-galeri-theme { background: #d4a017; color: #ffffff; }

.card.kat-peribadi { background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%); border: 2px solid #9a3412; border-left: 8px solid #9a3412; }
.card.kat-peribadi .card-title { color: #7c2d12; }
.card.kat-peribadi .card-tag-badge { background: #ffedd5; color: #7c2d12; }
.card.kat-peribadi .btn-galeri-theme { background: #9a3412; color: #ffffff; }

.card.kat-umum { background: #ffffff; border: 2px solid var(--border-color); border-left: 8px solid var(--emerald-medium); }

/* GALERI VISUAL MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: var(--glass-blur);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.gallery-modal-card {
    background: #ffffff !important;
    max-width: 900px !important;
    width: 90% !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 1.5rem !important;
    border-radius: 18px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    overflow: hidden !important;
    position: relative !important;
}

.gallery-slider-container {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 380px;
    max-height: 520px;
    background: #0f172a;
    border-radius: 12px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
}

.gallery-slide-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.slide-visual-item {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.slide-img {
    max-width: 100% !important;
    max-height: 420px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

.slide-iframe {
    width: 100% !important;
    height: 420px !important;
    border: none !important;
    border-radius: 6px !important;
    background: #ffffff !important;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(10, 58, 42, 0.9);
    color: #ffffff;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(6px);
    z-index: 10;
}

.slide-web-card {
    background: #ffffff;
    padding: 3rem 2rem;
    border-radius: 12px;
    text-align: center;
    width: 90%;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
}

.slider-arrow:hover {
    background: var(--emerald-medium);
    transform: translateY(-50%) scale(1.1);
}

.prev-arrow { left: 12px; }
.next-arrow { right: 12px; }

.gallery-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.4rem;
}

.slide-counter-badge {
    background: var(--gold-light);
    color: var(--gold-accent);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.btn-direct-link {
    color: var(--emerald-medium);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-direct-link:hover {
    text-decoration: underline;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===================================================
   REKA BENTUK KHUSUS HALAMAN ADMIN (ADMIN.PHP)
   =================================================== */

.admin-container {
    max-width: 1100px;
    margin: 6.5rem auto 4rem;
    padding: 0 1.5rem;
}

.admin-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.admin-card-header {
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 0.8rem;
    margin-bottom: 1.2rem;
}

.admin-card-header h2 {
    font-size: 1.3rem;
    color: var(--emerald-deep);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.preset-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.8rem;
}

.preset-box label {
    font-weight: 700;
    color: var(--emerald-deep);
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control, 
select.form-control,
input[type="text"],
input[type="url"],
input[type="file"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
    background-color: #ffffff;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.form-control:focus,
select:focus,
input[type="text"]:focus,
input[type="url"]:focus {
    border-color: var(--emerald-medium);
    box-shadow: 0 0 0 3px rgba(19, 122, 86, 0.12);
}

/* FILE DROP AREA */
.file-drop-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.8rem 1rem;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background-color: #f8fafc;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-drop-area:hover {
    border-color: var(--emerald-medium);
    background-color: #f0fdf4;
}

.file-drop-area i {
    font-size: 2rem;
    color: var(--emerald-medium);
    margin-bottom: 0.5rem;
}

.file-drop-area p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.file-drop-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-name {
    font-size: 0.8rem;
    color: var(--emerald-medium);
    font-weight: 600;
    margin-top: 0.4rem;
}

/* BUTANG SIMPAN */
.btn-submit {
    background: var(--emerald-deep);
    color: #ffffff;
    border: none;
    padding: 0.85rem 1.8rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    box-shadow: 0 4px 12px rgba(10, 58, 42, 0.15);
}

.btn-submit:hover {
    background: var(--emerald-medium);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(10, 58, 42, 0.25);
}

/* JADUAL ADMIN & QR CODE */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.qr-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.qr-table th {
    background: #f1f5f9;
    color: var(--emerald-deep);
    font-weight: 700;
    padding: 0.9rem 1.1rem;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.qr-table td {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.qr-table tbody tr:hover {
    background-color: #f8fafc;
}

.badge-warning {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-delete:hover {
    background: #dc2626;
    color: #ffffff;
}

/* RESPONSIF MOBILE ADMIN */
@media (max-width: 850px) {
    .admin-container {
        padding: 0 1rem;
        margin-top: 5.5rem;
    }
    .admin-card {
        padding: 1.2rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
}