/**
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 * Todos os direitos reservados
 */

/* CSS Variables - Amazon Orange Palette */
:root {
    --primary-color: #FF9900;
    --secondary-color: #232F3E;
    --accent-color: #37475A;
    --surface-color: #FFFFFF;
    --text-color: #146EB4;
    --primary-hover: color-mix(in srgb, var(--primary-color) 85%, black);
    --primary-light: color-mix(in srgb, var(--primary-color) 15%, white);
    --bg-color: #ffffff;
    --text-muted: color-mix(in srgb, var(--text-color) 60%, transparent);
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --border-radius: 12px;
    --spacing-unit: 8px;
    --transition: all 0.3s ease;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Dark Theme */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --surface-color: #1e1e1e;
        --text-color: #ffffff;
        --text-secondary: #b0b0b0;
        --border-color: #333333;
    }
}

[data-theme="dark"] {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #333333;
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --surface-color: #ffffff;
    --text-color: #146EB4;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
}

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

html {
    font-size: clamp(14px, 2.5vw, 18px);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-top: 60px;
    transition: var(--transition);
    -webkit-overflow-scrolling: touch;
}

/* Header Styles */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-light);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.header-logo h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo i {
    color: var(--primary-color);
}

.desktop-nav {
    display: none;
    gap: 24px;
}

.desktop-nav .nav-link {
    padding: 8px 16px;
    border-radius: var(--border-radius);
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.desktop-nav .nav-link:hover,
.desktop-nav .nav-link.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.header-actions {
    display: flex;
    gap: 16px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 60px);
}

.section {
    display: none;
    min-height: calc(100vh - 60px);
    padding: 20px 0;
}

.section.active {
    display: block;
}

.container {
    max-width: 100%;
    padding: 0 16px;
    margin: 0 auto;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 40px 0;
}

.hero-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 60px;
}

.feature-card {
    background: var(--surface-color);
    padding: 32px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    min-height: 48px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

.btn-secondary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--secondary-color) 85%, black);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: color-mix(in srgb, var(--success-color) 85%, black);
    transform: translateY(-2px);
}

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

.btn-danger:hover:not(:disabled) {
    background: color-mix(in srgb, var(--danger-color) 85%, black);
    transform: translateY(-2px);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* Generator Styles */
.generator-header {
    text-align: center;
    margin-bottom: 40px;
}

.generator-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.progress-bar {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    min-width: 100px;
}

.progress-step.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: var(--transition);
}

.progress-step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.generator-step {
    display: none;
}

.generator-step.active {
    display: block;
}

.step-content {
    background: var(--surface-color);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.step-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-control {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    min-height: 48px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 20%, transparent);
}

.form-control:disabled {
    background: color-mix(in srgb, var(--border-color) 30%, transparent);
    cursor: not-allowed;
}

.form-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow-light);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-light);
}

.range-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.range-labels span:nth-child(2) {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:checked+.checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked+.checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.available-questions {
    background: var(--primary-light);
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    text-align: center;
}

.questions-count {
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.step-actions {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-top: 32px;
}

.generation-summary {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.generation-actions {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 24px;
}

/* History Styles */
.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.history-item {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
}

.history-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.history-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 4px;
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.history-meta {
    display: flex;
    gap: 12px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.history-tag {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.history-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.history-actions .btn {
    flex: 1;
    min-height: 40px;
    font-size: 0.9rem;
}

/* Loading States */
.loading-state {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-content {
    background: var(--surface-color);
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    color: var(--text-color);
}

/* Preview Styles */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.preview-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.preview-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.preview-content {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    min-height: 400px;
    padding: 32px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state h3 {
    margin: 16px 0 8px;
    color: var(--text-color);
}

.empty-state p {
    margin-bottom: 24px;
}

/* Settings Styles */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.settings-card {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.settings-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-stats {
    margin-bottom: 20px;
}

.data-stats p {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.data-stats strong {
    color: var(--text-color);
}

/* FAQ Styles */
.faq-section {
    background: var(--surface-color);
    padding: 60px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}

.faq-section h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--primary-light);
}

.faq-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 20px 20px;
    color: var(--text-secondary);
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
.app-footer {
    background: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
}

.app-footer p {
    margin-bottom: 8px;
}

.b20-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.b20-link:hover {
    text-decoration: underline;
    transform: scale(1.05);
}

.app-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: var(--text-color);
    color: var(--bg-color);
    padding: 12px 24px;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    box-shadow: var(--shadow-medium);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.warning {
    background: var(--warning-color);
    color: var(--text-color);
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.mb-2 {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.mb-3 {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.mb-4 {
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: calc(var(--spacing-unit) * 1);
}

.mt-2 {
    margin-top: calc(var(--spacing-unit) * 2);
}

.mt-3 {
    margin-top: calc(var(--spacing-unit) * 3);
}

.mt-4 {
    margin-top: calc(var(--spacing-unit) * 4);
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: calc(var(--spacing-unit) * 1);
}

.p-2 {
    padding: calc(var(--spacing-unit) * 2);
}

.p-3 {
    padding: calc(var(--spacing-unit) * 3);
}

.p-4 {
    padding: calc(var(--spacing-unit) * 4);
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-1 {
    gap: calc(var(--spacing-unit) * 1);
}

.gap-2 {
    gap: calc(var(--spacing-unit) * 2);
}

.gap-3 {
    gap: calc(var(--spacing-unit) * 3);
}

.gap-4 {
    gap: calc(var(--spacing-unit) * 4);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

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

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* =========================================
   Exercise Preview Styles
   ========================================= */

.exercise-list {
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-small);
    max-width: 900px;
    margin: 0 auto;
}

/* Header Styling */
.list-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.list-header h2 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.list-header h3 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 500;
}

.list-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 5px 0;
}

/* Questions List Styling */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.question-item {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.question-item:hover {
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Old question-number styles removed as it's now integrated */

.question-content {
    flex: 1;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: var(--text-color);
    font-weight: 500;
}

/* Options Styling */
.question-options {
    display: grid;
    gap: 12px;
    margin-left: 5px;
}

.option {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 15px;
    border-radius: 8px;
    background-color: var(--surface-color);
    border: 1px solid transparent;
    transition: background-color 0.2s;
}

.option:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
}

.option strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* Meta Info Styling */
.question-meta {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.meta-difficulty {
    background-color: #e3f2fd;
    color: #1976d2;
}

.meta-topic {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.meta-badge i {
    font-size: 0.9em;
}

/* Answer Key Styling */
.answer-key {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 4px dotted var(--border-color);
    background: #f9f9f9;
    padding: 30px;
    border-radius: var(--border-radius);
}

[data-theme="dark"] .answer-key {
    background: #2a2a2a;
}

.answer-key h3 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.answer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: var(--surface-color);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
}

.answer-item strong {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.answer-item span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .exercise-list {
        padding: 20px;
    }

    .question-item {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }

    .question-number {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .list-header h2 {
        font-size: 1.5rem;
    }

    .list-header h3 {
        font-size: 1.2rem;
    }
}

/* Watermark Styles */
.watermark-top {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: -5px;
    margin-bottom: 15px;
    font-style: italic;
    opacity: 0.7;
}

.watermark-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
    width: 100%;
}

.watermark-bottom a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.watermark-bottom a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Hybrid Generator UI Styles */
.mode-toggle-container {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
}

.btn-group {
    display: inline-flex;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.btn-group .btn {
    border: none;
    border-radius: 0;
    padding: 10px 20px;
}

.btn-group .btn.active {
    background: var(--primary-color);
    color: white;
}

.availability-section {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-top: 25px;
}

.available-info {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-color);
}

.available-info strong {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin: 0 5px;
}

.action-panel {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.add-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.small-input {
    width: 80px !important;
    text-align: center;
}

/* Manual List Styles */
.manual-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
}

.manual-question-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 15px;
    transition: background 0.2s;
}

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

.manual-question-item:hover {
    background: var(--background-color);
}

.manual-question-item.selected {
    background-color: rgba(0, 123, 255, 0.1);
    /* Light blue tint */
    border-left: 3px solid var(--primary-color);
}

[data-theme="dark"] .manual-question-item.selected {
    background-color: rgba(77, 166, 255, 0.15);
}

.q-text-preview {
    font-size: 0.9rem;
    color: var(--text-color);
    flex: 1;
}

.q-meta-badges {
    display: flex;
    gap: 8px;
    margin-top: 5px;
    font-size: 0.75rem;
}

.q-badge {
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    color: #555;
}

/* Composition Summary Bar */
.composition-summary-bar {
    position: sticky;
    bottom: 0;
    background: var(--card-bg);
    /* Use card bg for contrast against main bg */
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 -25px -25px -25px;
    /* Negative margins to stretch inside card padding if needed, or adjust based on container */
    border-radius: 0 0 10px 10px;
    /* Match card radius */
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.summary-info {
    font-size: 1.1rem;
    color: var(--text-color);
}

.summary-info strong {
    color: var(--success-color);
}

.summary-actions {
    display: flex;
    gap: 10px;
}