/* 
 * Admin Panel Styles
 * Extends the main design system
 */

.admin-body {
    background-color: #0d1117;
    min-height: 100vh;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1b2838 0%, #0d1117 100%);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    font-family: 'Outfit', sans-serif;
}

.login-logo .logo-image {
    height: 60px;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px;
    background: #0d1117;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: white;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.login-error {
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.9rem;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
}

.login-footer a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-footer a:hover {
    color: var(--primary-color);
}

/* Admin Layout */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
}

.sidebar-nav {
    padding: 24px 16px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(88, 166, 255, 0.1);
    color: var(--text-accent);
}

.link-icon {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--glass-border);
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-width: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 1.8rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.user-name {
    font-weight: 500;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info {
    flex: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-change.positive {
    color: #00ff88;
}

.stat-change.negative {
    color: #ff6b6b;
}

.stat-change.neutral {
    color: var(--text-secondary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 24px;
}

.dashboard-card h3 {
    margin-bottom: 24px;
    font-size: 1.1rem;
}

/* Sections */
.admin-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.admin-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Data Tables */
.data-table-container {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-success {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
}

.status-warning {
    background: rgba(255, 179, 0, 0.1);
    color: #ffb300;
}

.status-danger {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 4px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #161b22;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 32px;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.checkbox-label input {
    width: 20px;
    height: 20px;
}

/* Responsive Admin */
@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }
}