/* 
    Retro Chris Gaming - Admin Panel CSS (Light Theme)
    Style: Bright, Clean, Focus on Usability, Apple-like Professionalism
*/

:root {
    --admin-bg: #f3f4f6;
    --admin-sidebar: #ffffff;
    --admin-surface: #ffffff;
    --admin-border: #e5e7eb;
    
    --primary-color: #4338ca;
    --primary-hover: #3730a3;
    --danger-color: #ef4444;
    
    --text-main: #111827;
    --text-muted: #6b7280;
    --sidebar-text: #4b5563;
    --sidebar-text-hover: #111827;
    
    --font-admin: 'Inter', sans-serif;
    --sidebar-width: 260px;
}

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

body {
    font-family: var(--font-admin);
    background-color: var(--admin-bg);
    color: var(--text-main);
}

.admin-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--admin-sidebar);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--admin-border);
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

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

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
}

.sidebar-header .highlight {
    color: var(--primary-color);
}

.nav-menu {
    list-style: none;
    padding: 1.5rem 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
    font-weight: 500;
}

.nav-item i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 10px;
}

.nav-item:hover {
    background-color: #f9fafb;
    color: var(--sidebar-text-hover);
}

.nav-item.active {
    background-color: #eef2ff;
    color: var(--primary-color);
    border-right-color: var(--primary-color);
}

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

.sidebar-footer .nav-item {
    color: var(--danger-color);
}
.sidebar-footer .nav-item:hover {
    background-color: #fef2f2;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    height: 75px;
    background-color: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-bar {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 10px;
}

.search-bar input {
    border: none;
    background: transparent;
    color: var(--text-main);
    outline: none;
    width: 250px;
    font-family: var(--font-admin);
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.admin-profile img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.content-container {
    padding: 2.5rem;
    width: 100%;
    max-width: 1200px;
}

/* Tabs */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

.page-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 1.8rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

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

.stat-info h3 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.settings-card h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--admin-border);
    color: var(--text-main);
}

/* Forms */
.form-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    padding: 0.8rem 1rem;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #f9fafb;
    color: var(--text-main);
    font-family: var(--font-admin);
    outline: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

.form-group small {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 5px;
}

.text-muted {
    color: var(--text-muted);
}

.btn-submit {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-admin);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 1rem;
}

.btn-submit:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 10px rgba(67, 56, 202, 0.2);
}

.btn-danger {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: var(--danger-color);
    color: #ffffff;
}

/* Table */
.data-table-container {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 1.2rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.data-table th {
    background: #f9fafb;
    font-weight: 700;
    color: var(--sidebar-text);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #f3f4f6;
}

.admin-td-img {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Responsive UI / Mobile Design */
@media (max-width: 768px) {
    .admin-wrapper {
        flex-direction: column;
    }

    /* Convert Sidebar into an App-like Bottom Navigation */
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--admin-border);
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 1000;
        background: var(--admin-surface);
        box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
    }
    
    .sidebar-header {
        display: none; /* Hide brand header to save space */
    }

    .nav-menu {
        display: flex;
        padding: 0;
        margin: 0;
        width: 100%;
        justify-content: space-between;
    }

    .nav-item {
        flex-direction: column;
        padding: 0.6rem 0.2rem;
        font-size: 0.65rem;
        border-right: none;
        border-top: 3px solid transparent;
        flex: 1;
        text-align: center;
        justify-content: center;
        gap: 6px;
    }

    .nav-item i {
        margin-right: 0;
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .nav-item.active {
        border-right: none;
        border-top-color: var(--primary-color);
        background: transparent;
    }

    .sidebar-footer {
        padding: 0;
        border-top: none;
        display: flex;
    }
    
    .sidebar-footer .nav-item {
        border-top: 3px solid transparent; /* Match alignment */
        width: 60px;
    }

    /* Main Content adjustments */
    .main-content {
        padding-bottom: 70px; /* Room for bottom nav */
    }

    .topbar {
        padding: 0 1rem;
        height: 60px;
    }
    
    .search-bar {
        padding: 0.4rem 0.8rem;
    }
    
    .search-bar input {
        width: 110px;
        font-size: 0.9rem;
    }

    .admin-profile span {
        display: none; /* Hide name, keep avatar */
    }

    .content-container {
        padding: 1.5rem 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    /* Layout stacking */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-card {
        padding: 1.5rem;
    }

    .settings-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    #tab-settings > div {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    #tab-settings .btn-submit {
        width: 100%;
        justify-content: center;
    }
}
