/* ============================================================
   KRADS — ADMIN DASHBOARD STYLES
   ============================================================ */

:root {
    --admin-bg: #050505;
    --admin-card: #111111;
    --admin-accent: #f09433;
    --admin-glass: rgba(255, 255, 255, 0.03);
    --admin-border: rgba(255, 255, 255, 0.08);
}

/* HIGH SPECIFICITY RESET FOR ADMIN */
.admin-wrapper, .admin-wrapper * {
    box-sizing: border-box;
}

.admin-wrapper h1, .admin-wrapper h2, .admin-wrapper h3 {
    margin: 0;
    font-family: 'Montserrat', sans-serif !important;
}

.admin-wrapper p, .admin-wrapper span, .admin-wrapper label, .admin-wrapper button, .admin-wrapper input, .admin-wrapper textarea, .admin-wrapper select {
    font-family: 'Inter', sans-serif !important;
}

/* Hide global components that might overlap or clutter */
.admin-active #krads-header {
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
}

.admin-wrapper {
    min-height: 100vh;
    background: #050505;
    padding: 160px 4% 80px;
    display: flex;
    gap: 50px;
    position: relative;
    z-index: 5;
    color: white;
}

/* Custom Scrollbar for Admin Area */
.admin-wrapper ::-webkit-scrollbar { width: 8px; }
.admin-wrapper ::-webkit-scrollbar-track { background: #0a0a0a; }
.admin-wrapper ::-webkit-scrollbar-thumb { background: #222; border-radius: 10px; }
.admin-wrapper ::-webkit-scrollbar-thumb:hover { background: var(--admin-accent); }

/* Sidebar */
.admin-sidebar {
    width: 320px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 40px;
    height: fit-content;
    position: sticky;
    top: 160px;
}

.admin-sidebar h2 {
    font-size: 0.9rem;
    color: var(--admin-accent);
    margin-bottom: 40px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 800;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-nav-item {
    padding: 18px 25px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    align-items: center;
    gap: 18px;
    background: transparent;
    border: 1px solid transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-weight: 500;
}

.admin-nav-item i { font-size: 1.2rem; }

.admin-nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

.admin-nav-item.active {
    background: linear-gradient(135deg, #f09433 0%, #dc2743 100%);
    color: white;
    box-shadow: 0 15px 35px rgba(220, 39, 67, 0.25);
    border: none;
}

/* Main Content */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.admin-section {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 60px;
    display: none;
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
}

/* LIVE PREVIEW HUD */
.media-preview-container {
    width: 100%;
    min-height: 200px;
    background: rgba(0,0,0,0.4);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 15px;
}

#media-preview-canvas {
    max-width: 100%;
    max-height: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 8px;
}

#media-preview-canvas img,
#media-preview-canvas video {
    display: block;
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
}

.admin-section.active { display: block; animation: fadeInAdmin 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }

@keyframes fadeInAdmin {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-header {
    margin-bottom: 60px;
    border-left: 4px solid var(--admin-accent);
    padding-left: 30px;
}

.admin-header h1 {
    font-size: 2.8rem;
    color: white;
    margin-bottom: 15px;
    font-weight: 800;
}

.admin-header p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.1rem;
}

/* Forms */
.admin-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group.full { grid-column: span 2; }

.admin-form label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.admin-form input, 
.admin-form select, 
.admin-form textarea {
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 25px;
    border-radius: 14px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.admin-form input:focus, 
.admin-form select:focus, 
.admin-form textarea:focus {
    border-color: var(--admin-accent);
    background: #050505;
    box-shadow: 0 0 0 4px rgba(240, 148, 51, 0.1);
    outline: none;
}

.drop-zone {
    height: 200px;
    border: 2px dashed var(--admin-border);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    background: #0d0d0d;
}

.drop-zone:hover {
    border-color: var(--admin-accent);
    background: var(--admin-glass);
    color: white;
}

.drop-zone i { font-size: 2.5rem; }

.publish-btn {
    grid-column: span 2;
    padding: 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f09433 0%, #dc2743 100%);
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.publish-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(220, 39, 67, 0.3);
}

/* VAULT EXPLORER 2.0 */
#lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.library-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, background 0.3s;
}

.library-item:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,222,89,0.2);
}

.lib-media {
    width: 100%;
    height: 180px;
    background: #000;
    overflow: hidden;
}

.lib-media img,
.lib-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.library-info strong {
    color: var(--k-accent, #ffde59);
    display: block;
    margin-bottom: 5px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.library-info p {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    margin-bottom: 12px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.lib-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.lib-edit {
    flex: 1;
    background: rgba(255,255,255,0.08);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    transition: all 0.2s;
}

.lib-delete {
    width: 36px;
    height: 36px;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.2);
    border-radius: 6px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}

.lib-delete:hover {
    background: #ff3b30;
    color: white;
    transform: scale(1.05);
}

.lib-edit:hover {
    background: var(--k-accent, #ffde59);
    color: black;
    border-color: var(--k-accent, #ffde59);
}

.admin-section {
    display: none;
    animation: slideUp 0.5s ease forwards;
}
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lib-delete:hover {
    background: #dc2743;
    color: white;
    transform: scale(1.1);
}

@media (max-width: 991px) {
    .admin-wrapper { flex-direction: column; padding-top: 120px; }
    .admin-sidebar { width: 100%; position: static; }
    .admin-form { grid-template-columns: 1fr; }
    .form-group.full { grid-column: auto; }
}
