/* ===== Feature CSS Additions ===== */

/* ===== Dark Mode (Feature 8) ===== */
.dark-mode {
    color-scheme: dark;
}

.dark-mode body,
.dark-mode .bg-gray-50,
body.dark-mode {
    background-color: #0f0f1a !important;
    color: #e2e8f0 !important;
}

.dark-mode #app-header,
.dark-mode .bg-white {
    background-color: #1a1a2e !important;
    color: #e2e8f0 !important;
}

.dark-mode #bottom-nav {
    background-color: #1a1a2e !important;
    border-color: #2a2a3e !important;
}

.dark-mode .bg-gray-100 {
    background-color: #252538 !important;
}

.dark-mode .bg-gray-50,
.dark-mode .bg-gray-100 {
    background-color: #1e1e32 !important;
}

.dark-mode .text-gray-900,
.dark-mode .text-dark {
    color: #e2e8f0 !important;
}

.dark-mode .text-gray-600,
.dark-mode .text-gray-700 {
    color: #a0aec0 !important;
}

.dark-mode .text-gray-500 {
    color: #8b94a6 !important;
}

.dark-mode .text-gray-400 {
    color: #6b7280 !important;
}

.dark-mode .border-gray-100,
.dark-mode .border-gray-200 {
    border-color: #2a2a3e !important;
}

.dark-mode input,
.dark-mode textarea,
.dark-mode select {
    background-color: #252538 !important;
    color: #e2e8f0 !important;
    border-color: #3a3a4e !important;
}

.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
    color: #6b7280 !important;
}

.dark-mode .question-card-inner {
    background: #1a1a2e !important;
    border-color: #2a2a3e !important;
}

.dark-mode .question-card-inner.correct {
    background: linear-gradient(135deg, #0a2e1f, #0d3627) !important;
    border-color: #2E7D32 !important;
}

.dark-mode .question-card-inner.partial {
    background: linear-gradient(135deg, #2e2500, #362d00) !important;
    border-color: #FFD700 !important;
}

.dark-mode .question-card-inner.wrong {
    background: linear-gradient(135deg, #2e0a13, #360d17) !important;
    border-color: #B5432A !important;
}

.dark-mode .question-text {
    color: #e2e8f0 !important;
}

.dark-mode .answer-box {
    background: linear-gradient(135deg, #1e1e3a, #252548) !important;
}

.dark-mode .explanation-box {
    background: #2a2518 !important;
}

.dark-mode .rating-btn {
    background: #1e1e32 !important;
    border-color: #3a3a4e !important;
}

.dark-mode .rating-btn.correct { 
    background: #0a2e1f !important; 
    border-color: #2E7D32 !important;
}
.dark-mode .rating-btn.partial { 
    background: #2e2500 !important; 
    border-color: #FFD700 !important;
}
.dark-mode .rating-btn.wrong { 
    background: #2e0a13 !important; 
    border-color: #B5432A !important;
}

.dark-mode .draft-card,
.dark-mode .quiz-manage-card,
.dark-mode .user-card {
    background: #1a1a2e !important;
    border-color: #2a2a3e !important;
}

.dark-mode .ai-suggestion {
    background: linear-gradient(135deg, #1e1e3a, #252548) !important;
    border-color: #3a3a5e !important;
}

.dark-mode .compose-q-item {
    background: #1a1a2e !important;
    border-color: #2a2a3e !important;
}

.dark-mode .shadow-sm,
.dark-mode .shadow-2xl {
    box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
}

.dark-mode .result-item {
    background: #1e1e32 !important;
}

.dark-mode .podium-name {
    color: #e2e8f0 !important;
}

.dark-mode #user-menu {
    background-color: #1a1a2e !important;
    border-color: #2a2a3e !important;
}

.dark-mode #auth-modal-content,
.dark-mode #quick-add-modal .bg-white {
    background-color: #1a1a2e !important;
}

.dark-mode #toast > div {
    background: #252538 !important;
}

/* Dark mode toggle button */
#dark-mode-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #6b7280;
    transition: all 0.3s;
}

#dark-mode-toggle:hover {
    background: rgba(108, 99, 255, 0.1);
    color: #1B3A5C;
}

.dark-mode #dark-mode-toggle {
    color: #FFD700;
}

.dark-mode #dark-mode-toggle:hover {
    background: rgba(255, 193, 7, 0.1);
}

/* ===== Notification Banner (Feature 2) ===== */
.quiz-notification {
    position: fixed;
    top: -200px;
    left: 16px;
    right: 16px;
    max-width: 480px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(108, 99, 255, 0.1);
    z-index: 80;
    transition: top 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    overflow: hidden;
}

.quiz-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1B3A5C, #C9A84C, #FFD700);
}

.quiz-notification.show {
    top: 80px;
}

.quiz-notification.hide {
    top: -200px;
    opacity: 0;
}

.notif-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 8px;
}

.notif-icon {
    font-size: 32px;
    animation: float 2s ease-in-out infinite;
}

.notif-text {
    flex: 1;
}

.notif-title {
    font-weight: 700;
    font-size: 15px;
    color: #1A1A2E;
}

.notif-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

.notif-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: all 0.2s;
}

.notif-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.notif-actions {
    display: flex;
    gap: 8px;
    padding: 8px 16px 16px;
}

.notif-btn-play {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, #1B3A5C, #2A5580);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Heebo', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.notif-btn-play:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.notif-btn-later {
    padding: 10px 20px;
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    border-radius: 12px;
    font-family: 'Heebo', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.notif-btn-later:hover {
    background: #e5e7eb;
}

.dark-mode .quiz-notification {
    background: #1a1a2e;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.dark-mode .notif-title { color: #e2e8f0; }
.dark-mode .notif-subtitle { color: #8b94a6; }
.dark-mode .notif-close { background: #252538; color: #6b7280; }
.dark-mode .notif-btn-later { background: #252538; color: #8b94a6; }

/* ===== Share Modal (Feature 9) ===== */
.share-platform-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: none;
    background: none;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: 'Heebo', sans-serif;
    color: #374151;
}

.share-platform-btn:hover {
    transform: translateY(-3px);
}

.share-platform-btn:active {
    transform: scale(0.95);
}

.share-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s;
}

.share-platform-btn:hover .share-icon {
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.dark-mode .share-platform-btn { color: #e2e8f0; }

/* ===== Media Preview (Feature 6) ===== */
.media-preview-container {
    display: none;
    margin-top: 8px;
}

.media-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #E5E7EB;
}

.media-preview-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.media-preview-close:hover {
    background: rgba(0,0,0,0.8);
}

/* ===== Install Banner (Feature 3) ===== */
.install-banner {
    position: fixed;
    bottom: -100px;
    left: 16px;
    right: 16px;
    max-width: 480px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 55;
    transition: bottom 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.install-banner.show {
    bottom: 90px;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.dark-mode .install-banner {
    background: #1a1a2e;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

/* ===== Analytics Chart Animation ===== */
@keyframes growUp {
    from { height: 0 !important; opacity: 0; }
    to { opacity: 1; }
}

/* ===== Admin Analytics Tab ===== */
.analytics-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.dark-mode .analytics-card {
    background: #1a1a2e;
}

/* ===== Session Info ===== */
.session-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #9ca3af;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 8px;
    margin-top: 4px;
}

.dark-mode .session-info {
    background: #252538;
    color: #6b7280;
}

/* ===== Duplicate Warning ===== */
.duplicate-warning {
    background: #FFF3E0;
    border: 1px solid #FFE0B2;
    border-radius: 12px;
    padding: 12px;
    font-size: 13px;
    color: #E65100;
    margin-top: 8px;
}

.dark-mode .duplicate-warning {
    background: #2a2518;
    border-color: #3a3528;
}

/* ===== Image Upload (New Feature) ===== */
.upload-area {
    position: relative;
    transition: all 0.3s;
}

.upload-area.drag-over {
    border-color: #1B3A5C !important;
    background: rgba(108, 99, 255, 0.08) !important;
    transform: scale(1.01);
}

#draft-upload-label,
#manual-upload-label {
    min-height: 48px;
    transition: all 0.3s;
}

#draft-upload-label:hover,
#manual-upload-label:hover {
    border-color: #1B3A5C;
    background: rgba(108, 99, 255, 0.05);
}

.dark-mode #draft-upload-label,
.dark-mode #manual-upload-label {
    border-color: #3a3a4e;
    color: #8b94a6;
}

.dark-mode #draft-upload-label:hover,
.dark-mode #manual-upload-label:hover {
    border-color: #1B3A5C;
    background: rgba(108, 99, 255, 0.1);
}

/* ===== User Edit Modal ===== */
#user-edit-modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.dark-mode #user-edit-modal-content {
    background-color: #1a1a2e !important;
}

/* Clickable user card indicator */
.user-card {
    transition: all 0.2s;
}
.user-card:hover {
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ===== Registration CTA ===== */
#home-register-cta {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(108, 99, 255, 0); }
}

#home-register-cta {
    animation: gentlePulse 3s ease-in-out infinite;
}
