/**
 * Question Manager App Styles
 * Matching the game's glassmorphism design
 */

/* Main Modal Overlay */
#questionManagerModal {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
}

#questionManagerModal.active {
    display: flex;
}

/* Main Container - Full Screen Glass Panel */
.qm-modal-content {
    width: 100%;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-radius: 0;
    box-shadow: none;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes qmSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.qm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
    color: white;
    flex-shrink: 0;
}

.qm-modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
}

.qm-header-actions {
    display: flex;
    gap: 10px;
}

.qm-header-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qm-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.qm-modal-close {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.qm-modal-close:hover {
    background: rgba(255, 107, 107, 0.8);
    transform: rotate(90deg);
}

/* Tabs */
.qm-tabs {
    display: flex;
    padding: 0 25px;
    border-bottom: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.qm-tab {
    padding: 15px 25px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    color: #64748b;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qm-tab:hover {
    color: #6C5CE7;
}

.qm-tab.active {
    color: #6C5CE7;
}

.qm-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    border-radius: 3px 3px 0 0;
}

/* Dashboard Stats - 2x3 Grid Layout */
.qm-dashboard {
    padding: 15px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 20px;
    align-items: start;
    flex-shrink: 0;
}

/* Column 1: Stats */
.qm-stats-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qm-stats-row {
    display: flex;
    gap: 10px;
}

.qm-stats-row:first-child {
    justify-content: flex-start;
}

.qm-stats-row:last-child {
    justify-content: flex-start;
}

.qm-stat-card {
    background: white;
    padding: 12px 20px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qm-stat-card.islamic {
    flex: 1;
    min-width: 100px;
}

.qm-stat-card.all {
    flex: 1;
    min-width: 100px;
}

.qm-stat-card.total {
    width: 100%;
    background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
    color: white;
}

.qm-stat-card.total .qm-stat-value {
    color: white;
}

.qm-stat-card.total .qm-stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.qm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.qm-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #6C5CE7;
    font-family: 'Fredoka', sans-serif;
}

.qm-stat-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 3px;
    font-weight: 600;
}

/* Column 2: Recent Changes */
.qm-recent-card {
    background: white;
    padding: 12px 18px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    max-height: 120px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.qm-recent-card h4 {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: #475569;
    font-family: 'Fredoka', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.qm-recent-list {
    flex: 1;
    overflow-y: auto;
    font-size: 0.75rem;
}

.qm-recent-empty {
    color: #94a3b8;
    font-style: italic;
}

.qm-recent-item {
    padding: 4px 8px;
    background: #f1f5f9;
    border-radius: 6px;
    margin-bottom: 4px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qm-recent-item .qm-recent-icon {
    font-size: 0.9rem;
}

.qm-recent-item .qm-recent-text {
    flex: 1;
}

.qm-recent-item .qm-recent-time {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Column 3: Actions */
.qm-actions-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qm-actions-row {
    display: flex;
    gap: 8px;
}

.qm-actions-row.import-buttons {
    justify-content: stretch;
}

.qm-action-btn-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #00b894 0%, #55efc4 100%);
    color: white;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

.qm-action-btn-main .qm-btn-icon {
    font-size: 1.2rem;
    font-weight: 800;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.qm-action-btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4);
    animation: pulseAdd 2s ease-in-out infinite;
}

.qm-action-btn-main:active {
    transform: translateY(0);
}

@keyframes pulseAdd {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(0, 184, 148, 0.5);
    }
}

.qm-action-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #64748b;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qm-action-btn-secondary .qm-btn-icon {
    font-size: 0.9rem;
}

.qm-action-btn-secondary:hover {
    border-color: #6C5CE7;
    color: #6C5CE7;
    background: rgba(108, 92, 231, 0.05);
    transform: translateY(-1px);
}

.qm-action-btn-secondary.reset {
    border-color: #fdcb6e;
    color: #d35400;
}

.qm-action-btn-secondary.reset .qm-btn-icon {
    color: #d35400;
}

.qm-action-btn-secondary.reset:hover {
    border-color: #e17055;
    color: #e17055;
    background: rgba(225, 112, 85, 0.1);
}

.qm-action-btn-secondary.folder {
    border-color: #74b9ff;
    color: #0984e3;
}

.qm-action-btn-secondary.folder .qm-btn-icon {
    color: #0984e3;
}

.qm-action-btn-secondary.folder:hover {
    border-color: #0984e3;
    color: #0984e3;
    background: rgba(9, 132, 227, 0.1);
}

.qm-action-btn-secondary.sync {
    border-color: #a29bfe;
    color: #6c5ce7;
}

.qm-action-btn-secondary.sync .qm-btn-icon {
    color: #6c5ce7;
}

.qm-action-btn-secondary.sync:hover {
    border-color: #6c5ce7;
    color: #6c5ce7;
    background: rgba(108, 92, 231, 0.1);
}

.qm-action-btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Search Bar */
.qm-search-bar {
    padding: 15px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.qm-search-bar input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.3s ease;
}

.qm-search-bar input:focus {
    outline: none;
    border-color: #6C5CE7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.qm-search-clear {
    width: 40px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #64748b;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.qm-search-clear:hover {
    background: #ff7675;
    border-color: #ff7675;
    color: white;
}

/* Category Grid */
.qm-category-grid {
    flex: 1;
    min-height: 200px;
    overflow-y: auto;
    padding: 20px 25px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    align-content: start;
}

/* Scrollbar styling */
.qm-category-grid::-webkit-scrollbar {
    width: 8px;
}

.qm-category-grid::-webkit-scrollbar-track {
    background: transparent;
}

.qm-category-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c4b5fd 0%, #a78bfa 100%);
    border-radius: 4px;
}

/* Category Card */
.qm-category-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.qm-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.5s;
}

.qm-category-card:hover::before {
    left: 100%;
}

.qm-category-card:hover {
    border-color: #a78bfa;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(108, 92, 231, 0.2);
}

.qm-category-icon {
    font-size: 2.2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 14px;
}

.qm-category-info {
    flex: 1;
}

.qm-category-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Fredoka', sans-serif;
    margin-bottom: 4px;
}

.qm-category-count {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}

.qm-category-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qm-category-card:hover .qm-category-actions {
    opacity: 1;
}

.qm-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.qm-action-btn.edit {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.qm-action-btn.delete {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
}

.qm-action-btn:hover {
    transform: scale(1.1);
}

/* Empty State */
.qm-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.qm-empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.qm-empty h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    color: #475569;
}

.qm-empty p {
    margin: 0;
    font-size: 1rem;
}

/* Search Results Overlay */
.qm-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 7000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 50px 20px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
}

.qm-search-overlay.active {
    display: flex;
}

.qm-search-content {
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.35),
        0 10px 30px rgba(108, 92, 231, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: qmSlideIn 0.3s ease;
}

.qm-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
    color: white;
    flex-shrink: 0;
}

.qm-search-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.qm-search-count {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-left: 10px;
    font-weight: 600;
}

.qm-search-header .qm-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qm-search-header .qm-close:hover {
    background: rgba(255, 107, 107, 0.8);
    transform: scale(1.1);
}

/* Edit Modal Close Button */
.qm-edit-header .qm-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qm-edit-header .qm-close:hover {
    background: rgba(255, 107, 107, 0.8);
    transform: rotate(90deg);
}

.qm-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.qm-result-group {
    margin-bottom: 25px;
}

.qm-result-group h4 {
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    color: #475569;
}

.qm-result-card {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px 18px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    transition: all 0.3s ease;
}

.qm-result-card:hover {
    border-color: #a78bfa;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.1);
}

.qm-result-text {
    flex: 1;
}

.qm-result-question {
    font-weight: 600;
    color: #1e293b;
    font-family: 'Fredoka', sans-serif;
    margin-bottom: 6px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.qm-result-mode-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.qm-result-answer {
    font-size: 0.9rem;
    color: #059669;
    font-weight: 600;
}

.qm-result-actions {
    display: flex;
    gap: 8px;
}

.qm-result-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.qm-result-btn.edit {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.qm-result-btn.delete {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
}

.qm-result-btn:hover {
    transform: scale(1.05);
}

.qm-search-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.qm-page-btn {
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.3s ease;
}

.qm-page-btn:hover {
    background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
    color: white;
    border-color: transparent;
}

/* Add/Edit Modal */
.qm-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 8000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
}

.qm-edit-modal.active {
    display: flex;
}

.qm-edit-content {
    width: 100%;
    max-width: 550px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.35),
        0 10px 30px rgba(108, 92, 231, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: qmSlideIn 0.3s ease;
}

.qm-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
    color: white;
}

.qm-edit-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
}

.qm-edit-body {
    padding: 25px;
}

.qm-form-group {
    margin-bottom: 20px;
}

.qm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #475569;
    font-family: 'Fredoka', sans-serif;
}

.qm-form-group select,
.qm-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.qm-form-group select:focus,
.qm-form-group textarea:focus {
    outline: none;
    border-color: #6C5CE7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.qm-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.qm-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
}

.qm-cancel-btn {
    padding: 12px 25px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qm-cancel-btn:hover {
    background: #f1f5f9;
}

.qm-save-btn {
    padding: 12px 25px;
    border: none;
    background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
    color: white;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qm-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.35);
}

/* =====================
   QUESTION COUNT HUD PANELS
   ===================== */

.qm-hud-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: 15px;
    flex: 1;
    overflow: hidden;
}

.qm-hud-panel {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    overflow: hidden;
    transition: all 0.3s ease;
}

.qm-hud-red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.25) 100%);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #dc2626;
    animation: hudBlinkRed 2s ease-in-out infinite;
}

.qm-hud-yellow {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.25) 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #d97706;
    animation: hudBlinkYellow 2s ease-in-out infinite;
}

@keyframes hudBlinkRed {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3);
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.25) 100%);
    }
    50% {
        box-shadow: 0 0 10px 2px rgba(239, 68, 68, 0.15);
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.35) 100%);
    }
}

@keyframes hudBlinkYellow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3);
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.25) 100%);
    }
    50% {
        box-shadow: 0 0 10px 2px rgba(245, 158, 11, 0.15);
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(245, 158, 11, 0.35) 100%);
    }
}

.qm-hud-count {
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}

.qm-hud-red .qm-hud-count {
    color: #dc2626;
}

.qm-hud-yellow .qm-hud-count {
    color: #d97706;
}

.qm-hud-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}

.qm-hud-item {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    font-size: 0.6rem;
}

/* =====================
   IMPORT MODAL STYLES
   ===================== */

/* Import Modal Overlay */
#qmImportModal {
    position: fixed;
    inset: 0;
    z-index: 6100;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
}

#qmImportModal.active {
    display: flex;
}

/* Import Modal Content */
.qm-import-modal {
    width: 100%;
    max-width: 600px;
    height: auto;
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: qmImportSlideIn 0.3s ease;
}

@keyframes qmImportSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.qm-import-modal .qm-modal-header {
    flex-shrink: 0;
}

.qm-import-body {
    padding: 20px 25px;
    overflow-y: auto;
    flex: 1;
}

/* Import Tabs */
.qm-import-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.qm-import-tab {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qm-import-tab.active {
    border-color: #6C5CE7;
    background: rgba(108, 92, 231, 0.05);
    color: #6C5CE7;
}

/* File Upload Dropzone */
.qm-import-upload {
    margin-bottom: 15px;
}

.qm-upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.qm-upload-dropzone:hover {
    border-color: #6C5CE7;
    background: rgba(108, 92, 231, 0.05);
}

.qm-upload-dropzone.dragover {
    border-color: #6C5CE7;
    background: rgba(108, 92, 231, 0.1);
    transform: scale(1.02);
}

.qm-upload-dropzone i {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 10px;
}

.qm-upload-dropzone p {
    margin: 0;
    color: #475569;
    font-weight: 600;
    font-size: 1rem;
}

.qm-upload-dropzone span {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Paste Content Area */
.qm-import-paste textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.qm-import-paste textarea:focus {
    outline: none;
    border-color: #6C5CE7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

/* Import Status */
.qm-import-status {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    display: none;
}

.qm-import-status.detected {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(108, 92, 231, 0.1);
    color: #6C5CE7;
    border: 1px solid rgba(108, 92, 231, 0.2);
}

.qm-import-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Category Selector */
.qm-import-category {
    margin-bottom: 15px;
}

.qm-import-category label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 600;
}

.qm-category-selectors {
    display: flex;
    gap: 10px;
}

.qm-category-selectors select {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qm-category-selectors select:focus {
    outline: none;
    border-color: #6C5CE7;
}

.qm-category-selectors select:first-child {
    flex: 0 0 140px;
}

/* Import Mode Options */
.qm-import-mode {
    margin-bottom: 15px;
}

.qm-import-mode label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 600;
}

.qm-import-mode-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qm-radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qm-radio-option:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.qm-radio-option input:checked + span {
    color: #6C5CE7;
    font-weight: 600;
}

.qm-radio-option:has(input:checked) {
    border-color: #6C5CE7;
    background: rgba(108, 92, 231, 0.05);
}

.qm-radio-option input {
    accent-color: #6C5CE7;
}

/* Preview Section */
.qm-import-preview {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
}

.qm-import-preview h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #475569;
    font-family: 'Fredoka', sans-serif;
}

.qm-import-preview h4 span {
    color: #94a3b8;
    font-weight: 400;
}

.qm-preview-list {
    max-height: 150px;
    overflow-y: auto;
}

.qm-preview-empty {
    color: #94a3b8;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.qm-preview-item {
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.8rem;
}

.qm-preview-item:last-child {
    margin-bottom: 0;
}

.qm-preview-item .qm-preview-q {
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qm-preview-item .qm-preview-a {
    color: #6C5CE7;
}

/* Import Button */
.qm-import-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
    color: white;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.qm-import-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
}

.qm-import-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Footer */
.qm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 15px 25px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.qm-modal-footer .qm-cancel-btn {
    padding: 12px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #64748b;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qm-modal-footer .qm-cancel-btn:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}
