@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-base: #050508;
    --bg-sidebar: rgba(10, 10, 15, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.02);
    --bg-glass-hover: rgba(255, 255, 255, 0.04);
    
    --border-glass: rgba(255, 255, 255, 0.05);
    --border-glass-light: rgba(255, 255, 255, 0.1);
    
    --accent-primary: #8B5CF6;
    --accent-primary-hover: #7C3AED;
    --accent-secondary: #3B82F6;
    --accent-danger: #EF4444;
    --accent-danger-hover: #DC2626;
    --accent-gold: #F59E0B;
    
    --text-primary: #ffffff;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Base Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background Ambient Orbs */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.15;
}

body::before {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -200px;
    right: -100px;
}

body::after {
    width: 500px;
    height: 500px;
    background: var(--accent-secondary);
    bottom: -150px;
    left: -150px;
}

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

/* Main Layout */
.admin-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 10;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 40px;
    padding: 0 12px;
    letter-spacing: -0.5px;
}

.admin-logo svg {
    color: var(--accent-primary);
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.admin-tab svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.admin-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.admin-tab.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.1), transparent);
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: inset 2px 0 0 var(--accent-primary);
}

.admin-tab.active svg {
    opacity: 1;
    color: var(--accent-primary);
}

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

/* Main Content Area */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.admin-header {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background: rgba(5, 5, 8, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 5;
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

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

.admin-profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border-glass);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px solid var(--border-glass-light);
    background-size: cover;
    background-position: center;
}

.admin-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.admin-profile-name {
    font-weight: 600;
    font-size: 0.9rem;
}

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

.admin-content {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.admin-panel {
    display: none;
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.admin-panel.active {
    display: block;
}

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

/* Glass Components */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--shadow-glass);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Dashboard Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: 24px;
    margin-bottom: 40px;
}

.bento-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento-item .bento-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass);
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.bento-item.accent-primary .bento-icon { color: var(--accent-primary); background: rgba(139, 92, 246, 0.1); border-color: rgba(139, 92, 246, 0.2); }
.bento-item.accent-secondary .bento-icon { color: var(--accent-secondary); background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); }
.bento-item.accent-gold .bento-icon { color: var(--accent-gold); background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.2); }
.bento-item.accent-danger .bento-icon { color: var(--accent-danger); background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); }

.bento-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

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

/* User List */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr 100px;
    align-items: center;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.user-row:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glass-light);
}

.user-row-header {
    background: transparent;
    border: none;
    padding: 0 24px 12px 24px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 600;
    letter-spacing: 1px;
}

.user-row-header:hover {
    background: transparent;
    border-color: transparent;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge-admin {
    background: rgba(139, 92, 246, 0.15);
    color: #A78BFA;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-user {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-glass {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-glass-light);
}

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

.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);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass-light);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

/* Shop Grid */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.shop-item {
    display: flex;
    flex-direction: column;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.shop-item:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4), 0 0 20px rgba(139, 92, 246, 0.1);
}

.shop-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px auto;
    border-radius: 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-glass-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    overflow: hidden;
}

.shop-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-name {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
}

.shop-price {
    text-align: center;
    color: var(--accent-gold);
    font-weight: 700;
    margin-bottom: 16px;
}

/* Alerts */
.admin-alert {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    display: none;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34D399;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #F87171;
}

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

/* Data Grid Styles */
.admin-table th {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}
.admin-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-glass-light);
    vertical-align: middle;
}
.admin-table tbody tr {
    background: rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.admin-table tbody tr:hover {
    background: rgba(255,255,255,0.04);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}
.admin-table tbody td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.admin-table tbody td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}
.admin-table td {
    padding: 20px;
    border-bottom: none;
    vertical-align: middle;
}


/* Toggle Switches */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
    border-radius: 34px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-primary);
}
.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--accent-primary);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}
.toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Sidebar lists */
.role-list-item {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}
.role-list-item:hover {
    background: rgba(255,255,255,0.05);
}
.role-list-item.active {
    background: rgba(255,255,255,0.1);
    border-left: 4px solid var(--role-color, var(--accent-primary));
}
.role-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--role-color);
}

.avatar-initials {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: white;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.modern-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 20px;
    margin-left: 10px;
}
.badge-admin {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.3);
    box-shadow: 0 0 10px rgba(239,68,68,0.1);
}
.btn-modern-edit {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn-modern-edit:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-primary);
    transform: scale(1.05);
}


/* Premium Table Headers */
.admin-table thead tr {
    background: rgba(255,255,255,0.03);
    border: none !important;
}
.admin-table th:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.admin-table th:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

/* Staggered Row Animation */
@keyframes fadeInUpRow {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.user-row-anim {
    animation: fadeInUpRow 0.5s ease backwards;
}

/* Row Styling Enhancements */
.admin-table tbody tr {
    background: rgba(15, 15, 20, 0.4);
    border-left: 4px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}
.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--accent-primary);
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

/* Online Status Dot */
.avatar-wrapper {
    position: relative;
    display: inline-block;
}
.online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #10b981;
    border-radius: 50%;
    border: 2px solid #111;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Glassy container for role */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(4px);
}

.scrollable-desc::-webkit-scrollbar { width: 4px; }
.scrollable-desc::-webkit-scrollbar-track { background: transparent; }
.scrollable-desc::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
.scrollable-desc::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }
