/* RESET & VARIABEL WARNA */
:root {
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --danger: #ef4444;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* SIDEBAR STYLING */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 32px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.nav-links li, .album-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-links li:hover, .album-list li:hover, 
.nav-links li.active, .album-list li.active {
    background-color: #eef2ff;
    color: var(--primary);
}

.sidebar-albums {
    flex: 1;
    overflow-y: auto;
}

.album-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding: 0 8px;
}

.album-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}
.album-header button:hover {
    color: var(--primary);
}

.album-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* KONTEN UTAMA */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 32px;
    max-width: calc(100vw - 260px);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 16px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-card);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

/* TOMBOL */
.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.full-width {
    width: 100%;
    justify-content: center;
}

/* KONTEN HEADER & BADGE */
.content-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.badge {
    background-color: #e2e8f0;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* GALERI GRID */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.photo-card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.photo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.photo-img-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.photo-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.photo-card:hover .photo-img-wrapper img {
    transform: scale(1.05);
}

.photo-info {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.photo-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.photo-details span {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.photo-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.btn-action.favorite.active {
    color: var(--danger);
}

.btn-action.delete:hover {
    color: var(--danger);
}

/* KONDISI KOSONG */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--border);
}

/* MODAL / POPUP */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 450px;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    animation: modalScale 0.2s ease;
}

.modal-sm {
    max-width: 350px;
}

@keyframes modalScale {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
}
.btn-close:hover {
    color: var(--text-main);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
}

.preview-container {
    margin-bottom: 16px;
    text-align: center;
}

.preview-container img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    object-fit: contain;
}

/* LIGHTBOX */
.lightbox {
    background-color: rgba(0, 0, 0, 0.85);
    flex-direction: column;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    color: white;
    font-size: 2rem;
}

.lightbox-content {
    max-width: 80%;
    max-height: 80vh;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius);
    object-fit: contain;
    margin-bottom: 16px;
}

.lightbox-info h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

/* RESPONSIF UNTUK HP / TABLET */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 16px;
    }
}