/* Admin Modern Redesign v2.0 */

/* === Variables & Theme === */
:root {
    --admin-sidebar-width: 280px;
    --admin-header-height: 70px;
    --admin-bg: #050608;
    --admin-surface: rgba(20, 22, 30, 0.6);
    --admin-surface-hover: rgba(30, 33, 45, 0.8);
    --admin-border: rgba(255, 255, 255, 0.08);
    --admin-border-highlight: rgba(138, 43, 226, 0.3);
    --admin-text: #e6e6f0;
    --admin-text-muted: #9ca3af;
    --admin-primary: #8a2be2;
    --admin-secondary: #00eaff;
    --admin-success: #4ade80;
    --admin-warning: #facc15;
    --admin-error: #f87171;
    --admin-info: #60a5fa;
}

/* === Layout Structure === */
body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Inter', sans-serif;
}

.admin-dashboard-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: radial-gradient(circle at top right, rgba(138, 43, 226, 0.05), transparent 40%),
                radial-gradient(circle at bottom left, rgba(0, 234, 255, 0.05), transparent 40%);
    overflow: hidden;
}

/* === Sidebar === */
.admin-sidebar {
    width: var(--admin-sidebar-width);
    height: 100%;
    background: rgba(10, 11, 16, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
}

.sidebar-logo img {
    filter: drop-shadow(0 0 8px rgba(138, 43, 226, 0.5));
    width: 32px;
    height: 32px;
}

.sidebar-logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #fff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--admin-text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.sidebar-menu-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-menu-item.active {
    background: rgba(138, 43, 226, 0.1);
    color: #fff;
    border-color: rgba(138, 43, 226, 0.2);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.1);
}

.sidebar-menu-item svg {
    opacity: 0.7;
    transition: 0.2s;
    width: 18px;
    height: 18px;
}

.sidebar-menu-item.active svg {
    color: var(--admin-primary);
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(138, 43, 226, 0.6));
}

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

.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--admin-text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-footer-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

/* === Main Content Area === */
.admin-content, .admin-main-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* === Admin Header === */
.admin-header {
    background: rgba(10, 11, 16, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--admin-border);
    padding: 0 32px;
    height: var(--admin-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 40;
    flex-shrink: 0;
}

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

.sidebar-toggle {
    display: none; /* Shown on mobile */
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}

.admin-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-link {
    color: var(--admin-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: #fff;
}

.breadcrumb-separator {
    color: var(--admin-border);
}

.breadcrumb-current {
    color: #fff;
    font-weight: 600;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-search {
    position: relative;
    display: flex;
    align-items: center;
}

.admin-search-input {
    width: 300px;
    padding: 10px 16px 10px 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.admin-search-input:focus {
    outline: none;
    border-color: var(--admin-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.1);
}

.admin-search-icon {
    position: absolute;
    left: 12px;
    color: var(--admin-text-muted);
    pointer-events: none;
}

.admin-notification-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    position: relative;
}

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

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--admin-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.admin-user-menu {
    position: relative;
}

.admin-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 6px 12px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-user-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.admin-user-avatar, .admin-user-initial {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.admin-user-initial {
    background: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.admin-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(15, 17, 23, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    min-width: 240px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.user-dropdown-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--admin-border);
}

.user-dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
}

.user-dropdown-info {
    flex: 1;
    min-width: 0;
}

.user-dropdown-name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.user-dropdown-email {
    color: var(--admin-text-muted);
    font-size: 12px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* === Page Content & Sections === */
.admin-page-content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
}

.admin-sections-container {
    display: flex;
    flex-direction: column;
    gap: 60px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-section {
    animation: fadeIn 0.5s ease-out forwards;
    scroll-margin-top: 100px;
}

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

.admin-page-header {
    margin-bottom: 24px;
}

.admin-page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
}

.admin-page-subtitle {
    color: var(--admin-text-muted);
    font-size: 14px;
    margin: 0;
}

/* === Dashboard Overview Cards === */
.dashboard-overview-modern {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(10px);
    margin-bottom: 24px;
}

.dashboard-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.dashboard-title-modern {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.dashboard-subtitle-modern {
    color: var(--admin-text-muted);
    font-size: 13px;
    margin: 4px 0 0 0;
}

.dashboard-controls-modern {
    display: flex;
    gap: 12px;
}

.dashboard-stats-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.dashboard-stat-card-modern {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 20px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.dashboard-stat-card-modern:hover {
    border-color: var(--admin-border-highlight);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.stat-card-background {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0.1;
    background: radial-gradient(circle at top right, currentColor 0%, transparent 70%);
    pointer-events: none;
}

.stat-card-content {
    position: relative;
    z-index: 1;
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

/* Stat Card Variants */
.stat-card-primary { color: var(--admin-secondary); }
.stat-card-success { color: var(--admin-success); }
.stat-card-warning { color: var(--admin-warning); }
.stat-card-info { color: var(--admin-info); }

.stat-card-primary .stat-card-icon-wrapper { background: rgba(0, 234, 255, 0.15); color: var(--admin-secondary); }
.stat-card-success .stat-card-icon-wrapper { background: rgba(74, 222, 128, 0.15); color: var(--admin-success); }
.stat-card-warning .stat-card-icon-wrapper { background: rgba(250, 204, 21, 0.15); color: var(--admin-warning); }

.stat-card-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--admin-text-muted);
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.stat-card-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--admin-text-muted);
}

/* === Content Cards & Tools === */
.content-card-modern {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.tool-title-modern {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 20px 0;
    font-family: 'Space Grotesk', sans-serif;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.action-btn-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--admin-border);
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
}

.action-btn-modern:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--admin-primary);
    transform: translateY(-2px);
}

.btn-icon { font-size: 24px; }
.btn-text { font-size: 14px; font-weight: 500; }

.status-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.status-item-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--admin-text-muted);
}
.status-dot.online { background: var(--admin-success); box-shadow: 0 0 8px rgba(74, 222, 128, 0.4); }

.status-name { font-size: 13px; color: var(--admin-text-muted); }
.status-value { font-size: 13px; font-weight: 600; color: #fff; margin-left: auto; }

/* === Members Grid === */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.member-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.member-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--admin-primary);
    transform: translateY(-2px);
}

.member-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.member-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--admin-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}

.member-card-info {
    flex: 1;
    min-width: 0;
}

.member-card-name {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-card-email {
    color: var(--admin-text-muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.member-status-indicator {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}

.member-status-indicator.verified { background: rgba(74, 222, 128, 0.1); color: var(--admin-success); border-color: rgba(74, 222, 128, 0.2); }
.member-status-indicator.unverified { background: rgba(156, 163, 175, 0.1); color: var(--admin-text-muted); border-color: rgba(156, 163, 175, 0.2); }
.member-status-indicator.banned { background: rgba(248, 113, 113, 0.1); color: var(--admin-error); border-color: rgba(248, 113, 113, 0.2); }

/* === Data Tables === */
.admin-table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--admin-border);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--admin-text-muted);
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}

.admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--admin-text);
}

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

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

/* === Forms & Buttons === */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; color: var(--admin-text-muted); font-size: 13px; font-weight: 500; }
.form-input, .form-select, .form-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: #fff;
    font-family: inherit;
    transition: all 0.2s;
}
.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.1);
    background: rgba(0, 0, 0, 0.4);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

.btn-primary {
    background: linear-gradient(135deg, var(--admin-primary), #7c3aed);
    color: #fff;
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(138, 43, 226, 0.4); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }

.btn-ghost { background: transparent; color: var(--admin-text-muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.4); }

.btn-warning {
    background: rgba(234, 179, 8, 0.1);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.2);
}
.btn-warning:hover { background: rgba(234, 179, 8, 0.2); border-color: rgba(234, 179, 8, 0.4); }

/* === Scrollbar === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* === Responsive === */
@media (max-width: 1024px) {
    .admin-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        box-shadow: 50px 0 100px rgba(0,0,0,0.5);
    }
    .admin-sidebar.open { left: 0; }
    .admin-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(4px);
        z-index: 45;
    }
    .admin-sidebar-backdrop.active { display: block; }
    .sidebar-toggle { display: block; }
    .admin-header { padding: 0 16px; }
    .admin-page-content { padding: 20px 16px; }
}

@media (max-width: 768px) {
    .admin-dashboard-wrapper { flex-direction: column; }
    .admin-header-right .admin-search { display: none; } /* Hide search on mobile for space */
}
