/* ============================================================
   Codemaniac Studio - Premium Admin Suite Stylesheet
   Theme: Obsidian Dark Glassmorphism with Radiant Gold Accents
   ============================================================ */

:root {
    --bg-base: #070A12;
    --bg-surface: #0E1626;
    --bg-surface-elevated: #141F36;
    --bg-input: #101B30;
    
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-focus: rgba(245, 158, 11, 0.5);
    
    --gold-primary: #F59E0B;
    --gold-glow: #FBBF24;
    --gold-dark: #D97706;
    --gold-gradient: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.12);
    
    --sidebar-width: 270px;
    --header-height: 72px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 9999px;
    
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    --shadow-gold: 0 8px 24px -6px rgba(245, 158, 11, 0.35);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--gold-glow);
}

/* ============================================================
   ADMIN LAYOUT STRUCTURE
   ============================================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-badge-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon-box {
    width: 38px;
    height: 38px;
    background: var(--gold-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    font-size: 18px;
    font-weight: 800;
    box-shadow: var(--shadow-gold);
}

.brand-title-wrap {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #FFFFFF;
    line-height: 1.2;
}

.brand-sub {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold-primary);
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 12px 14px 6px 14px;
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.nav-link-item:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.04);
}

.nav-link-item:hover i {
    color: var(--gold-primary);
}

.nav-link-item.active {
    color: #FFFFFF;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.04) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.nav-link-item.active i {
    color: var(--gold-primary);
}

.nav-link-item .nav-badge {
    margin-left: auto;
    background: var(--gold-gradient);
    color: #111827;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-btn-site {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 10px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

.sidebar-btn-site:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #FFFFFF;
    border-color: var(--border-medium);
}

/* MAIN CONTENT CONTAINER */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* TOPBAR */
.admin-topbar {
    height: var(--header-height);
    background: rgba(14, 22, 38, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle-btn {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 16px;
}

.topbar-page-info h2 {
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
}

.topbar-page-info .breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.system-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #10B981;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
}

.status-dot-pulse {
    width: 7px;
    height: 7px;
    background: #10B981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10B981;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.admin-profile-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 6px 14px 6px 6px;
    border-radius: var(--radius-pill);
}

.admin-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold-gradient);
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
}

.admin-name-text {
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.1;
}

.admin-role-badge {
    font-size: 10.5px;
    color: var(--gold-primary);
    font-weight: 600;
}

/* PAGE BODY CONTENT */
.admin-content-area {
    padding: 32px;
    flex: 1;
}

/* ============================================================
   KPI STATS WIDGETS
   ============================================================ */
.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-widget-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-widget-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-widget-card:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 158, 11, 0.3);
}

.stat-widget-card:hover::before {
    opacity: 1;
}

.stat-info .stat-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.stat-info .stat-number {
    font-size: 28px;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.1;
    font-family: 'Outfit', sans-serif;
}

.stat-info .stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon-gold {
    background: rgba(245, 158, 11, 0.15);
    color: var(--gold-primary);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.stat-icon-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.stat-icon-green {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.stat-icon-purple {
    background: rgba(168, 85, 247, 0.15);
    color: #C084FC;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ============================================================
   PANELS & CARDS
   ============================================================ */
.admin-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    overflow: hidden;
}

.admin-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title-group h3 {
    font-size: 17px;
    color: #FFFFFF;
}

.card-title-group p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.admin-card-body {
    padding: 24px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-gold {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold-gradient);
    color: #111827 !important;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-gold);
    transition: all 0.2s ease;
}

.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px -6px rgba(245, 158, 11, 0.5);
    color: #111827 !important;
}

.btn-dark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-elevated);
    color: #FFFFFF !important;
    border: 1px solid var(--border-medium);
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-dark:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.1);
    color: #F87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger-outline:hover {
    background: #EF4444;
    color: #FFFFFF !important;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: var(--radius-sm);
}

/* ============================================================
   TABLES
   ============================================================ */
.admin-table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.admin-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13.5px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-status-published {
    background: var(--success-bg);
    color: #34D399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-status-draft {
    background: rgba(148, 163, 184, 0.12);
    color: #94A3B8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.badge-status-unread {
    background: var(--warning-bg);
    color: #FBBF24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-tag-cat {
    background: rgba(245, 158, 11, 0.1);
    color: var(--gold-primary);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 600;
}

/* ============================================================
   FORMS & INPUTS
   ============================================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #E2E8F0;
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
    background: #13203A;
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* SECTION CARD COLLAPSIBLE ACCORDION */
.section-edit-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.section-edit-card:hover {
    border-color: var(--border-medium);
}

.section-edit-header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
}

.section-badge {
    background: rgba(245, 158, 11, 0.15);
    color: var(--gold-primary);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 10px;
    letter-spacing: 0.04em;
}

.section-edit-body {
    padding: 24px;
}

/* TOAST / ALERTS */
.toast-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.toast-alert-success {
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34D399;
}

.toast-alert-danger {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #F87171;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* PAGES GRID */
.pages-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.page-manage-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.page-manage-card:hover {
    transform: translateY(-3px);
    border-color: rgba(245, 158, 11, 0.4);
}

.page-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.page-icon-pill {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(245, 158, 11, 0.12);
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.page-manage-card h4 {
    font-size: 18px;
    margin-bottom: 6px;
}

.page-manage-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 18px;
}

.page-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

/* LOGIN SCREEN STYLES */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 20%, #1A2234 0%, #080C14 70%);
    position: relative;
    padding: 24px;
}

.login-glow-backdrop {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(14, 22, 38, 0.88);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(245, 158, 11, 0.15);
    padding: 40px;
    position: relative;
    z-index: 10;
}

.login-brand-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-badge {
    width: 56px;
    height: 56px;
    background: var(--gold-gradient);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    font-size: 26px;
    box-shadow: var(--shadow-gold);
    margin-bottom: 14px;
}

.login-brand-header h1 {
    font-size: 24px;
    color: #FFFFFF;
}

.login-brand-header p {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.sidebar-open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .menu-toggle-btn {
        display: block;
    }
    
    .stats-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .form-grid-2, .form-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .admin-content-area {
        padding: 20px 16px;
    }
    
    .admin-topbar {
        padding: 0 16px;
    }
}
