/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Karla:wght@400;500;600;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette from Design */
    --dark-olive: #2d3517;
    --medium-olive: #50583c;
    --off-white: #f6f9f3;
    --light-sage: #98a284;
    --lime-green: #9eb86b;
    
    /* Additional colors for accents */
    --white: #ffffff;
    --light-gray: #e5e7eb;
    --dark-gray: #1f2937;
    
    /* Shadows */
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Karla', sans-serif;
    line-height: 1.6;
    color: var(--dark-olive);
    background-color: var(--off-white);
    display: flex;
    min-height: 100vh;
}

/* Sidebar Layout */
.sidebar {
    width: 280px;
    background: var(--dark-olive);
    color: var(--off-white);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--medium-olive);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--lime-green);
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

.tagline {
    font-size: 0.85rem;
    color: var(--light-sage);
    font-style: italic;
    margin-left: 2.75rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--medium-olive);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: background 0.3s;
}

.user-profile:hover {
    background: var(--medium-olive);
    opacity: 0.9;
}

.profile-picture {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--lime-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid var(--light-sage);
    overflow: hidden;
}

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

.profile-info {
    flex: 1;
}

.profile-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.profile-level {
    font-size: 0.85rem;
    color: var(--light-sage);
}

.eco-coins {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--medium-olive);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.coin-icon {
    font-size: 1.5rem;
}

.coin-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--lime-green);
}

.sidebar-nav {
    list-style: none;
}

.nav-category {
    margin-bottom: 1.5rem;
}

.nav-category-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--light-sage);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--off-white);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.nav-item a:hover,
.nav-item a.active {
    background: var(--medium-olive);
    color: var(--lime-green);
}

.nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: var(--white);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-olive);
}

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

.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.notification-btn:hover {
    background: var(--light-gray);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--lime-green);
    color: var(--dark-olive);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    display: none;
}

.notification-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 380px;
    max-height: 600px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 0 20px rgba(158, 184, 107, 0.2);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideInRight 0.3s ease;
    border: 2px solid var(--light-gray);
}

.notification-panel.active {
    display: flex;
}

.notification-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--lime-green), var(--medium-olive));
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--light-gray);
}

.notification-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-notifications {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-notifications:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
}

.notification-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.notification-item:hover {
    background: var(--off-white);
}

.notification-item.unread {
    background: rgba(158, 184, 107, 0.1);
    border-left: 4px solid var(--lime-green);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--lime-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-message {
    color: var(--dark-olive);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.notification-time {
    font-size: 0.85rem;
    color: var(--medium-olive);
}

.no-notifications {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--medium-olive);
}

.overdue-task {
    border-left: 4px solid #ef4444;
    animation: pulse 1s ease infinite;
}

.assigned-tasks-section {
    margin-bottom: 2rem;
}

/* Enhanced glow effects */
.dashboard-card,
.challenge-card,
.student-card {
    transition: all 0.3s ease;
}

.dashboard-card:hover,
.challenge-card:hover,
.student-card:hover {
    animation: glow 2s ease-in-out infinite;
}

/* Floating animation for icons */
.card-icon,
.nav-icon {
    animation: float 3s ease-in-out infinite;
}

/* Rotating glow for special elements */
.glow-rotate {
    animation: rotate 20s linear infinite, glow 2s ease-in-out infinite;
}

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--light-gray);
    transition: all 0.3s;
}

.dashboard-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 0 20px rgba(158, 184, 107, 0.2);
    transform: translateY(-5px);
    border-color: var(--lime-green);
    animation: glow 2s ease-in-out infinite;
}

.dashboard-card {
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(158, 184, 107, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.dashboard-card:hover::before {
    opacity: 1;
    animation: rotate 20s linear infinite;
}

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

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-olive);
}

.card-icon {
    font-size: 1.5rem;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--lime-green);
    margin-bottom: 0.5rem;
}

.card-label {
    font-size: 0.9rem;
    color: var(--medium-olive);
}

/* Leaderboard */
.leaderboard-section {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

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

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-olive);
}

.leaderboard-list {
    list-style: none;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    background: var(--off-white);
    transition: all 0.3s;
}

.leaderboard-item:hover {
    background: var(--light-gray);
    transform: translateX(5px);
}

.leaderboard-item.current-user {
    background: var(--lime-green);
    color: var(--dark-olive);
    font-weight: 600;
}

.rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--medium-olive);
    min-width: 40px;
    text-align: center;
}

.rank.gold {
    color: #fbbf24;
}

.rank.silver {
    color: #9ca3af;
}

.rank.bronze {
    color: #cd7f32;
}

.leaderboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--light-sage);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border: 2px solid var(--medium-olive);
    overflow: hidden;
}

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

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.leaderboard-stats {
    font-size: 0.85rem;
    color: var(--medium-olive);
}

.leaderboard-points {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--lime-green);
}

/* Challenges & Quests */
.challenges-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.challenge-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--light-gray);
    transition: all 0.3s;
}

.challenge-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px) scale(1.01);
    border-color: var(--lime-green);
    animation: pulse 0.5s ease;
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.challenge-header [contenteditable="true"] {
    outline: 2px dashed var(--lime-green) !important;
    outline-offset: 2px;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s;
}

.challenge-header [contenteditable="true"]:focus {
    background: var(--off-white);
    outline-color: var(--primary-green);
}

.challenge-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-olive);
}

.challenge-badge {
    background: var(--lime-green);
    color: var(--dark-olive);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.challenge-description {
    color: var(--medium-olive);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.challenge-rewards {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--medium-olive);
}

.reward-amount {
    font-weight: 700;
    color: var(--lime-green);
}

.challenge-progress {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lime-green), var(--light-sage));
    border-radius: 4px;
    transition: width 0.3s;
    animation: shimmer 2s infinite;
    background-size: 200% 100%;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--medium-olive);
    margin-top: 0.5rem;
}

.challenge-actions {
    display: flex;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
    font-family: 'Karla', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--lime-green), var(--medium-olive));
    color: var(--dark-olive);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(158, 184, 107, 0.3);
    transition: all 0.3s;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--medium-olive), var(--lime-green));
    color: var(--white);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(158, 184, 107, 0.5), 0 0 30px rgba(158, 184, 107, 0.3);
    animation: glowPulse 2s ease-in-out infinite;
}

.btn-secondary {
    background: var(--medium-olive);
    color: var(--off-white);
}

.btn-secondary:hover {
    background: var(--dark-olive);
}

.btn-outline {
    background: transparent;
    color: var(--lime-green);
    border: 2px solid var(--lime-green);
}

.btn-outline:hover {
    background: var(--lime-green);
    color: var(--dark-olive);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Photo Upload */
.photo-upload-section {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.upload-area {
    border: 3px dashed var(--light-sage);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--off-white);
}

.upload-area:hover {
    border-color: var(--lime-green);
    background: var(--white);
}

.upload-area.dragover {
    border-color: var(--lime-green);
    background: var(--off-white);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text {
    color: var(--medium-olive);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--light-sage);
}

#photoInput {
    display: none;
}

.uploaded-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--light-gray);
}

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

.photo-points {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: var(--white);
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Login Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-olive);
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    color: var(--medium-olive);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-olive);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Karla', sans-serif;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--lime-green);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn {
    flex: 1;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--medium-olive);
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.modal-close:hover {
    background: var(--light-gray);
}

/* Role Cards */
.role-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--light-gray);
    animation: fadeInUp 0.5s ease;
}

.role-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--lime-green);
}

.role-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.role-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--dark-olive);
    margin-bottom: 0.5rem;
}

.role-card p {
    color: var(--medium-olive);
    font-size: 0.9rem;
}

/* Shop Items */
.shop-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid var(--light-gray);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease;
}

.shop-item:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: var(--shadow-lg);
    border-color: var(--lime-green);
}

.shop-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.shop-item h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--dark-olive);
    margin-bottom: 0.5rem;
}

.shop-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--lime-green);
    margin: 1rem 0;
}

/* Plan Cards */
.plan-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--light-gray);
    transition: all 0.3s ease;
    position: relative;
    animation: fadeInUp 0.6s ease;
}

.plan-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--lime-green);
}

.plan-card.featured-plan {
    border-color: var(--lime-green);
    border-width: 3px;
    transform: scale(1.05);
}

.plan-card.premium-plan {
    border-color: var(--light-sage);
    border-width: 3px;
    background: linear-gradient(135deg, var(--off-white) 0%, var(--white) 100%);
}

.plan-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--lime-green);
    color: var(--dark-olive);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.plan-badge.premium-badge {
    background: linear-gradient(135deg, var(--lime-green), var(--light-sage));
    color: var(--dark-olive);
}

.plan-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--light-gray);
}

.plan-name {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-olive);
    margin-bottom: 1rem;
}

.plan-price {
    margin-bottom: 1rem;
}

.price-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--lime-green);
}

.price-period {
    font-size: 1rem;
    color: var(--medium-olive);
    margin-left: 0.5rem;
}

.plan-description {
    color: var(--medium-olive);
    font-size: 0.95rem;
}

.plan-features {
    list-style: none;
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    color: var(--dark-olive);
    font-size: 0.95rem;
}

.feature-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(158, 184, 107, 0.3), 0 0 40px rgba(158, 184, 107, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(158, 184, 107, 0.6), 0 0 60px rgba(158, 184, 107, 0.3);
    }
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(158, 184, 107, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(158, 184, 107, 0.8)) drop-shadow(0 0 25px rgba(158, 184, 107, 0.4));
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(50px);
    }
}

/* Enhanced Animations */
.dashboard-card,
.challenge-card,
.help-card {
    animation: fadeInUp 0.5s ease;
    animation-fill-mode: both;
}

.dashboard-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-card:nth-child(4) { animation-delay: 0.4s; }

.challenge-card:hover,
.help-card:hover {
    animation: pulse 0.5s ease;
}

/* Mobile Tab Fix */
@media (max-width: 768px) {
    .tab-buttons {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }

    .tab-buttons::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        flex-shrink: 0;
        min-width: 120px;
        white-space: nowrap;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

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

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

    .top-bar {
        padding: 1rem;
    }

    .content-area {
        padding: 1rem;
    }

    .dashboard-grid,
    .challenges-section {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--dark-olive);
    }

    .role-card {
        min-width: 150px;
    }

    .shop-item {
        min-width: 200px;
    }
}

.menu-toggle {
    display: none;
}

/* Mobile Dropdown Menu */
.mobile-nav-dropdown {
    position: relative;
    display: none;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--lime-green);
    color: var(--dark-olive);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.dropdown-toggle:hover {
    background: var(--light-sage);
    transform: scale(1.05);
}

.dropdown-toggle span:first-child {
    font-size: 1.2rem;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 2000;
    display: none;
    animation: slideDown 0.3s ease;
    border: 2px solid var(--light-gray);
}

.dropdown-menu.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-section {
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.dropdown-section:last-child {
    border-bottom: none;
}

.dropdown-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--medium-olive);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--dark-olive);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: var(--off-white);
    transform: translateX(5px);
    color: var(--lime-green);
}

.dropdown-item .nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-nav-dropdown {
        display: block;
    }

    .menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 1500;
    }

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

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

    .top-bar {
        padding: 1rem;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .content-area {
        padding: 1rem;
    }

    .dashboard-grid,
    .challenges-section {
        grid-template-columns: 1fr;
    }

    .dropdown-menu {
        right: 0;
        left: auto;
        max-width: calc(100vw - 2rem);
    }

    .points-display {
        display: none !important;
    }

    select.btn {
        display: none !important;
    }
}

/* Quest System */
.quest-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--lime-green);
    box-shadow: var(--shadow);
}

.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.quest-title {
    font-weight: 600;
    color: var(--dark-olive);
    font-size: 1.1rem;
}

.quest-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.quest-status.active {
    background: var(--lime-green);
    color: var(--dark-olive);
}

.quest-status.completed {
    background: var(--light-sage);
    color: var(--dark-olive);
}

.quest-description {
    color: var(--medium-olive);
    margin-bottom: 1rem;
}

.quest-rewards {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Points Display */
.points-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--lime-green);
}

/* Activity Feed */
.activity-feed {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-sage);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    color: var(--dark-olive);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.85rem;
    color: var(--medium-olive);
}

.activity-points {
    color: var(--lime-green);
    font-weight: 700;
}
