/* Antymob Admin Styling (Sleek Dark Cyberpunk Theme) */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #06050e;
    --card-bg: rgba(18, 16, 38, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-cyan: #00f0ff;
    --accent-purple: #9d4edd;
    --accent-blue: #3f37c9;
    --accent-glow: rgba(0, 240, 255, 0.15);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --font-sans: 'Outfit', sans-serif;
    --sidebar-width: 260px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Typography & Layout */
a {
    color: inherit;
    text-decoration: none;
}

/* Login Page Custom styles */
.login-body {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1b153f 0%, #06050e 100%);
}

.login-card {
    width: 420px;
    padding: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.login-logo {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.login-title {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

/* Sidebar Navigation */
.admin-sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 8, 24, 0.9);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 30px 20px;
    overflow-y: auto;
}

.sidebar-brand {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 40px;
    padding-left: 10px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-item a:hover,
.sidebar-item.active a {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 3px 0 0 var(--accent-cyan);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

/* Main Content Area */
.admin-layout {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 40px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
}

.admin-actions {
    display: flex;
    gap: 12px;
}

/* UI Cards */
.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.admin-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Grid Layouts */
.admin-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* KPI Card Custom styling */
.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 30%;
    background: var(--accent-cyan);
}

.kpi-card.purple::after {
    background: var(--accent-purple);
}

.kpi-card.blue::after {
    background: var(--accent-blue);
}

.kpi-card.success::after {
    background: var(--success);
}

.kpi-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

/* Styling dropdown options for visibility on dark/light backgrounds */
select.form-control option {
    background-color: #120f26; /* Dark background matching dashboard theme colors */
    color: #ffffff;            /* White text for visibility */
}
body.light-theme select.form-control option {
    background-color: #ffffff;
    color: #0f172a;
}


.form-control:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #ffffff;
}

.btn-primary:hover {
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Alert Boxes */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Tables */
.admin-table-container {
    overflow-x: auto;
}

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

.admin-table th {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-table td {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-published { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-draft { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.badge-scheduled { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-hidden { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Multi-tab Wizard (Smartphone specs Form) */
.form-wizard {
    display: flex;
    gap: 30px;
}

.wizard-tabs {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wizard-tab-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.wizard-tab-btn:hover,
.wizard-tab-btn.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.wizard-tab-btn.active::after {
    content: '▶';
    font-size: 0.7rem;
    color: var(--accent-cyan);
}

.wizard-content {
    flex: 1;
    min-width: 0; /* Prevents overflow issues */
}

.wizard-pane {
    display: none;
}

.wizard-pane.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Dynamic rows repeater styles */
.repeater-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.repeater-row .form-control {
    flex: 1;
}

/* Image Mockup Upload Preview */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.upload-card {
    background: rgba(255, 255, 255, 0.01);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-card:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.01);
}

.upload-card input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-preview {
    margin-top: 15px;
    max-height: 150px;
    max-width: 100%;
    display: none;
    border-radius: 6px;
}

.upload-preview.active {
    display: inline-block;
}

/* Footer / autosave indicators */
.admin-footer-bar {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.autosave-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.autosave-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.autosave-indicator.saved .dot { background: var(--success); }
.autosave-indicator.saving .dot {
    background: var(--accent-cyan);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

/* Revision History slider */
.revision-item {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.9rem;
}

.revision-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.revision-time {
    font-weight: 600;
    color: var(--text-primary);
}

.revision-author {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* =========================================================================
   PHASE 5 COLLAPSIBLE SIDEBAR LAYOUTS
   ========================================================================= */

.admin-sidebar {
    transition: var(--transition);
}

.admin-sidebar.sidebar-collapsed {
    width: 65px;
}

.admin-sidebar.sidebar-collapsed .sidebar-brand {
    font-size: 1rem;
    padding: 20px 10px;
    text-align: center;
}

.admin-sidebar.sidebar-collapsed nav ul li a {
    justify-content: center;
    padding: 12px 0;
}

.admin-sidebar.sidebar-collapsed nav ul li a span {
    margin-right: 0;
    font-size: 1.25rem;
}

/* Hide text labels when sidebar is collapsed */
.admin-sidebar.sidebar-collapsed nav ul li a {
    font-size: 0;
}

.admin-sidebar.sidebar-collapsed .sidebar-footer {
    padding: 10px 5px;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.admin-sidebar.sidebar-collapsed .sidebar-user {
    flex-direction: column;
    text-align: center;
}

.admin-sidebar.sidebar-collapsed .sidebar-user div:last-child {
    display: none; /* Hide name/role text */
}

/* Adjust Main Layout margins dynamically */
.admin-layout {
    transition: var(--transition);
}

.admin-sidebar.sidebar-collapsed ~ .admin-layout {
    margin-left: 65px;
    width: calc(100vw - 65px);
}

/* Header hamburger toggle */
.sidebar-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sidebar-toggle-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* =========================================================================
   DIAGNOSTIC GAUGES & HEALTH PANEL
   ========================================================================= */

.health-gauge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.health-gauge-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(10px);
}

.gauge-svg {
    width: 65px;
    height: 65px;
    transform: rotate(-90deg);
}

.gauge-circle-bg {
    fill: none;
    stroke: rgba(255,255,255,0.03);
    stroke-width: 4;
}

.gauge-circle-fill {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

/* =========================================================================
   BULK OPERATIONS TOOLBAR & CHECKBOXES
   ========================================================================= */

.bulk-actions-toolbar {
    background: rgba(0, 240, 255, 0.04);
    border: 1px dashed var(--accent-cyan);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    animation: fadeIn 0.3s ease;
}

/* Form checkboxes styling */
.admin-checkbox-custom {
    width: 17px;
    height: 17px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: rgba(255,255,255,0.02);
    cursor: pointer;
}

/* =========================================================================
   IMAGE UPLOAD LIVE THUMBNAILS PREVIEWS
   ========================================================================= */

.image-preview-thumbnail {
    width: 50px;
    height: 50px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: rgba(255,255,255,0.01);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-right: 12px;
}

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