/* BestAFK - Admin Panel Styles */
/* ============================== */

:root {
    --admin-primary: #dc2626;
    --admin-primary-dark: #b91c1c;
    --admin-danger: #ef4444;
    --admin-success: #22c55e;
    --admin-warning: #8b5cf6;
    --admin-info: #3b82f6;
    --admin-accent: #ff4444;
}

/* Layout */
body {
    display: flex;
    min-height: 100vh;
    background: #0a0a0a;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #111111;
    border-right: 1px solid #222;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--admin-primary);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-badge {
    background: var(--admin-primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(220, 38, 38, 0.15);
    color: var(--admin-primary);
    border-left-color: var(--admin-primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: #2a2a2a;
    margin: 0.75rem 1.5rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #2a2a2a;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #1a1a1a;
}

.admin-info {
    display: flex;
    flex-direction: column;
}

.admin-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.admin-role {
    font-size: 0.75rem;
    color: var(--admin-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: calc(100vw - 260px);
    overflow-x: hidden;
}

/* Top Bar */
.top-bar {
    background: #111111;
    border-bottom: 1px solid #2a2a2a;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: var(--text-primary);
    width: 250px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Content Wrapper */
.content-wrapper {
    padding: 1.5rem;
    flex: 1;
    max-width: 100%;
    overflow-x: auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #111111;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.users {
    background: rgba(59, 130, 246, 0.15);
    color: var(--admin-info);
}

.stat-icon.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--admin-success);
}

.stat-icon.banned {
    background: rgba(239, 68, 68, 0.15);
    color: var(--admin-danger);
}

.stat-icon.accounts {
    background: rgba(220, 38, 38, 0.15);
    color: var(--admin-primary);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Cards */
.card {
    background: #111111;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #2a2a2a;
}

.card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    color: var(--admin-primary);
}

.card-body {
    padding: 1.25rem;
}

/* Plan Distribution */
.plan-bar {
    margin-bottom: 1rem;
}

.plan-bar:last-child {
    margin-bottom: 0;
}

.plan-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.plan-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.plan-count {
    font-weight: 600;
    color: var(--text-primary);
}

.plan-progress {
    height: 8px;
    background: #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
}

.plan-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.plan-fill.free {
    background: var(--text-muted);
}

.plan-fill.starter {
    background: var(--admin-info);
}

.plan-fill.balanced {
    background: #10b981;
}

.plan-fill.pro {
    background: var(--admin-primary);
}

.plan-fill.enterprise {
    background: linear-gradient(90deg, #8b5cf6, #ef4444);
}

/* Recent Users */
.recent-users {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: #1a1a1a;
    border-radius: 8px;
}

.recent-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

.recent-user-info {
    flex: 1;
}

.recent-user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.recent-user-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.recent-user-plan {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.recent-user-plan.free {
    background: rgba(156, 163, 175, 0.2);
    color: var(--text-secondary);
}

.recent-user-plan.starter {
    background: rgba(59, 130, 246, 0.2);
    color: var(--admin-info);
}

.recent-user-plan.balanced {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.recent-user-plan.pro {
    background: rgba(220, 38, 38, 0.2);
    color: var(--admin-primary);
}

.recent-user-plan.enterprise {
    background: rgba(245, 158, 11, 0.2);
    color: var(--admin-warning);
}

/* Section Header */
.section-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Warning Row for deleted accounts */
.warning-row {
    background: rgba(220, 38, 38, 0.1) !important;
}

.warning-row:hover {
    background: rgba(220, 38, 38, 0.15) !important;
}

.filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select,
.filter-input {
    background: #111111;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 150px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--admin-primary);
}

.filter-input {
    min-width: 250px;
}

/* Table */
.table-container {
    background: #111111;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow-x: auto;
    max-width: 100%;
}

.data-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    table-layout: fixed;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #2a2a2a;
    white-space: nowrap;
}

/* Actions column - fixed width and proper display */
.data-table th:last-child,
.data-table td:last-child {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
    text-align: center;
}

.data-table th {
    background: #1a1a1a;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

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

.data-table tr:hover td {
    background: rgba(220, 38, 38, 0.05);
}

.data-table .loading {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* User Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.8rem;
}

.mc-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: #333;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--admin-success);
}

.status-badge.banned {
    background: rgba(239, 68, 68, 0.15);
    color: var(--admin-danger);
}

.status-badge.inactive {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-secondary);
}

.status-badge.online {
    background: rgba(34, 197, 94, 0.15);
    color: var(--admin-success);
}

.status-badge.offline {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-secondary);
}

/* Plan Badges */
.plan-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-badge.free {
    background: rgba(156, 163, 175, 0.2);
    color: var(--text-secondary);
}

.plan-badge.starter {
    background: rgba(59, 130, 246, 0.2);
    color: var(--admin-info);
}

.plan-badge.balanced {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.plan-badge.pro {
    background: rgba(220, 38, 38, 0.2);
    color: var(--admin-primary);
}

.plan-badge.enterprise {
    background: rgba(245, 158, 11, 0.2);
    color: var(--admin-warning);
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.user {
    background: rgba(156, 163, 175, 0.2);
    color: var(--text-secondary);
}

.role-badge.admin {
    background: rgba(59, 130, 246, 0.2);
    color: var(--admin-info);
}

.role-badge.owner {
    background: rgba(239, 68, 68, 0.2);
    color: var(--admin-danger);
}

/* Action Buttons */
.action-buttons {
    display: inline-flex;
    gap: 0.25rem;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
}

.btn-action {
    width: 32px;
    min-width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.btn-action.view {
    background: #1e3a5f;
    color: #60a5fa;
}

.btn-action.view:hover {
    background: #2563eb;
    color: #ffffff;
}

.btn-action.edit {
    background: #3f1f1f;
    color: #dc2626;
}

.btn-action.edit:hover {
    background: #dc2626;
    color: #ffffff;
}

.btn-action.ban {
    background: #3f1f1f;
    color: #ef4444;
}

.btn-action.ban:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-action.unban {
    background: #1f3f2f;
    color: #22c55e;
}

.btn-action.unban:hover {
    background: #22c55e;
    color: #ffffff;
}

.btn-action.delete {
    background: #3f1f1f;
    color: #ef4444;
}

.btn-action.delete:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-action.login-as {
    background: #1f2f3f;
    color: #3b82f6;
}

.btn-action.login-as:hover {
    background: #3b82f6;
    color: #ffffff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #2a2a2a;
    background: #111111;
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
    color: white;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 1rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #111111;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h2 i {
    color: var(--admin-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #2a2a2a;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

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

/* Buttons */
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--admin-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--admin-primary-dark);
}

.btn-secondary {
    background: #1a1a1a;
    color: var(--text-primary);
    border: 1px solid #2a2a2a;
}

.btn-secondary:hover {
    background: #2a2a2a;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--admin-success);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

/* User Details in Modal */
.user-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2a2a2a;
}

.user-detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.user-detail-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.user-detail-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.user-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.user-detail-item {
    padding: 0.75rem;
    background: #1a1a1a;
    border-radius: 8px;
}

.user-detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.user-detail-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Admin select dropdowns */
.admin-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #252525;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-select:hover {
    border-color: #444;
}

.admin-select:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.admin-select option {
    background: #1a1a1a;
    color: #fff;
    padding: 0.5rem;
}

.user-actions-section {
    padding-top: 1rem;
    border-top: 1px solid #2a2a2a;
}

.user-accounts-section {
    margin-top: 1.5rem;
}

.user-accounts-section h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.user-account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #1a1a1a;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.user-account-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-account-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.user-account-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

.toast.success {
    background: var(--admin-success);
    color: white;
}

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

.toast.info {
    background: var(--admin-info);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .user-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-select,
    .filter-input {
        width: 100%;
    }
    
    .search-box input {
        width: 150px;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

