/* Dashboarduser.css - Modern User Dashboard */

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

:root {
    --primary: #5f9df3;
    --primary-dark: #3f7ad0;
    --primary-light: #8bb9ff;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0b0f17;
    --dark-light: #1a1f2e;
    --gray: #9ca3af;
    --light: #f3f4f6;
    --gradient-1: linear-gradient(135deg, #5f9df3, #8b5cf6);
    --gradient-2: linear-gradient(135deg, #f59e0b, #ef4444);
    --gradient-3: linear-gradient(135deg, #10b981, #059669);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(95, 157, 243, 0.3);
}

body {
    font-family: 'Poppins', sans-serif;
    background: radial-gradient(circle at 10% 30%, #1e2b3f, #0b0f17);
    color: #eef5ff;
    line-height: 1.6;
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Background Elements */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(95, 157, 243, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(95, 157, 243, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    background: rgba(95, 157, 243, 0.05);
    border-radius: 50%;
    filter: blur(60px);
    animation: float 20s infinite ease-in-out;
}

.shape1 {
    width: 300px;
    height: 300px;
    top: 10%;
    right: 5%;
    animation-duration: 25s;
}

.shape2 {
    width: 400px;
    height: 400px;
    bottom: -100px;
    left: -50px;
    background: rgba(139, 92, 246, 0.05);
    animation-duration: 30s;
}

.shape3 {
    width: 250px;
    height: 250px;
    top: 50%;
    right: 20%;
    background: rgba(16, 185, 129, 0.05);
    animation-duration: 22s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.1); }
    66% { transform: translate(-20px, 30px) scale(0.9); }
}

/* Navbar */
.head {
    padding: 1rem 2rem;
    background: rgba(10, 20, 35, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(95, 157, 243, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.left {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.left i {
    color: var(--primary);
    background: rgba(95, 157, 243, 0.2);
    padding: 8px;
    border-radius: 12px;
}

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

.right a {
    color: #cddfff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    transition: all 0.3s;
}

.right a:hover {
    background: rgba(95, 157, 243, 0.15);
    color: white;
}

.right a.active {
    background: rgba(95, 157, 243, 0.2);
    color: white;
}

/* Notification Icon */
.notification-icon {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid var(--dark-light);
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 30px;
    transition: all 0.3s;
}

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

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary);
}

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

.dropdown-menu {
    position: absolute;
    top: 120%;
    right: 0;
    background: rgba(10, 20, 35, 0.95);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 0.5rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    box-shadow: var(--shadow-xl);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 1rem;
    color: #cddfff;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s;
}

.dropdown-menu a:hover {
    background: rgba(95, 157, 243, 0.2);
    color: white;
}

.dropdown-menu i {
    width: 20px;
    color: var(--primary);
}

/* Dashboard Main */
.dashboard {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    animation: fadeIn 0.8s ease-out;
}

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

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, rgba(95, 157, 243, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 30px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.welcome-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.welcome-text h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.welcome-subtitle {
    color: var(--gray);
    font-size: 1.1rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(95, 157, 243, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(95, 157, 243, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    border-color: var(--primary);
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.stat-details {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray);
}

.stat-trend {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 3px;
}

.stat-trend.positive {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

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

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
}

.card-header h3 i {
    color: var(--primary);
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.view-all:hover {
    gap: 10px;
}

/* Performance Chart */
.performance-card {
    padding: 1.5rem;
}

.chart-filter {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 0.5rem 1rem;
    color: white;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}

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

/* Recent Quizzes */
.quiz-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quiz-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    transition: all 0.3s;
}

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

.quiz-info h4 {
    margin-bottom: 0.3rem;
}

.quiz-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--gray);
}

.quiz-meta i {
    color: var(--primary);
    margin-right: 3px;
}

.quiz-score {
    text-align: right;
}

.score-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.score-badge.high {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.score-badge.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.score-percent {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
}

/* Achievements */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.badge-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    transition: all 0.3s;
}

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

.badge-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.8rem;
    font-size: 1.5rem;
    color: white;
}

.badge-icon.gold {
    background: linear-gradient(135deg, #fbbf24, #d97706);
}

.badge-icon.silver {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
}

.badge-icon.bronze {
    background: linear-gradient(135deg, #b45309, #92400e);
}

.badge-icon.purple {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.badge-item span {
    font-size: 0.9rem;
    color: var(--gray);
}

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

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

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

.leaderboard-item.current-user {
    background: rgba(95, 157, 243, 0.1);
    border: 1px solid var(--primary);
}

.rank {
    font-weight: 700;
    width: 30px;
    text-align: center;
}

.rank[data-rank="1"] { color: gold; }
.rank[data-rank="2"] { color: silver; }
.rank[data-rank="3"] { color: #cd7f32; }

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

.user-info img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.points {
    font-weight: 600;
    color: var(--primary);
}

/* Upcoming Challenges */
.challenge-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.challenge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    transition: all 0.3s;
}

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

.challenge-info h4 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.challenge-time {
    font-size: 0.85rem;
    color: var(--gray);
}

.btn-remind {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-remind:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Recommended Section */
.recommended-section {
    margin-top: 1.5rem;
}

.recommended-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.recommended-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.recommended-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.recommended-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-2);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
}

.recommended-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.recommended-card p {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.recommended-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--gray);
}

.recommended-meta i {
    color: var(--primary);
    margin-right: 3px;
}

.btn-take {
    width: 100%;
    padding: 0.8rem;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    color: white;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-take:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .recommended-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .welcome-content {
        flex-direction: column;
        text-align: center;
    }
    
    .quick-actions {
        width: 100%;
        justify-content: center;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .recommended-grid {
        grid-template-columns: 1fr;
    }
    
    .right {
        gap: 0.5rem;
    }
    
    .right a span:not(.notification-badge) {
        display: none;
    }
    
    .profile-btn span {
        display: none;
    }
}

@media (max-width: 480px) {
    .welcome-text h1 {
        font-size: 2rem;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}