/* Teacher Achievements & Gamification Styles */

/* Badge Notification Toast */
.badge-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.badge-notification.show {
    transform: translateX(0);
}

.badge-notification-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: celebrate 0.6s ease-out;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.badge-notification-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.badge-notification-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.badge-notification-title {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-notification-name {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.badge-notification-xp {
    font-size: 14px;
    font-weight: 600;
    color: #22c55e;
}

/* Achievements Display Panel */
.achievements-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.level-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.level-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.level-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.xp-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.xp-value {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.xp-bar {
    width: 100px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

/* Badges Summary */
.badges-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.badges-count {
    font-size: 13px;
    color: #4b5563;
}

.streak-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #ef4444;
}

.streak-display i {
    animation: flicker 1.5s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Badges Grid */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 12px;
    transition: all 0.2s;
    cursor: default;
}

.badge-item.unlocked {
    background: #f0fdf4;
}

.badge-item.locked {
    opacity: 0.5;
}

.badge-item:hover {
    transform: translateY(-2px);
}

.badge-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.badge-name {
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    text-align: center;
    line-height: 1.2;
}

/* Compact Badge Display for Sidebar */
.achievements-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.achievements-compact:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.achievements-compact .level-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.achievements-compact .compact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.achievements-compact .compact-level {
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
}

.achievements-compact .compact-xp {
    font-size: 11px;
    color: #b45309;
}

.achievements-compact .compact-streak {
    font-size: 14px;
    color: #ef4444;
}

/* Dark Mode Support */
body.dark-mode .badge-notification-content {
    background: #1f2937;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode .badge-notification-title {
    color: #9ca3af;
}

body.dark-mode .badge-notification-name {
    color: #f9fafb;
}

body.dark-mode .achievements-header {
    border-color: #374151;
}

body.dark-mode .level-name {
    color: #d1d5db;
}

body.dark-mode .xp-value {
    color: #9ca3af;
}

body.dark-mode .xp-bar {
    background: #374151;
}

body.dark-mode .badges-count {
    color: #9ca3af;
}

body.dark-mode .badge-item.unlocked {
    background: #064e3b;
}

body.dark-mode .badge-name {
    color: #d1d5db;
}

body.dark-mode .achievements-compact {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    border-color: #f59e0b;
}

body.dark-mode .achievements-compact .compact-level {
    color: #fde68a;
}

body.dark-mode .achievements-compact .compact-xp {
    color: #fcd34d;
}

/* Achievement Modal */
.achievements-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.achievements-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.achievements-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 1px solid #f59e0b;
}

.achievements-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 10px;
}

.achievements-modal-header h3 i {
    color: #f59e0b;
}

.achievements-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    cursor: pointer;
    color: #92400e;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.achievements-modal-close:hover {
    background: white;
}

.achievements-modal-content {
    padding: 20px 24px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.achievements-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.stat-label {
    font-size: 12px;
    color: #4b5563;
}

/* Dark mode modal */
body.dark-mode .achievements-modal {
    background: #1f2937;
}

body.dark-mode .achievements-modal-header {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    border-color: #b45309;
}

body.dark-mode .achievements-modal-header h3 {
    color: #fde68a;
}

body.dark-mode .achievements-modal-close {
    background: rgba(0, 0, 0, 0.2);
    color: #fde68a;
}

body.dark-mode .achievements-modal-close:hover {
    background: rgba(0, 0, 0, 0.3);
}

body.dark-mode .achievements-stats {
    border-color: #374151;
}

body.dark-mode .stat-value {
    color: #f9fafb;
}

body.dark-mode .stat-label {
    color: #9ca3af;
}

/* Responsive */
@media (max-width: 480px) {
    .badge-notification {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .badge-notification-content {
        padding: 12px 16px;
    }

    .badge-notification-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .badges-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .badge-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .badge-name {
        font-size: 10px;
    }
}
