/* NexAura Studios - Admin Dashboard CSS */

:root {
    --bg-dark: #090d16;
    --bg-card: #131b2e;
    --bg-card-hover: #1b2640;
    --bg-input: #0d1424;
    --border-color: #243049;
    --border-focus: #38bdf8;
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --primary: #38bdf8;
    --primary-dark: #0284c7;
    --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    --primary-alpha: rgba(56, 189, 248, 0.12);
    
    --danger: #ef4444;
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --success: #10b981;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 24px rgba(56, 189, 248, 0.25);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

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

body.admin-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Auth Lock Screen */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #172554 0%, var(--bg-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1rem;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.auth-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-card {
    background: rgba(19, 27, 46, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    animation: authSlideUp 0.5s ease;
}

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

.auth-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.pin-input-group {
    margin-bottom: 1.25rem;
}

.pin-input-group input {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.5rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    transition: all 0.2s ease;
}

.pin-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.auth-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    min-height: 20px;
}

.auth-hint {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 1.25rem;
}

.auth-hint code {
    background: var(--bg-input);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: var(--primary);
}

.auth-back {
    margin-top: 1.5rem;
}

.auth-back a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.auth-back a:hover {
    color: var(--primary);
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.dashboard-wrapper.hidden {
    display: none;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.badge-role {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    background: var(--primary-alpha);
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary-alpha);
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
}

.nav-icon {
    font-size: 1.15rem;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-btn-view, .sidebar-btn-logout {
    display: block;
    text-align: center;
    padding: 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-btn-view {
    background: var(--bg-card-hover);
    color: var(--primary);
    border: 1px solid var(--border-color);
}

.sidebar-btn-view:hover {
    border-color: var(--primary);
    background: var(--primary-alpha);
}

.sidebar-btn-logout {
    background: transparent;
    color: var(--text-dim);
    border: none;
}

.sidebar-btn-logout:hover {
    color: var(--danger);
}

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

.admin-topbar {
    height: var(--topbar-height);
    background: rgba(19, 27, 46, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

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

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    background: var(--bg-input);
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

/* Content Container */
.content-container {
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

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

/* Buttons */
.btn-primary, .btn-outline, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
    border: none;
}

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Cards & Form Panels */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.panel-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.panel-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.form-grid.inline-action {
    grid-template-columns: 1fr auto;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

/* Overview Cards */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.overview-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.stat-icon-wrapper.blue { background: rgba(56, 189, 248, 0.15); }
.stat-icon-wrapper.purple { background: rgba(168, 85, 247, 0.15); }
.stat-icon-wrapper.green { background: rgba(16, 185, 129, 0.15); }
.stat-icon-wrapper.amber { background: rgba(245, 158, 11, 0.15); }

.stat-big-val {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-sub {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.dashboard-grid-two {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem;
}

.quick-action-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.qa-icon {
    font-size: 1.5rem;
}

.quick-action-btn strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.quick-action-btn p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.system-status-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.status-row:last-child {
    border-bottom: none;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Stats Editor Grid */
.stats-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-edit-box {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

/* Services Admin Grid */
.services-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.service-admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.2s ease;
}

.service-admin-card:hover {
    border-color: var(--primary);
}

.service-card-top {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.service-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--primary-alpha);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.service-card-details h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.service-card-details p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.item-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

/* Portfolio Tabs & Grid */
.portfolio-admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.sub-tab-btn {
    padding: 0.65rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sub-tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-card-hover);
}

.sub-tab-btn.active {
    background: var(--primary-alpha);
    color: var(--primary);
    font-weight: 600;
}

.subtab-panel {
    display: none;
}

.subtab-panel.active {
    display: block;
}

.portfolio-admin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.portfolio-admin-grid.vertical-items {
    grid-template-columns: repeat(4, 1fr);
}

.portfolio-admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.item-preview-frame {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
    position: relative;
}

.portfolio-admin-grid.vertical-items .item-preview-frame {
    aspect-ratio: 9/16;
}

.item-preview-frame img, .item-preview-frame iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.item-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.item-card-category {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 700;
}

/* Testimonials Admin Grid */
.testimonials-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.testimonial-admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.test-quote-text {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.6;
}

.test-author-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.test-avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.test-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.test-role {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Settings & Danger Zone */
.backup-actions {
    display: flex;
    gap: 1rem;
}

.danger-zone {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.04);
}

.danger-title {
    color: var(--danger);
}

/* Modal Popup */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.admin-modal-overlay.hidden {
    display: none;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 540px;
    box-shadow: var(--shadow-md);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.25rem;
    cursor: pointer;
}

.modal-close-btn:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Toast Notifications */
.admin-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 99999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.admin-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.admin-toast.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.admin-toast.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .stats-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .portfolio-admin-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .portfolio-admin-grid.vertical-items {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid-two {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0,0,0,0.8);
    }
    .admin-main {
        margin-left: 0;
    }
    .mobile-toggle {
        display: block;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-group.full-width {
        grid-column: span 1;
    }
    .services-admin-grid,
    .testimonials-admin-grid,
    .stats-edit-grid {
        grid-template-columns: 1fr;
    }
    .portfolio-admin-grid,
    .portfolio-admin-grid.vertical-items {
        grid-template-columns: 1fr;
    }
    .topbar-actions .btn-outline {
        display: none;
    }
}
