/* ============================================
   Tesla Invest - Admin Dashboard Styles
   Version: 1.0
   ============================================ */

:root {
    --tesla-red: #e82127;
    --tesla-red-dark: #c0181e;
    --tesla-red-glow: rgba(232, 33, 39, 0.3);
    --dark-bg: #0a0a0f;
    --sidebar-bg: #0f0f15;
    --card-bg: rgba(20, 20, 30, 0.8);
    --glass: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent-green: #00d084;
    --accent-yellow: #ffc107;
    --accent-orange: #ff9800;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --gradient-1: linear-gradient(135deg, #e82127 0%, #ff4757 100%);
    --gradient-2: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.25);
}

/* ============================================
   Global Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* Links */
a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* ============================================
   Background Effects
   ============================================ */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(232, 33, 39, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        var(--dark-bg);
    animation: meshMove 20s ease-in-out infinite;
}

@keyframes meshMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* ============================================
   Dashboard Layout
   ============================================ */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.sidebar-header .logo-icon {
    padding: 5px 0;
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.sidebar-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

.sidebar-close:hover {
    background: var(--tesla-red);
    transform: rotate(90deg);
}

/* Only show on mobile when sidebar is active */
@media (max-width: 768px) {
    .sidebar.active .sidebar-close {
        display: flex;
    }
    
    .sidebar .sidebar-close {
        display: none;
    }
}

@media (min-width: 769px) {
    .sidebar-close {
        display: none;
    }
    .main-content {
        margin-left: 280px;
    }
}

.logo-icon .logo-image { 
    filter: brightness(0) invert(1); 
    height: 100%; 
    width: 100%; 
    object-fit: contain; 
} 

.sidebar-header .logo-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.sidebar-header .logo-icon i {
    font-size: 1.2rem;
    color: white;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    /* font-family: 'Space Grotesk', sans-serif; */
}

.sidebar-header p {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Navigation Menu */
.nav-menu {
    padding: 1.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--glass);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--gradient-1);
    color: white;
}

.nav-item i {
    width: 24px;
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 1.5rem;
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--tesla-red));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* font-family: 'Space Grotesk', sans-serif; */
}

/* Admin Info */
.admin-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.admin-badge {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--glass);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border);
}

.admin-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    border-color: var(--tesla-red);
    color: var(--tesla-red);
}

/* ============================================
   Stats Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(232, 33, 39, 0.3);
    box-shadow: var(--shadow-lg);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-header i {
    font-size: 2rem;
    color: var(--tesla-red);
    opacity: 0.7;
}

.stat-header div {
    /*color: var(--tesla-red);*/
    color: var(--text-secondary);
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    /*color: var(--tesla-red);*/
    color: var(--text-primary);
    word-break: break-all;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}



/* Plan Distribution */
.plan-distribution {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.plan-distribution h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.plan-stat-item {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background: var(--glass);
    border-radius: 12px;
}

.plan-stat-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.plan-stat-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tesla-red);
}



/* ============================================
   Tables
   ============================================ */
.table-container, .recent-table {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 2rem;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-header h3 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.recent-table h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    font-size: 0.9rem;
}

tr:hover td {
    background: var(--glass);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-approved, .status-active, .status-success {
    background: rgba(0, 208, 132, 0.2);
    color: var(--accent-green);
}

.status-pending, .status-open {
    background: rgba(255, 193, 7, 0.2);
    color: var(--accent-yellow);
}

.status-rejected, .status-suspended, .status-inactive {
    background: rgba(232, 33, 39, 0.2);
    color: var(--tesla-red);
}

.status-closed {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

/* Action Buttons */
.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.action-btn.approve {
    background: rgba(0, 208, 132, 0.2);
    color: var(--accent-green);
}

.action-btn.reject {
    background: rgba(232, 33, 39, 0.2);
    color: var(--tesla-red);
}

.action-btn:hover {
    transform: translateY(-2px);
    opacity: 0.8;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px var(--tesla-red-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--tesla-red-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--tesla-red);
    background: rgba(232, 33, 39, 0.1);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
}

/* ============================================
   Charts
   ============================================ */
.charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
}

.chart-container h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-container canvas {
    max-height: 300px;
    width: 100%;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--tesla-red);
    box-shadow: 0 0 0 3px var(--tesla-red-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* ============================================
   Modals
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    /* max-width: 450px; 
    width: 90%; */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.3rem;
}

.close-modal {
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: var(--tesla-red);
    transform: rotate(90deg);
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.tab:hover {
    background: var(--glass);
}

.tab.active {
    background: var(--gradient-1);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   Search Box
   ============================================ */
.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    padding: 0.6rem 1rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-primary);
    width: 250px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--tesla-red);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent-green);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    z-index: 1100;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.error {
    background: var(--tesla-red);
}

.toast.warning {
    background: var(--accent-yellow);
    color: #000;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Mobile Menu Toggle
   ============================================ */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 101;
    background: var(--tesla-red);
    border: none;
    border-radius: 12px;
    padding: 0.8rem;
    color: white;
    cursor: pointer;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tesla-red);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Show hamburger button */
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Hide sidebar off-screen by default */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    /* Show sidebar when active class added */
    .sidebar.active {
        transform: translateX(0);
    }
    
    /* Main content takes full width */
    .main-content {
        margin-left: 0 !important;
        padding: 1rem;
        padding-top: 4rem;
        padding-bottom: 12rem;
        width: 100%;
    }

    
    /* Fix top bar */
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Fix tables - allow horizontal scroll */
    .table-container {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
    
    /*  grids  layouts */ 
    .deposit-container,
    .support-container,
    .plans-grid,
    .profile-container, 
    .stats-grid,
    .charts-row {
        grid-template-columns: 1fr !important;
    }
    
    /* Fix tabs */
    .tabs {
        flex-wrap: wrap;
    }
    
    /* Fix search box */
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
}
/* ============================================
   Print Styles
   ============================================ */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .logout-btn,
    .action-btn {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .stat-card,
    .table-container,
    .chart-container {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .bg-mesh,
    .noise {
        display: none;
    }
}

.dataTable{
    width: 100%;
}