:root {
    --yellow: #ffc107;
    --red: #d32f2f;
    --black: #1e1e1e;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", sans-serif;
    background: #f5f7fa;
    color: var(--black);
}

/* HEADER */
.header {
    background: var(--black);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 3px solid var(--yellow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo h1 {
    font-size: 1.5rem;
}

.logo span {
    color: var(--yellow);
}

.logo small {
    font-size: 0.7rem;
    color: #ccc;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--yellow);
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.nav-btn:hover,
.active-nav {
    background: var(--yellow);
    color: var(--black);
}

/* HERO */
.hero-section {
    background: linear-gradient(135deg, var(--black), #2a2a2a);
    padding: 2rem;
    border-radius: 24px;
    margin-bottom: 2rem;
    color: white;
}

.hero-text h2 {
    font-size: 1.5rem;
}

.highlight {
    color: var(--yellow);
}

/* CONTAINER */
.container {
    max-width: 1300px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* KATEGORI */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.cat-item {
    background: white;
    padding: 0.6rem 1.5rem;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.cat-item.active {
    background: var(--red);
    color: white;
}

.cat-item:hover {
    transform: translateY(-2px);
    background: var(--yellow);
}

/* BERITA GRID */
.berita-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1.2rem;
}

.card-kategori {
    display: inline-block;
    background: var(--red);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 1rem;
    border-radius: 20px;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-tanggal {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.card-desc {
    color: #555;
    line-height: 1.4;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.card-lokasi {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--red);
}

/* FOOTER */
.footer {
    background: var(--black);
    color: white;
    margin-top: 3rem;
    padding: 2rem;
    text-align: center;
}

.footer-logo h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.footer-logo span {
    color: var(--yellow);
}

.footer-copyright {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #888;
}

/* ========== ADMIN PANEL ========== */
.admin-page {
    background: #f0f2f5;
}

.admin-header {
    background: var(--black);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.view-site {
    background: var(--yellow);
    color: var(--black);
    border: none;
}

.logout-btn {
    background: var(--red);
    border: none;
}

.admin-container {
    display: flex;
    max-width: 1400px;
    margin: 2rem auto;
    gap: 2rem;
    padding: 0 20px;
}

.admin-sidebar {
    width: 260px;
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    height: fit-content;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.sidebar-menu .menu-item {
    padding: 12px 16px;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-menu .menu-item:hover,
.sidebar-menu .menu-item.active {
    background: var(--yellow);
    color: var(--black);
}

.admin-main {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.admin-tab {
    display: none;
}

.admin-tab.active-tab {
    display: block;
    animation: fadeIn 0.3s ease;
}

.form-card h2 {
    margin-bottom: 1.5rem;
    color: var(--red);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: block;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--yellow);
    outline: none;
}

.btn-submit {
    background: var(--red);
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-submit:hover {
    background: #b71c1c;
    transform: translateY(-2px);
}

.manage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 40px;
    padding: 0 1rem;
    gap: 8px;
}

.search-box input {
    padding: 8px 0;
    border: none;
    background: transparent;
    width: 200px;
}

.search-box input:focus {
    outline: none;
}

.admin-news-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.admin-card {
    background: #f9f9f9;
    padding: 0.8rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    transition: var(--transition);
}

.admin-card:hover {
    background: #fff4e0;
}

.admin-card-info {
    flex: 1;
}

.admin-card-info strong {
    font-size: 0.9rem;
}

.admin-card-actions button {
    padding: 5px 12px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    transition: var(--transition);
}

.edit-btn {
    background: var(--yellow);
}

.delete-btn {
    background: #ddd;
    color: var(--red);
}

.delete-btn:hover {
    background: var(--red);
    color: white;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    padding: 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid var(--yellow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 1.8rem;
    color: var(--red);
}

.stat-detail h3 {
    font-size: 1.5rem;
    color: var(--red);
}

.stat-detail p {
    font-size: 0.75rem;
    color: #666;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    max-width: 550px;
    width: 90%;
    padding: 1.5rem;
    border-radius: 24px;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-cancel {
    background: #ccc;
    border: none;
    padding: 8px 16px;
    border-radius: 40px;
    cursor: pointer;
}

/* Preview gambar untuk admin */
.image-preview {
    margin-top: 10px;
    width: 150px;
    height: 150px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f9f9f9;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.image-preview span {
    color: #999;
    font-size: 0.8rem;
}

.file-input-label {
    display: inline-block;
    background: var(--yellow);
    color: var(--black);
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    margin-top: 8px;
}

.file-input-label:hover {
    background: #ff8f00;
}

input[type="file"] {
    display: none;
}

/* Komentar list admin */
.komentar-list-admin {
    margin-top: 1rem;
}

.komentar-admin-item {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    border-left: 3px solid var(--yellow);
}

.komentar-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.komentar-berita-title {
    font-weight: 600;
    color: var(--red);
    font-size: 0.85rem;
}

.btn-delete-komentar {
    background: #ddd;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    color: var(--red);
    font-size: 0.7rem;
}

.btn-delete-komentar:hover {
    background: var(--red);
    color: white;
}

/* Style untuk daftar gambar deskripsi */
.desc-images-list {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.desc-image-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.desc-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.desc-image-item .remove-img {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shortcode-hint {
    background: #f0f0f0;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    margin-top: 8px;
    color: #666;
}

/* Gambar di dalam deskripsi halaman detail */
.desc-inline-image {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Animasi */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsif */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .berita-grid {
        grid-template-columns: 1fr;
    }
    .header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    .admin-header {
        flex-direction: column;
        text-align: center;
    }
    .card-image {
        height: 180px;
    }
}