/* ==========================================================================
   SaaSPro Ultra Dashboard Styles
   ========================================================================== */

/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    padding-top: 80px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    position: relative;
    overflow-x: hidden;
}

/* Sidebar Styles */
.dashboard-sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 1.5rem;
    position: fixed;
    left: 0;
    top: 80px;
    bottom: 0;
    z-index: 100;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h5 {
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
}

.sidebar-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--dark-text);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Sidebar Menu */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--dark-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.menu-item i {
    width: 20px;
    margin-right: 12px;
    font-size: 1.1rem;
}

.menu-item span {
    flex: 1;
}

.menu-item:hover {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

.menu-item.active {
    background: rgba(67, 97, 238, 0.2);
    color: var(--primary-color);
    font-weight: 600;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary-color);
    border-radius: 0 3px 3px 0;
}

.menu-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.upgrade-card {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(114, 9, 183, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
}

.upgrade-card h6 {
    color: white;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.upgrade-card .progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    transition: all 0.3s ease;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dashboard-subtitle {
    color: var(--dark-muted);
    font-size: 1.1rem;
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.date-picker .btn {
    padding: 0.5rem 1rem;
    border-radius: 10px;
}

/* Stats Overview */
.stats-overview {
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 30px rgba(67, 97, 238, 0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--dark-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.stat-change.positive {
    color: #10b981;
}

.stat-change.negative {
    color: #ef4444;
}

/* Charts Section */
.charts-section {
    margin-bottom: 2rem;
}

.chart-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s ease;
}

.chart-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.15);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h5 {
    font-weight: 700;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-chart-control {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--dark-muted);
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-chart-control:hover,
.btn-chart-control.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.chart-body {
    height: 300px;
    position: relative;
}

/* Data Section */
.data-section {
    margin-bottom: 2rem;
}

.data-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s ease;
}

.data-card:hover {
    border-color: var(--primary-color);
}

.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-header h5 {
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-body {
    overflow: hidden;
}

/* Table Styles */
.table {
    color: var(--dark-text);
    margin: 0;
}

.table thead th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    color: var(--dark-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table tbody tr:hover {
    background: rgba(67, 97, 238, 0.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(67, 97, 238, 0.2);
}

/* Insights List */
.insights-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insight-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.insight-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.insight-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.insight-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-left-color: #10b981;
}

.insight-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-left-color: #f59e0b;
}

.insight-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-left-color: #3b82f6;
}

.insight-icon.primary {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.insight-content h6 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--dark-text);
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(67, 97, 238, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.action-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.action-btn span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Status Section */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-badge.online i {
    color: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.status-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

.status-icon.online {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-item h6 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Light Mode Styles */
.light-mode .dashboard-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.light-mode .dashboard-sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .sidebar-toggle {
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--light-text);
}

.light-mode .menu-item {
    color: var(--light-muted);
}

.light-mode .menu-item:hover {
    background: rgba(67, 97, 238, 0.05);
    color: var(--primary-color);
}

.light-mode .menu-item.active {
    background: rgba(67, 97, 238, 0.1);
}

.light-mode .sidebar-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .stat-card,
.light-mode .chart-card,
.light-mode .data-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .stat-card:hover,
.light-mode .chart-card:hover,
.light-mode .data-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.1);
}

.light-mode .table thead th {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--light-muted);
}

.light-mode .table tbody tr:hover {
    background: rgba(67, 97, 238, 0.05);
}

.light-mode .insight-item {
    background: rgba(0, 0, 0, 0.02);
}

.light-mode .insight-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.light-mode .action-btn {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--light-text);
}

.light-mode .action-btn:hover {
    background: rgba(67, 97, 238, 0.05);
}

.light-mode .status-item {
    background: rgba(0, 0, 0, 0.02);
}

.light-mode .status-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .dashboard-main {
        margin-left: 0;
        padding: 1.5rem;
    }
    
    .dashboard-sidebar {
        transform: translateX(-100%);
    }
    
    .dashboard-sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        transform: rotate(180deg);
    }
    
    .dashboard-sidebar.active .sidebar-toggle {
        transform: rotate(0);
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .dashboard-title {
        font-size: 2rem;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .dashboard-main {
        padding: 1rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .chart-controls {
        flex-wrap: wrap;
    }
}

/* Loading Animation */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(67, 97, 238, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}