:root {
    --bg-color: #0b0e14;
    --sidebar-bg: #0f172a;
    --card-bg: #151a24;
    --text-color: #f1f5f9;
    --text-muted: #64748b;
    --primary: #8b5cf6;
    --secondary: #3b82f6;
    --success: #10b981;
    --border-color: #1e293b;
    --radius: 16px;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    padding: 1.5rem;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
}
.logo span { color: var(--primary); }

.close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background-color: var(--card-bg);
    color: var(--text-color);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
    color: var(--text-color);
    border-left: 3px solid var(--primary);
}

.nav-item .icon { font-size: 1.2rem; }

.upgrade-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    margin-top: 1rem;
}
.upgrade-card h4 { margin-bottom: 0.5rem; }
.upgrade-card p { font-size: 0.8rem; opacity: 0.9; margin-bottom: 1rem; }
.btn-primary {
    background: #fff;
    color: var(--primary);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    width: calc(100% - 260px);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.search-bar input {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    color: var(--text-color);
    width: 300px;
    outline: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.status-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
}
.user-profile img {
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border-radius: 50%;
}

.welcome-section {
    margin-bottom: 2rem;
}
.welcome-section h1 { font-size: 2rem; }
.welcome-section p { color: var(--text-muted); }

/* Grid Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.bottom-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.card-title { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.3rem; }
.card-value { font-size: 1.8rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.sub-text { font-size: 0.8rem; color: var(--text-muted); }
.trend { font-size: 0.8rem; padding: 0.2rem 0.5rem; border-radius: 5px; }
.trend.up { background: rgba(16, 185, 129, 0.2); color: var(--success); }

.card-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
}
.bg-purple { background: rgba(139, 92, 246, 0.2); }
.bg-blue { background: rgba(59, 130, 246, 0.2); }
.bg-green { background: rgba(16, 185, 129, 0.2); }
.bg-orange { background: rgba(249, 115, 22, 0.2); }

/* Large Card Bars (Energy Used Style) */
.large-card { grid-column: span 2; }
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    height: 100px;
    margin-top: 1rem;
}
.bar {
    flex: 1;
    background: linear-gradient(to top, var(--primary), transparent);
    border-radius: 8px 8px 0 0;
    position: relative;
}
.bar span {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Line Graph (Heart Rate Style) */
.line-graph { margin-top: 1rem; height: 60px; }
.line-graph svg { width: 100%; height: 100%; }

/* Circular Progress (Wellness Style) */
.circular-progress { display: flex; justify-content: center; margin-top: 1rem; }
.circle {
    width: 80px; height: 80px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.inner-circle {
    width: 60px; height: 60px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Traffic Bars */
.traffic-bars { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.traffic-item span { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; display: block; }
.t-bar { width: 100%; height: 8px; background: var(--bg-color); border-radius: 4px; }
.t-fill { height: 100%; border-radius: 4px; }

/* Pie Chart */
.pie-container { display: flex; align-items: center; gap: 1.5rem; margin-top: 1rem; }
.pie-chart {
    width: 100px; height: 100px;
    border-radius: 50%;
}
.pie-legend { display: flex; flex-direction: column; gap: 0.5rem; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; }

/* Responsive Design */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .large-card { grid-column: span 2; }
    .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .close-btn { display: block; }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }
    .menu-toggle { display: block; }
    .search-bar input { width: 100%; }
    .search-bar { flex: 1; }
    .stats-grid { grid-template-columns: 1fr; }
    .large-card { grid-column: span 1; }
}

/* ====== Extra CSS for Inner Pages ====== */

/* Project List & Downloads List */
.project-list, .download-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: border 0.3s ease;
}

.project-item:hover {
    border-color: var(--primary);
}

.project-item .dl-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.project-item .dl-icon {
    font-size: 1.5rem;
    padding: 0.8rem;
    border-radius: 10px;
}

.project-item h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.project-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Status Badges */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-badge.active { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.status-badge.maintenance { background: rgba(249, 115, 22, 0.2); color: #f97316; }

/* YouTube Video Cards */
.video-card-dashboard {
    padding: 0;
    overflow: hidden;
}
.video-card-dashboard iframe {
    border-radius: 16px 16px 0 0;
    display: block;
}
.video-info {
    padding: 1rem;
}
.video-info h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}
.video-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Dashboard Forms */
.dashboard-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 1rem;
}
.dashboard-form label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}
.dashboard-form input, .dashboard-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    transition: border 0.3s;
}
.dashboard-form input:focus, .dashboard-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Theme Toggle Button Styles */
.theme-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--text-color);
    margin-right: 1rem;
    padding: 0.5rem;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.hide {
    display: none !important;
}

/* Social Media Links in Header */
.social-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
    color: #fff;
    border-color: transparent;
}

/* Individual Colors on Hover */
.social-icon.yt:hover { background: #FF0000; }
.social-icon.wa:hover { background: #25D366; }
.social-icon.ig:hover { 
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); 
}
.social-icon.fb:hover { background: #1877F2; }

/* Responsive for Mobile */
@media (max-width: 768px) {
    .social-links {
        display: none; /* मोबाइल पर स्क्रीन छोटी होने से इन्हें छिपाना ज्यादा अच्छा लगेगा */
    }
}

/* ====== Top Header Spacing & Button Fix ====== */

.top-header {
    display: flex;
    align-items: center;
    gap: 1rem; /* सभी एलिमेंट्स के बीच समान गैप देने के लिए */
    margin-bottom: 2rem;
}

/* Search Bar */
.search-bar {
    flex: 1;
    max-width: 400px;
}
.search-bar input {
    width: 100%;
    padding: 0.7rem 1.2rem;
    border-radius: 30px;
    font-size: 0.9rem;
}

/* Right Side Group (Theme, Social, Profile) */
.top-header > .theme-toggle,
.top-header > .social-links,
.top-header > .user-profile {
    flex-shrink: 0; /* ताकि वे छोटे स्क्रीन पर सिकुड़ें नहीं */
}

/* Theme Toggle Button */
.theme-toggle {
    margin-left: auto; /* इसे दाईं ओर धकेलने के लिए (सर्च बार के तुरंत बाद) */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-right: 0; /* गैप को flex द्वारा मैनेज करेंगे */
}

/* Social Links */
.social-links {
    gap: 0.5rem;
    margin-right: 0 !important; /* पुराना मार्जिन हटाने के लिए */
}

.social-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    padding: 0 !important;
}

/* User Profile */
.user-profile {
    margin-left: 0.5rem; /* प्रोफाइल से पहले थोड़ा और स्पेस */
    position: relative;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--bg-color);
}

/* Mobile View Adjustment - Social Icons Fixed */
@media (max-width: 768px) {
    .top-header {
        flex-wrap: wrap; /* हेडर को 2 लाइनों में बांटने के लिए */
        gap: 0.8rem;
    }
    
    .search-bar {
        order: 2; /* सर्च बार को दूसरी लाइन में भेजने के लिए */
        flex-basis: 100%; /* सर्च बार पूरी चौड़ाई लेगा */
        max-width: 100%;
    }
    
    .menu-toggle {
        order: 0; /* हैम्बर्गर सबसे पहले */
    }
    
    .theme-toggle {
        order: 1; /* थीम और सोशल हैम्बर्गर के बगल में */
        margin-left: auto; /* इन्हें दाईं ओर धकेलने के लिए */
        width: 36px;
        height: 36px;
    }
    
    .social-links {
        display: flex !important; /* मोबाइल पर भी आइकन दिखाने के लिए */
        gap: 0.3rem;
        order: 1;
    }
    
    .social-icon {
        width: 36px !important;
        height: 36px !important;
    }
    
    .user-profile {
        order: 1;
        margin-left: 0;
    }
    .user-profile img {
        width: 36px;
        height: 36px;
    }
}