/* Admin Portal Styles */

/* Define Bootstrap surface variable if not defined */
:root {
    --bs-surface: #ffffff;
    --bs-surface-dark: #f8f9fa;
    --bs-body-bg: #f5f5f8;
}

[data-bs-theme="dark"] {
    --bs-surface: #212529;
    --bs-surface-dark: #343a40;
}

/* Admin Layout */
.admin-layout {
    min-height: 100vh;
    background-color: var(--bs-body-bg);
}

/* Admin Sidebar */
.admin-sidebar {
    width: 280px;
    background-color: var(--bs-surface);
    border-right: 1px solid var(--bs-border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
}

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

.admin-sidebar .sidebar-header {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-sidebar .sidebar-brand {
    font-size: 1.125rem;
    white-space: nowrap;
}

.admin-sidebar .nav-section {
    padding: 0.5rem 0;
}

.admin-sidebar .nav-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bs-secondary);
    letter-spacing: 0.05em;
}

.admin-sidebar .nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    /* Reset conflicting theme.css .nav-item styles */
    border-radius: 0 !important;
    margin: 0 !important;
    gap: 0;
    font-size: 0.9rem;
}

.admin-sidebar .nav-item:hover {
    background-color: rgba(220, 53, 69, 0.05) !important;
    color: var(--bs-danger) !important;
    border-left-color: rgba(220, 53, 69, 0.4);
}

.admin-sidebar .nav-item.active {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: var(--bs-danger) !important;
    border-left-color: var(--bs-danger);
    font-weight: 600;
}

.admin-sidebar .nav-icon {
    width: 20px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.admin-sidebar.sidebar-collapsed .nav-icon {
    margin-right: 0;
}

.admin-sidebar .nav-text {
    white-space: nowrap;
}

/* Admin Main Content */
.admin-main {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

.admin-sidebar.sidebar-collapsed ~ .admin-main {
    margin-left: 80px;
}

/* Admin Topbar */
.admin-topbar {
    min-height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1030;
}

/* Admin Content */
.admin-content {
    background-color: var(--bs-body-bg);
}

/* Admin Cards */
.admin-card {
    background-color: var(--bs-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.admin-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* Admin KPI Cards */
.admin-kpi-card {
    background-color: var(--bs-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.2s ease;
    height: 100%;
}

.admin-kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.admin-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.admin-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.admin-kpi-label {
    font-size: 0.875rem;
    color: var(--bs-secondary);
    margin-bottom: 0;
}

.admin-kpi-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* Admin Tables */
.admin-table {
    width: 100%;
    background-color: var(--bs-surface);
    border-radius: 0.5rem;
    overflow: hidden;
}

.admin-table table {
    width: 100%;
    margin-bottom: 0;
}

.admin-table thead {
    background-color: var(--bs-light);
}

.admin-table th {
    padding: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary);
    border-bottom: 2px solid var(--bs-border-color);
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.admin-table tbody tr:hover {
    background-color: var(--bs-light);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Admin Filters */
.admin-filters {
    background-color: var(--bs-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Admin Status Badges */
.admin-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-status-active {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--bs-success);
}

.admin-status-trial {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--bs-primary);
}

.admin-status-suspended {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--bs-danger);
}

.admin-status-pending {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--bs-warning);
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.sidebar-open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-sidebar.sidebar-collapsed ~ .admin-main {
        margin-left: 0;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1039;
}

/* Admin Action Buttons */
.admin-action-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.admin-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Admin Empty State */
.admin-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.admin-empty-icon {
    font-size: 4rem;
    color: var(--bs-secondary);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.admin-empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.admin-empty-text {
    color: var(--bs-secondary);
    margin-bottom: 1.5rem;
}

/* Admin Loading State */
.admin-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.admin-loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid var(--bs-border-color);
    border-top-color: var(--bs-danger);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
