:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --background: #ffffff;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-primary: #1e293b; /* Added to keep header text consistent */
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0, transparent 50%), 
        radial-gradient(at 100% 0%, rgba(217, 70, 239, 0.1) 0, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--text-main);
}

.topic-search-container {

    width: 60%;
    margin:auto;
    background: var(--card-bg);
    padding: 64px 48px;
    border-radius: 40px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
    position: relative;
    z-index: 10;
    margin-top: 10%;
}

/* Top Navigation Buttons Styles */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.back-btn, .school-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.back-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #e2e8f0;
}

.back-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateX(-4px);
}

.school-mode-btn {
    background: white;
    color: var(--primary);
    border: 2px solid #eef2ff;
    box-shadow: var(--shadow-sm);
}

.school-mode-btn:hover {
    background: #f5f3ff;
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .topic-search-container {
        min-width: 90%;
        margin: auto;
        padding: 20px 16px;
        border-radius: 0;
        box-shadow: none;
    }

    h1 {
        font-size: 1.75rem;
    }

    .desc {
        font-size: 1rem;
        margin-bottom: 28px;
    }

    .top-nav {
        margin-bottom: 20px;
    }

    .back-btn, .school-mode-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .search-input {
        padding: 14px 16px;
        padding-right: 60px;
        font-size: 1rem;
        height: 56px;
    }

    .search-btn {
        width: 48px;
        height: 48px;
        right: 4px;
        font-size: 1.1rem;
        border-radius: 12px;
    }

    .search-input-wrapper {
        margin-bottom: 16px;
    }

    .level-container {
        gap: 8px;
    }

    .level-btn {
        padding: 10px 8px;
        font-size: 0.85rem;
        gap: 5px;
    }

    .selected-topics-section {
        padding: 20px 16px;
    }

    .topics-scroll-container {
        max-height: 350px; /* Shorter scroll container on mobile */
    }

    .mcq-count-controls {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .search-input {
        padding: 12px 14px;
        padding-right: 54px;
        font-size: 0.95rem;
        height: 52px;
    }

    .search-btn {
        width: 44px;
        height: 44px;
        right: 4px;
    }

    .level-container {
        flex-direction: column;
        gap: 10px;
    }

    .level-btn {
        width: 100%;
        padding: 12px;
    }
}

h1 {
    font-size: 3.5rem;
    font-weight: 950;
    color: #0f172a;
    margin-bottom: 20px;
    letter-spacing: -0.05em;
    text-align: center;
    line-height: 1;
}

.desc {
    text-align: center;
    color: #64748b;
    font-size: 1.25rem;
    margin-bottom: 56px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.search-section {
    margin-bottom: 32px;
}

.search-input-wrapper { 
     position: relative; 
     display: flex; 
     align-items: center; 
     gap: 10px; 
     background: #fff; 
     border: 1px solid #d9d9e3; 
     border-radius: 28px; 
     padding: 10px 14px; 
     transition: 0.2s ease; 
 } 
 
 .search-input-wrapper:focus-within { 
     border-color: #b5b5c3; 
     box-shadow: 0 0 0 3px rgba(0,0,0,0.04); 
 } 
 
 .search-input { 
     flex: 1; 
     border: none; 
     outline: none; 
     background: transparent; 
     font-size: 15px; 
     color: #111827; 
 } 
 
 .search-input::placeholder { 
     color: #8e8ea0; 
 } 
 
 /* ChatGPT-like plus upload button */ 
 .file-upload-btn { 
     width: 38px; 
     height: 38px; 
     border: 1px solid #d9d9e3; 
     background: #ffffff; 
     border-radius: 50%; 
     display: flex; 
     align-items: center; 
     justify-content: center; 
     cursor: pointer; 
     transition: all 0.2s ease; 
     color: #555; 
 } 
 
 .file-upload-btn:hover { 
     background: #f3f4f6; 
     transform: scale(1.03); 
 } 
 
 /* Send/Search button */ 
 .search-btn { 
     width: 38px; 
     height: 38px; 
     border: none; 
     background: #111827; 
     color: white; 
     border-radius: 50%; 
     display: flex; 
     align-items: center; 
     justify-content: center; 
     cursor: pointer; 
     transition: 0.2s ease; 
 } 
 
.search-btn:hover {
     opacity: 0.9; 
 }

.topic-suggestions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.14);
    border-radius: var(--radius-md);
}

.topic-suggestions-label {
    color: var(--primary-dark);
    font-size: 0.9rem;
    font-weight: 800;
}

.topic-suggestion-chip {
    border: 1.5px solid rgba(99, 102, 241, 0.28);
    background: #ffffff;
    color: var(--text-main);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.topic-suggestion-chip:hover,
.topic-suggestion-chip.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -12px rgba(99, 102, 241, 0.65);
}

@media (max-width: 768px) {
    .search-input {
        font-size: 14px;
    }

    .topic-suggestions {
        justify-content: flex-start;
    }
}

.level-container {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.level-btn {
    flex: 1;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
}

.level-btn:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    background: white;
    color: var(--primary);
}

.level-btn.selected-easy {
    background: #10b981 !important;
    color: white !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.level-btn.selected-medium {
    background: #f59e0b !important;
    color: white !important;
    border-color: #f59e0b !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.level-btn.selected-hard {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.results-section {
    margin-top: 40px;
    animation: fadeIn 0.5s ease-out;
}

.results-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topics-scroll-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.topics-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.topics-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.topics-scroll-container::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.topics-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.topic-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.topic-item {
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.topic-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.topic-item.selected {
    border-color: var(--primary);
    background: #f5f3ff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.topic-item.selected::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.topic-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.topic-similarity {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    background: #eef2ff;
    padding: 4px 12px;
    border-radius: 100px;
    align-self: flex-start;
}

/* Professional AI Loader Overlay */
.ai-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.98) 0%, rgba(2, 6, 23, 1) 100%);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.ai-loader-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    padding: 60px;
    border-radius: 40px;
    max-width: 550px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 80px rgba(99, 102, 241, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.ai-icon-container {
    font-size: 5rem;
    margin-bottom: 32px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 30px;
    animation: floatingIcon 3s ease-in-out infinite;
}

.ai-icon-glow {
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseGlow 2s ease-in-out infinite;
}

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

@keyframes pulseGlow {
    0%, 100% { transform: scale(0.8); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.6; }
}

.ai-loader-title {
    font-size: 2.25rem;
    font-weight: 900;
    margin-bottom: 40px;
    color: white;
    letter-spacing: -0.05em;
    background: linear-gradient(to right, #fff, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-steps-list {
    text-align: left;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-step {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 24px;
    border-radius: 20px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-step.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    transform: scale(1.02) translateX(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ai-step.completed {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.ai-step-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.ai-step.active .ai-step-icon {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary);
    animation: spinIcon 2s linear infinite;
}

.ai-step.completed .ai-step-icon {
    background: var(--success);
    color: white;
}

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

.ai-step-text {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
}

.ai-step.active .ai-step-text {
    color: white;
}

.ai-step.completed .ai-step-text {
    color: var(--success);
}

.ai-progress-container {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    overflow: hidden;
    padding: 3px;
}

.ai-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #818cf8, #a855f7);
    background-size: 200% 100%;
    width: 0%;
    border-radius: 100px;
    transition: width 0.4s cubic-bezier(0.1, 0.7, 1.0, 0.1);
    animation: shimmerProgress 2s linear infinite;
}

@keyframes shimmerProgress {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

#inlineLoader {
    display: none;
    padding: 60px 0;
    text-align: center;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    margin: 40px 0;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-md);
    animation: loaderFadeIn 0.5s ease;
}

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

#loaderText {
    color: var(--primary);
    font-weight: 900;
    font-size: 1.4rem;
    margin-top: 24px;
    letter-spacing: -0.02em;
}

/* Upgrade Modal Styles */
.upgrade-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    animation: fadeIn 0.3s ease;
}

/* MCQs generation overlay — matches questionPaperFromTopic/finalize_paper.php */
.fp-generation-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .68);
    backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.fp-generation-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.fp-loader-card {
    width: min(390px, 100%);
    padding: 30px 26px 25px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
    text-align: center;
}

.fp-loader-sheet {
    position: relative;
    width: 68px;
    height: 78px;
    margin: 0 auto 19px;
    padding: 18px 13px 10px;
    border: 2px solid var(--secondary, #f97316);
    border-radius: 8px;
    background: #fff;
    box-shadow: 8px 8px 0 var(--primary-light, #c7d2fe);
    animation: fpSheetFloat 2.1s ease-in-out infinite;
}

.fp-loader-sheet span {
    display: block;
    height: 5px;
    margin-bottom: 7px;
    border-radius: 99px;
    background: #e2e8f0;
}

.fp-loader-sheet span:nth-child(2) { width: 78%; }
.fp-loader-sheet span:nth-child(3) { width: 58%; }

.fp-loader-sheet i {
    position: absolute;
    right: -11px;
    bottom: -8px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    background: var(--secondary, #f97316);
    font-size: .75rem;
}

.fp-loader-card h2 {
    margin: 0 0 8px;
    color: var(--text-main, #0f172a);
    font-size: 1.25rem;
    font-weight: 700;
}

.fp-loader-card p {
    max-width: 290px;
    margin: 0 auto 18px;
    color: var(--text-muted, #64748b);
    font-size: .88rem;
    line-height: 1.5;
}

.fp-loader-track {
    height: 6px;
    overflow: hidden;
    border-radius: 99px;
    background: #e2e8f0;
}

.fp-loader-track span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: var(--secondary, #f97316);
    animation: fpLoaderProgress 1.45s ease-in-out infinite;
}

.fp-loader-card small {
    display: block;
    margin-top: 15px;
    color: #64748b;
    font-size: .75rem;
}

.fp-loader-card small i {
    margin-right: 4px;
    color: var(--success, #14b8a6);
}

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

@keyframes fpLoaderProgress {
    0% { transform: translateX(-140%); }
    55%, 100% { transform: translateX(250%); }
}

@media (max-width: 600px) {
    .fp-generation-overlay { padding: 14px; }
    .fp-loader-card { padding: 25px 20px 21px; }
}

.upgrade-modal-card {
    background: white;
    padding: 28px;
    border-radius: 24px;
    max-width: 460px;
    width: min(100%, 460px);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    animation: modalSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.upgrade-modal-icon {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    margin: 0 auto 14px;
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

.upgrade-modal-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 10px;
    letter-spacing: -0.025em;
}

.upgrade-modal-text {
    color: #64748b;
    font-size: 0.98rem;
    line-height: 1.45;
    margin-bottom: 18px;
}

.upgrade-features-list {
    text-align: left;
    background: #f8fafc;
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.upgrade-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #334155;
    font-weight: 600;
    font-size: 0.94rem;
}

.upgrade-feature-item:last-child {
    margin-bottom: 0;
}

.upgrade-feature-item i {
    color: #10b981;
    font-size: 1rem;
}

.upgrade-modal-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-upgrade-now {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    padding: 13px 20px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.98rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-upgrade-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
    color: white;
}

.btn-maybe-later {
    background: transparent;
    color: #94a3b8;
    border: none;
    padding: 12px 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-maybe-later:hover {
    color: #64748b;
}

@media (max-width: 520px) {
    .upgrade-modal-overlay {
        align-items: flex-start;
        padding: 14px;
        overflow-y: auto;
    }

    .upgrade-modal-card {
        width: 100%;
        max-height: calc(100vh - 28px);
        padding: 22px 18px;
        border-radius: 20px;
        margin: auto 0;
    }

    .upgrade-modal-icon {
        width: 48px;
        height: 48px;
        font-size: 1.35rem;
        margin-bottom: 10px;
    }

    .upgrade-modal-title {
        font-size: 1.3rem;
    }

    .upgrade-modal-text {
        font-size: 0.92rem;
        margin-bottom: 14px;
    }

    .upgrade-features-list {
        padding: 12px;
        margin-bottom: 16px;
    }

    .upgrade-feature-item {
        font-size: 0.88rem;
        gap: 8px;
    }

    .upgrade-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-upgrade-now,
    .btn-maybe-later {
        width: 100%;
    }
}

/* Modern Honeycomb Scanning Animation */
.honeycomb {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    height: 40px;
}

.honeycomb div {
    width: 12px;
    height: 32px;
    background: var(--primary);
    border-radius: 100px;
    animation: honeyWave 1.2s ease-in-out infinite;
}

.honeycomb div:nth-child(1) { animation-delay: 0.1s; background: #6366f1; }
.honeycomb div:nth-child(2) { animation-delay: 0.2s; background: #818cf8; }
.honeycomb div:nth-child(3) { animation-delay: 0.3s; background: #a855f7; }
.honeycomb div:nth-child(4) { animation-delay: 0.4s; background: #c084fc; }
.honeycomb div:nth-child(5) { animation-delay: 0.5s; background: #a855f7; }
.honeycomb div:nth-child(6) { animation-delay: 0.6s; background: #818cf8; }
.honeycomb div:nth-child(7) { animation-delay: 0.7s; background: #6366f1; }

@keyframes honeyWave {
    0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

.loader-progress {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 100px;
    margin: 32px auto 0;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    width: 0%;
    border-radius: 100px;
    transition: width 0.4s ease;
    position: relative;
    overflow: hidden;
}

.loader-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loaderShimmer 1.5s infinite;
}

@keyframes loaderShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

/* Selected Topics Section Styles */
.selected-topics-section {
    background: #f8fafc;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 48px;
    transition: all 0.3s ease;
}

.selected-topics-section.empty {
    display: none;
}

.selected-topics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.selected-topics-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.selected-topics-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 8px;
}

.selected-topics-list::-webkit-scrollbar {
    width: 6px;
}

.selected-topics-list::-webkit-scrollbar-track {
    background: transparent;
}

.selected-topics-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.selected-topics-list::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.selected-topic-badge {
    background: white;
    border: 1px solid var(--primary-light);
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    animation: badgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.remove-topic-btn {
    background: #fee2e2;
    color: var(--danger);
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    transition: all 0.2s ease;
}

.remove-topic-btn:hover {
    background: var(--danger);
    color: white;
}

.quiz-config-section {
    background: white;
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.start-quiz-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.start-quiz-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.5);
}

.start-quiz-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
}

.no-selection-hint {
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    padding: 32px;
    font-weight: 600;
    font-size: 1.1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: #f8fafc;
}

.quiz-config-header {
    display: block;
    margin-bottom: 15px;
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.1rem;
    text-align: center;
}

.mcq-count-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 32px;
}

.mcq-count-input {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 900;
    width: 80px;
    border: 2px solid var(--primary);
    border-radius: 15px;
    background: var(--card-bg);
    color: var(--text-main);
    padding: 8px;
    transition: all 0.3s ease;
}

.mcq-count-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.mcq-count-btn {
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    background: white;
    border: 2px solid var(--border);
    color: var(--text-main);
    transition: all 0.2s ease;
}

.mcq-count-btn:hover {
    background: #f8fafc;
    border-color: var(--primary-light);
    color: var(--primary);
}

.level-label {
    display: block;
    margin-bottom: 15px;
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.1rem;
}

.level-error {
    color: var(--danger);
    font-size: 0.95rem;
    margin-top: -10px;
    margin-bottom: 20px;
    font-weight: 700;
    display: none;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.no-topics-hint {
    grid-column: 1/-1;
    text-align: center;
    color: var(--text-muted);
    padding: 48px;
    border: 2px dashed var(--border);
    border-radius: 20px;
    background: #f8fafc;
}

.load-more-btn-container {
    text-align: center;
    margin-top: 48px;
}

#loadMoreTopicsBtn.btn-secondary {
    min-width: 320px;
    padding: 18px 30px !important;
    border-radius: 15px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    background: white !important;
    color: var(--primary) !important;
    border: 2px solid var(--primary-light) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
}

#loadMoreTopicsBtn.btn-secondary:hover {
    background: #f5f3ff !important;
    border-color: var(--primary) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2) !important;
}

#loadMoreTopicsBtn.btn-secondary i {
    font-size: 1.2rem !important;
}

#loadMoreLoader {
    width: 100%;
    max-width: 350px;
    margin: 30px auto;
    display: none;
}

.load-more-text {
    text-align: center;
    margin-top: 15px;
    color: var(--primary);
    font-weight: 800;
    font-size: 1rem;
}

.btn-secondary {
    background: #ffffff;
    color: #475569;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* Enhanced Clear All Button */
.btn-clear-all.btn-secondary {
    padding: 10px 20px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: var(--danger) !important;
    border: 2px solid #fee2e2 !important;
    background: white !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-sm) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    height: auto !important;
    min-height: unset !important;
}

.btn-clear-all.btn-secondary:hover {
    background: #fef2f2 !important;
    border-color: var(--danger) !important;
    color: #b91c1c !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-md) !important;
}

.btn-clear-all.btn-secondary i {
    color: inherit !important;
    font-size: 1rem !important;
}

/* SEO Article Section Layout Fix */
.seo-article-section {
    max-width: 1400px;
    width: 94%;
    margin: 100px auto 140px;
    padding: 0;
}

.seo-section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 56px;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.seo-intro-text {
    text-align: center;
    max-width: 800px;
    margin: -30px auto 60px;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #475569;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.seo-card {
    background: white;
    padding: 40px;
    border-radius: 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    border: 1.5px solid #f1f5f9;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.seo-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 24px 48px rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.seo-icon {
    width: 64px;
    height: 64px;
    background: #f8fafc;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 28px;
    transition: all 0.3s ease;
    color: var(--primary);
}

.seo-card:hover .seo-icon {
    background: var(--primary);
    color: white;
    transform: rotate(-5deg) scale(1.1);
}

.seo-card-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.seo-card-text {
    color: #64748b;
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
}

.seo-footer {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 80px;
    padding: 40px;
    background: #f8fafc;
    border-radius: 24px;
    color: #64748b;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .seo-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .seo-article-section {
        width: 100%;
        margin: 60px auto 100px;
        padding: 0 16px;
    }
    .seo-card {
        padding: 28px 24px;
        border-radius: 24px;
    }
    .seo-section-title {
        font-size: 1.75rem;
        margin-bottom: 32px;
    }

    #loadMoreTopicsBtn.btn-secondary {
        min-width: unset !important;
        width: 100%;
    }
}

/* ================================================================
   TEXT UPLOAD — Trigger Card
   ================================================================ */
.text-upload-trigger {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    margin: 28px 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, rgba(168,85,247,0.06) 100%);
    border: 2px solid #c7d2fe;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.text-upload-trigger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.05), transparent);
    transition: left 0.6s ease;
}

.text-upload-trigger:hover::before {
    left: 100%;
}

.text-upload-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(99,102,241,0.15);
    border-color: #818cf8;
    background: linear-gradient(135deg, rgba(99,102,241,0.07) 0%, rgba(168,85,247,0.10) 100%);
}

.text-upload-trigger-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.text-upload-trigger:hover .text-upload-trigger-icon {
    transform: rotate(-5deg) scale(1.1);
}

.text-upload-trigger-content {
    flex: 1;
}

.text-upload-trigger-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.text-upload-trigger-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.text-upload-trigger-arrow {
    width: 40px;
    height: 40px;
    background: rgba(99,102,241,0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.text-upload-trigger:hover .text-upload-trigger-arrow {
    background: var(--primary);
    color: white;
    transform: translateX(4px);
}

/* ================================================================
   TEXT UPLOAD — Modal
   ================================================================ */
.text-upload-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.text-upload-modal.active {
    opacity: 1;
}

.text-upload-modal-card {
    background: #fff;
    border-radius: 28px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    transform: translateY(30px) scale(0.96);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.text-upload-modal.active .text-upload-modal-card {
    transform: translateY(0) scale(1);
}

.text-upload-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 28px 32px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 28px 28px 0 0;
}

.text-upload-modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-upload-modal-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    margin: 0;
}

.text-upload-close-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.text-upload-close-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg);
}

.text-upload-modal-body {
    padding: 28px 32px;
}

/* File upload (modal) */
.text-upload-file-wrapper {
    margin-bottom: 24px;
    padding: 20px;
    border: 2px dashed var(--border);
    border-radius: 16px;
    background: #f8fafc;
    box-sizing: border-box;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.text-upload-file-wrapper.has-file {
    border-color: #86efac;
    background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 100%);
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.08);
}

.text-upload-file-wrapper.has-error {
    border-color: #fca5a5;
    background: #fff7f7;
}

.text-upload-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.text-upload-file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.text-upload-file-label:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.text-upload-file-meta {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.text-upload-filename {
    font-weight: 600;
    color: var(--text-main);
    word-break: break-all;
    font-size: 0.95rem;
}

.text-upload-file-details {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.text-upload-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.text-upload-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #475569;
    font-size: 0.88rem;
}

.text-upload-status > i { margin-top: 2px; color: #64748b; }
.text-upload-status strong,
.text-upload-status small { display: block; }
.text-upload-status strong { color: #334155; font-weight: 800; }
.text-upload-status small { margin-top: 2px; color: #64748b; line-height: 1.45; }
.text-upload-status.success { border-color: #bbf7d0; background: #f0fdf4; }
.text-upload-status.success > i { color: #16a34a; }
.text-upload-status.success strong { color: #166534; }
.text-upload-status.loading { border-color: #c7d2fe; background: #eef2ff; }
.text-upload-status.loading > i { color: #4f46e5; }
.text-upload-status.loading strong { color: #3730a3; }
.text-upload-status.error { border-color: #fecaca; background: #fef2f2; }
.text-upload-status.error > i { color: #dc2626; }
.text-upload-status.error strong { color: #991b1b; }

/* Config Section */
.text-upload-config {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.text-upload-config-title {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 16px;
}

.text-upload-types {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.text-upload-type-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-upload-type-checkbox:hover {
    border-color: var(--primary-light);
    background: #fafaff;
}

.text-upload-type-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.text-upload-type-label {
    flex: 1;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-upload-type-label.mcq-label { color: var(--primary-dark); }
.text-upload-type-label.short-label { color: #b45309; }
.text-upload-type-label.long-label { color: #b91c1c; }

.text-upload-count-control {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.text-upload-count-control button {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.text-upload-count-control button:hover {
    background: #f1f5f9;
    border-color: var(--primary-light);
    color: var(--primary);
}

.text-upload-count-control input[type="number"] {
    width: 50px;
    height: 32px;
    text-align: center;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-main);
    background: white;
    -moz-appearance: textfield;
}

.text-upload-count-control input[type="number"]::-webkit-inner-spin-button,
.text-upload-count-control input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Error message */
.text-upload-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 16px;
    animation: shake 0.5s ease-in-out;
}

/* Progress */
.text-upload-progress {
    padding: 24px 0;
    text-align: center;
}

.text-upload-progress-bar-track {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 14px;
}

.text-upload-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4f46e5, #818cf8, #a855f7);
    background-size: 200% 100%;
    border-radius: 100px;
    transition: width 0.4s ease;
    animation: shimmerProgress 2s linear infinite;
}

.text-upload-progress-text {
    color: var(--primary);
    font-weight: 800;
    font-size: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Results */
.text-upload-results {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    animation: fadeIn 0.4s ease;
}

.text-results-header {
    font-weight: 900;
    font-size: 1.15rem;
    color: #166534;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-results-header i {
    font-size: 1.3rem;
}

.text-results-summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.text-result-badge {
    padding: 6px 14px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.85rem;
}

.text-result-badge.mcq-badge { background: #eef2ff; color: var(--primary-dark); border: 1px solid #c7d2fe; }
.text-result-badge.short-badge { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.text-result-badge.long-badge { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

.text-results-preview {
    margin-bottom: 20px;
}

.text-preview-section {
    padding: 10px 14px;
    background: white;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.text-preview-section strong {
    color: var(--text-main);
}

.text-upload-submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(16,185,129,0.3);
}

.text-upload-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(16,185,129,0.4);
}

/* Modal Footer */
.text-upload-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 32px 28px;
    border-top: 1px solid var(--border);
}

.text-upload-cancel-btn {
    padding: 12px 24px;
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-upload-cancel-btn:hover {
    background: #e2e8f0;
}

.text-upload-generate-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(99,102,241,0.3);
}

.text-upload-generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(99,102,241,0.4);
}

.text-upload-generate-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
}

/* ================================================================
   TEXT UPLOAD — Mobile Responsive
   ================================================================ */
@media (max-width: 768px) {
    .text-upload-trigger {
        padding: 18px 20px;
        gap: 14px;
        margin: 20px 0;
        border-radius: 16px;
    }

    .text-upload-trigger-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        border-radius: 12px;
    }

    .text-upload-trigger-title {
        font-size: 1rem;
    }

    .text-upload-trigger-desc {
        font-size: 0.82rem;
    }

    .text-upload-trigger-arrow {
        display: none;
    }

    .text-upload-modal {
        padding: 10px;
        align-items: flex-start;
    }

    .text-upload-modal-card {
        border-radius: 20px;
        max-height: 95vh;
    }

    .text-upload-modal-header {
        padding: 20px 20px 16px;
        border-radius: 20px 20px 0 0;
    }

    .text-upload-modal-title {
        font-size: 1.2rem;
    }

    .text-upload-modal-subtitle {
        font-size: 0.85rem;
    }

    .text-upload-modal-body {
        padding: 20px;
    }

    .text-upload-textarea {
        min-height: 150px;
        font-size: 0.95rem;
        padding: 14px 16px;
    }

    .text-upload-config {
        padding: 16px;
    }

    .text-upload-type-checkbox {
        padding: 10px 12px;
        gap: 8px;
    }

    .text-upload-modal-footer {
        padding: 16px 20px 20px;
        flex-direction: column;
    }

    .text-upload-cancel-btn,
    .text-upload-generate-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .text-upload-trigger {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 20px 16px;
    }

    .text-upload-type-checkbox {
        flex-wrap: wrap;
        gap: 8px;
    }

    .text-upload-count-control {
        margin-left: auto;
    }
}
