/* ===== MODERN DASHBOARD STYLES ===== */

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

:root {
    --primary-blue: #0084ff;
    --secondary-blue: #00d4ff;
    --dark-bg: #000000;
    --dark-card: #0f0f0f;
    --dark-accent: #1a1a1a;
    --sidebar-bg: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: rgba(255, 255, 255, 0.1);
    --gradient-1: linear-gradient(135deg, #0084ff 0%, #00d4ff 100%);
    --gradient-2: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-3: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-4: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-glow: 0 0 30px rgba(0, 132, 255, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: var(--dark-bg);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 0 2rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-header {
    padding: 0 1.5rem 2rem;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.logo i {
    font-size: 1.8rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo span {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar-toggle {
    background: rgba(0, 132, 255, 0.1);
    border: 1px solid rgba(0, 132, 255, 0.3);
    color: var(--secondary-blue);
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .sidebar-toggle {
    display: none;
}

.sidebar-toggle:hover {
    background: rgba(0, 132, 255, 0.2);
}

.sidebar-menu {
    list-style: none;
    padding: 2rem 0;
}

.menu-item {
    margin-bottom: 0.5rem;
    padding: 0 2rem;
}

.sidebar.collapsed .menu-item {
    padding: 0 1.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    font-weight: 500;
    border-radius: 8px;
    padding-left: 1rem;
    padding-right: 1rem;
}

.sidebar.collapsed .menu-link {
    padding: 1rem 0.5rem;
    justify-content: center;
}

.menu-link:hover {
    background: rgba(0, 132, 255, 0.05);
    color: var(--text-primary);
}

.menu-link.active {
    background: linear-gradient(90deg, rgba(0, 132, 255, 0.2) 0%, transparent 100%);
    color: var(--secondary-blue);
}

.menu-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--gradient-1);
}

.menu-link i {
    font-size: 1.4rem;
    min-width: 24px;
}

.sidebar.collapsed .menu-link span {
    display: none;
}

.menu-badge {
    background: var(--gradient-1);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: auto;
    font-weight: 700;
}

.sidebar.collapsed .menu-badge {
    display: none;
}

.sidebar-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-footer {
    padding: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.sidebar.collapsed .user-info {
    display: none;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.logout-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.8rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.sidebar.collapsed .logout-btn {
    padding: 0.8rem;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    max-height: 500px;
    overflow-y: auto;
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.98) 0%, rgba(15, 15, 30, 0.98) 100%);
    border: 1px solid rgba(0, 132, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    backdrop-filter: blur(20px);
}

.notification-dropdown::-webkit-scrollbar {
    width: 6px;
}

.notification-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0, 132, 255, 0.3);
    border-radius: 10px;
}

.notification-dropdown::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.notification-dropdown.show {
    display: block;
}

.notification-item {
    display: flex;
    align-items: start;
    gap: 15px;
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.notification-item:hover {
    background: rgba(0, 132, 255, 0.15);
    border-color: rgba(0, 132, 255, 0.4);
    transform: translateX(-5px);
}

.notification-item.unread {
    background: rgba(0, 132, 255, 0.1);
    border: 1px solid rgba(0, 132, 255, 0.3);
}

.notification-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-content h4 {
    font-size: 1rem;
    color: white;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.4;
}

.notification-content p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.notification-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
    font-style: italic;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 132, 255, 0.2);
}

.notification-header h3 {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.mark-all-read {
    background: rgba(0, 132, 255, 0.15);
    border: 1px solid rgba(0, 132, 255, 0.4);
    color: #00d4ff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.mark-all-read:hover {
    background: rgba(0, 132, 255, 0.25);
    border-color: rgba(0, 132, 255, 0.6);
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    border-radius: 50%;
    border: 2px solid var(--dark-card);
    display: none;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.notification-badge.show {
    display: block;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 280px;
    transition: var(--transition);
    background: var(--dark-bg);
}

.sidebar.collapsed ~ .main-content {
    margin-left: 80px;
}

/* ===== TOPBAR ===== */
.topbar {
    background: var(--dark-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.topbar-left h1 {
    font-size: 2rem;
    color: white;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #00d4ff;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 0.8rem 3rem 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    width: 300px;
    font-family: 'Inter', sans-serif;
    color: white;
    transition: var(--transition);
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-box input:focus {
    outline: none;
    border-color: #0084ff;
    background: rgba(0, 132, 255, 0.05);
    box-shadow: 0 0 20px rgba(0, 132, 255, 0.1);
}

.search-box i {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

.notification-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid rgba(0, 132, 255, 0.6);
    background: rgba(0, 132, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: #0084ff;
    position: relative;
}

.notification-btn:hover {
    background: rgba(0, 132, 255, 0.2);
    border-color: #0084ff;
    color: #00d4ff;
    transform: scale(1.05);
}

/* ===== DASHBOARD CONTENT ===== */
.dashboard-content {
    padding: 3rem;
}

/* Chart Canvas Styling */
canvas {
    max-width: 100%;
}

#scoreTrendChart {
    width: 100% !important;
    height: 100% !important;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover::before {
    opacity: 0.05;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 132, 255, 0.5);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    position: relative;
    z-index: 1;
}

.stat-icon.primary {
    background: var(--gradient-1);
}

.stat-icon.success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.stat-icon.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.stat-icon.info {
    background: var(--gradient-2);
}

.stat-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-change {
    font-size: 0.9rem;
    margin-top: 0.7rem;
    font-weight: 600;
}

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

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

/* ===== CONTENT GRID ===== */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 20px;
    transition: var(--transition);
}

.dashboard-card:hover {
    border-color: rgba(0, 132, 255, 0.3);
}

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

.card-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.card-action {
    color: var(--secondary-blue);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
}

.card-action:hover {
    color: var(--primary-blue);
}

/* ===== MOBILE SIDEBAR TOGGLE ===== */
.mobile-menu-toggle {
    display: none;
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1100;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ===== TIPS GRID ===== */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.tip-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    transition: var(--transition);
}

.tip-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 132, 255, 0.5);
}

.tip-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 1.5rem;
}

.tip-card h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tip-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.tip-impact {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.impact-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.impact-bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--gradient-1);
    border-radius: 10px;
}

.impact-bar.high::before {
    width: 90%;
}

.impact-bar.medium::before {
    width: 60%;
}

.impact-bar.low::before {
    width: 30%;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .search-box input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .topbar {
        padding: 1.5rem 1.5rem 1.5rem 5rem;
    }

    .topbar-left h1 {
        font-size: 1.5rem;
    }

    .search-box {
        display: none;
    }

    .dashboard-content {
        padding: 1.5rem;
    }

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