/* File: /admin/css/admin_style.css (Versi 2.7 - OPTIMIZED & SECURE) */

/* === PALET WARNA BARU === */
:root {
    --color-primary: #1F3A93;      /* Biru untuk stabilitas */
    --color-accent: #F9A825;       /* Oranye untuk energi/aksi */
    --color-background: #F4F4F4;   /* Abu-abu terang untuk latar */
    --color-surface: #FFFFFF;      /* Putih untuk kartu/kontainer */
    --color-text-primary: #111827; /* Hitam lembut untuk teks */
    --color-text-secondary: #6B7280;/* Abu-abu untuk teks sekunder */
    --sidebar-width: 240px;
    --border-radius: 8px;
    --transition-speed: 0.2s;
}

/* === RESET & DASAR === */
* {
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === LAYOUT UTAMA === */
.main-wrapper {
    margin-left: 0;
    transition: margin-left var(--transition-speed) ease;
    min-height: 100vh;
    padding-top: 60px; /* Space for mobile header */
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 25px;
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}
.page-header h1 { 
    margin: 0; 
    font-size: 1.5em;
}
.header-actions .btn { 
    margin-left: 10px; 
}

/* === SIDEBAR NAVIGASI === */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--color-primary);
    color: #e5e7eb;
    display: none;
    flex-direction: column;
    padding: 20px 0;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}
.sidebar.open {
    display: flex;
}
.sidebar .logo {
    padding: 0 25px;
    margin-bottom: 30px;
}
.sidebar .logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.125em;
    font-weight: 600;
}
.sidebar .logo a span {
    font-weight: 300;
    opacity: 0.8;
}
.main-nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}
.main-nav ul li a {
    display: block;
    color: #d1d5db;
    text-decoration: none;
    padding: 12px 25px;
    transition: all var(--transition-speed) ease;
}
.main-nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.main-nav ul li a.active {
    background-color: var(--color-accent);
    color: var(--color-primary);
    font-weight: bold;
}
.sidebar-footer {
    margin-top: auto;
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
}
.sidebar-footer a {
    color: #d1d5db;
    text-decoration: none;
}
.sidebar-footer a:hover {
    color: #fff;
}

/* === MOBILE HEADER === */
.mobile-header {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--color-primary);
    color: #fff;
    padding: 0 15px;
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.mobile-menu-button {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
}
.logo-mobile a {
    color: #fff;
    text-decoration: none;
    font-size: 1.2em;
    font-weight: 600;
}

/* === FORMULIR === */
.form-styled .form-group { 
    margin-bottom: 20px; 
}
.form-styled label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 600; 
    color: var(--color-text-primary); 
}
.form-styled input, 
.form-styled textarea, 
.form-styled select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}
.form-styled input:focus, 
.form-styled textarea:focus, 
.form-styled select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(31, 58, 147, 0.2);
    outline: none;
}

/* === STUDIO KONTEN === */
.studio-form fieldset {
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: var(--border-radius);
}
.studio-form legend {
    font-size: 1.2em;
    font-weight: bold;
    padding: 0 10px;
    color: #333;
    margin-bottom: 15px;
}

/* === RADIO BUTTON === */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.radio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px;
    border-radius: 6px;
    transition: background-color var(--transition-speed) ease;
}
.radio-item:hover {
    background-color: #f8f9fa;
}
.radio-item input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}
.radio-item label {
    font-size: 1em;
    color: var(--color-text-primary);
    cursor: pointer;
    margin: 0;
    font-weight: normal;
    line-height: 1.4;
    flex: 1;
}
.radio-item input[type="radio"]:checked + label {
    font-weight: 600;
    color: var(--color-primary);
}

/* === TOMBOL === */
.btn {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1em;
    font-weight: 600;
    transition: background-color var(--transition-speed) ease;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn:hover { 
    background-color: #162b6a; 
}
.btn.primary-action { 
    background-color: var(--color-accent); 
    color: var(--color-text-primary); 
}
.btn.primary-action:hover { 
    background-color: #e89a20; 
}
.btn-secondary { 
    background-color: #6B7280; 
}
.btn-secondary:hover { 
    background-color: #4b5563; 
}

/* === PESAN NOTIFIKASI === */
.error-message, 
.success-message, 
.info-message { 
    padding: 15px; 
    border-radius: 5px; 
    margin-bottom: 20px; 
    border: 1px solid transparent; 
    position: relative;
}
.error-message { 
    background-color: #f8d7da; 
    color: #721c24; 
    border-color: #f5c6cb; 
}
.success-message { 
    background-color: #d1fae5; 
    color: #064e3b; 
    border-color: #a7f3d0; 
}
.info-message { 
    background-color: #dbeafe; 
    color: #1e40af; 
    border-color: #bfdbfe; 
}

/* === TABEL DATA === */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}
.table-container table,
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.table-container th,
.table-container td,
.data-table th,
.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}
.table-container thead th,
.data-table thead th {
    background-color: #f9fafb;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.table-container tbody tr:hover,
.data-table tbody tr:hover {
    background-color: #f9fafb;
}
.table-thumbnail {
    width: 140px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}
.no-image-placeholder {
    display: inline-block;
    width: 120px;
    height: 90px;
    background-color: #f0f0f0;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* === DASHBOARD STATS === */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background-color: var(--color-surface);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform var(--transition-speed) ease;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.stat-card h2 { 
    font-size: 2.5em; 
    margin: 0 0 5px 0; 
    color: var(--color-primary); 
}
.stat-card p { 
    margin: 0; 
    color: var(--color-text-secondary); 
    font-weight: 500; 
}
.stat-icon {
    font-size: 1.5em;
    margin-bottom: 10px;
    display: block;
}

/* === DASHBOARD MENU === */
.dashboard-menu {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.dashboard-menu .menu-item {
    background-color: var(--color-surface);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-decoration: none;
    color: var(--color-text-primary);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}
.dashboard-menu .menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.dashboard-menu .menu-item h3 { 
    margin-top: 0; 
    margin-bottom: 10px;
}
.dashboard-menu .menu-item p { 
    color: var(--color-text-secondary); 
}
.dashboard-menu .menu-item.primary-action {
    background-color: var(--color-primary);
    color: #fff;
    grid-column: 1 / -1;
    text-align: center;
}
.dashboard-menu .menu-item.primary-action h3,
.dashboard-menu .menu-item.primary-action p {
    color: #fff;
}

/* === KATEGORI LIST === */
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.category-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color var(--transition-speed) ease;
    font-size: 0.95em;
    background: #f9fafb;
}
.category-list label:hover {
    background-color: #edf2ff;
}
.category-list input[type="checkbox"] {
    margin: 0;
    flex-shrink: 1;
    align-self: flex-start;
    accent-color: var(--color-primary);
}
.category-list label span {
    overflow-wrap: break-word;
    white-space: normal;
    min-width: 120px;
    max-width: 200px;
}

/* === STEPPER === */
.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px;
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    flex-wrap: wrap;
    gap: 5px;
}
.stepper .step {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-secondary);
    min-width: 120px;
    border-radius: 6px;
    transition: background-color var(--transition-speed) ease;
}
.stepper .step:hover {
    background-color: #f0f4ff;
}
.stepper .step.active {
    color: var(--color-primary);
    background-color: #f0f4ff;
    font-weight: 700;
}
.form-step {
    display: none;
}
.form-step.active {
    display: block;
}
.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.required {
    color: #dc2626;
}
input.error, 
select.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    background: #fff;
    transition: all var(--transition-speed) ease;
}
.pagination a:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}
.pagination .active {
    background-color: var(--color-primary);
    color: white;
    font-weight: bold;
    border-color: var(--color-primary);
}
.pagination .disabled {
    opacity: 0.4;
    cursor: not-allowed;
    user-select: none;
}
.pagination .ellipsis {
    padding: 0 4px;
    color: #888;
    border: none;
    background: transparent;
}

/* === SKELETON LOADING === */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    min-height: 20px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === ACCESSIBILITY === */
fieldset legend {
    font-size: 1.2em;
    margin-bottom: 10px;
    display: block;
}
:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.3);
}
.skip-link {
    position: absolute;
    top: -40px;
    left: 10px;
    background: var(--color-primary);
    color: #fff;
    padding: 8px;
    z-index: 1000;
    text-decoration: none;
    border-radius: 4px;
}
.skip-link:focus {
    top: 10px;
}

/* === RESPONSIVE DESIGN === */
/* Mobile (default) */
/* Tablet */
@media (min-width: 768px) {
    .container {
        padding: 30px;
    }
    .page-header {
        flex-wrap: nowrap;
    }
    .stepper .step {
        min-width: 150px;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .sidebar {
        display: flex;
        transform: none !important;
    }
    .main-wrapper {
        margin-left: var(--sidebar-width);
        padding-top: 0;
    }
    .mobile-header {
        display: none;
    }
    .dashboard-menu .menu-item {
        padding: 30px;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
}