/* Admin Agentic Paper Generator - Two-Column Layout */

.agentic-paper-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Page header - spans full width */
.agentic-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.agentic-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.agentic-header h1 i {
    color: #10b981;
    margin-right: 0.5rem;
}

.agentic-header p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

/* Two-column grid */
.agentic-columns {
    display: grid;
    grid-template-columns: minmax(380px, 480px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Left column: config */
.agentic-col-config {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Right column: results (sticky) */
.agentic-col-results {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.agentic-col-results::-webkit-scrollbar {
    width: 6px;
}

.agentic-col-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Access denied */
.access-denied {
    text-align: center;
    padding: 4rem 2rem;
    color: #dc2626;
}

.access-denied i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Config panel - compact for left column */
.config-panel {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.config-panel h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.config-panel h3 i {
    color: #10b981;
    margin-right: 0.4rem;
    font-size: 0.85rem;
}

.subsection-heading {
    margin-top: 1.25rem !important;
}

.panel-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.config-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.config-field {
    flex: 1;
    min-width: 0;
}

.config-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.3rem;
}

.config-field input[type="number"],
.config-field select {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s;
}

.config-field input:focus,
.config-field select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Paper type cards - compact grid */
.paper-type-cards {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.paper-type-card {
    flex: 1;
    min-width: 140px;
    padding: 0.9rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.paper-type-card:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.paper-type-card.active {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.paper-type-card h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.35rem;
}

.paper-type-card h4 i {
    color: #10b981;
    margin-right: 0.3rem;
}

.pt-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pt-specs span {
    font-size: 0.72rem;
    color: #64748b;
}

.pt-specs i {
    color: #10b981;
    margin-right: 0.2rem;
}

.pt-sections {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pt-section {
    font-size: 0.72rem;
    color: #475569;
    padding: 0.15rem 0.4rem;
    background: #f8fafc;
    border-radius: 4px;
    border-left: 2px solid #10b981;
}

/* Template info panel */
.template-info h3 {
    color: #059669;
}

.template-info h3 i {
    margin-right: 0.4rem;
}

.template-specs {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.ts-item {
    font-size: 0.85rem;
    color: #1e293b;
    font-weight: 500;
}

.ts-item i {
    color: #10b981;
    margin-right: 0.3rem;
}

.template-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
}

.template-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.template-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

.topic-weights {
    font-size: 0.8rem;
    color: #475569;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tw-chip {
    padding: 0.15rem 0.5rem;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #d1fae5;
    border-radius: 12px;
    font-size: 0.72rem;
    color: #059669;
    font-weight: 500;
}

/* Topic chips */
.topic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.topic-chip {
    padding: 0.3rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    color: #475569;
    user-select: none;
}

.topic-chip:hover {
    border-color: #10b981;
    color: #10b981;
}

.topic-chip.selected {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

/* Difficulty sliders */
.difficulty-sliders {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.difficulty-slider {
    flex: 1;
    min-width: 100px;
}

.difficulty-slider label {
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.2rem;
}

.difficulty-slider input[type="range"] {
    width: 100%;
    accent-color: #10b981;
}

/* Question type checkboxes */
.type-checks {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.type-check {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #475569;
    cursor: pointer;
}

.type-check input[type="checkbox"] {
    accent-color: #10b981;
}

/* Generate button */
.generate-btn {
    display: block;
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.25rem;
}

.generate-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.generate-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.generate-btn i {
    margin-right: 0.5rem;
}

/* Results placeholder (before generation) */
.results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: #fff;
    border-radius: 10px;
    border: 2px dashed #e2e8f0;
    text-align: center;
    min-height: 300px;
}

.results-placeholder i {
    font-size: 2.5rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.results-placeholder p {
    font-size: 0.9rem;
    color: #94a3b8;
    max-width: 280px;
    line-height: 1.5;
}

/* Progress tracker */
.progress-tracker {
    display: none;
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.progress-tracker.visible {
    display: block;
}

.progress-tracker.visible + .paper-preview + .results-placeholder,
.progress-tracker.visible ~ .results-placeholder {
    display: none;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 0.75rem;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 30px;
    right: 30px;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 0.35rem;
    transition: all 0.3s;
}

.progress-step.active .step-circle {
    background: #10b981;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    animation: pulse-step 1.5s ease-in-out infinite;
}

.progress-step.completed .step-circle {
    background: #10b981;
    color: #fff;
}

.progress-step.failed .step-circle {
    background: #dc2626;
    color: #fff;
}

@keyframes pulse-step {
    0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.1); }
}

.step-label {
    font-size: 0.68rem;
    color: #64748b;
    text-align: center;
}

.progress-step.active .step-label {
    color: #10b981;
    font-weight: 600;
}

.progress-message {
    text-align: center;
    font-size: 0.85rem;
    color: #475569;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

/* Paper preview */
.paper-preview {
    display: none;
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.paper-preview.visible {
    display: block;
}

.paper-preview.visible ~ .results-placeholder {
    display: none;
}

.preview-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.preview-title i {
    color: #10b981;
    margin-right: 0.4rem;
}

.paper-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    padding: 0.75rem 0.5rem;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-radius: 8px;
    text-align: center;
    border: 1px solid #d1fae5;
}

.stat-card .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #059669;
}

.stat-card .stat-label {
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 0.15rem;
}

/* Coverage bars */
.coverage-section {
    margin-bottom: 1.25rem;
}

.coverage-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.coverage-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.coverage-label {
    font-size: 0.75rem;
    color: #475569;
    min-width: 140px;
}

.coverage-track {
    flex: 1;
    height: 7px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.coverage-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.coverage-count {
    font-size: 0.75rem;
    color: #64748b;
    min-width: 20px;
    text-align: right;
}

/* Section header in question preview */
.section-header-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-bottom: 2px solid #10b981;
    font-weight: 600;
}

.section-name {
    font-size: 0.85rem;
    color: #059669;
}

.section-count {
    font-size: 0.72rem;
    color: #64748b;
}

/* Question list preview */
.question-list-preview {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.question-preview-item {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.question-preview-item:last-child {
    border-bottom: none;
}

.q-num {
    font-weight: 600;
    color: #10b981;
    font-size: 0.8rem;
    min-width: 26px;
}

.q-text {
    flex: 1;
    font-size: 0.8rem;
    color: #1e293b;
    line-height: 1.4;
}

.q-meta {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.q-badge {
    font-size: 0.65rem;
    padding: 0.12rem 0.4rem;
    border-radius: 10px;
    font-weight: 500;
}

.q-badge.easy { background: #dcfce7; color: #16a34a; }
.q-badge.medium { background: #fef9c3; color: #ca8a04; }
.q-badge.hard { background: #fee2e2; color: #dc2626; }
.q-badge.type { background: #e0e7ff; color: #4f46e5; }
.q-badge.marks { background: #dbeafe; color: #2563eb; font-weight: 600; }

/* Export button */
.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.75rem;
}

.export-btn:hover {
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

/* Search Backend Toggle */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
    flex-wrap: wrap;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #10b981;
    cursor: pointer;
}

.toggle-text {
    font-weight: 600;
}

.toggle-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    width: 100%;
    margin-left: 2rem;
    margin-top: 0.25rem;
}

/* Mode selector (if used) */
.mode-selector {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mode-card {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.mode-card:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.mode-card.active {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.mode-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.35rem;
}

.mode-card h3 i {
    margin-right: 0.4rem;
    color: #10b981;
}

.mode-card p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
}

/* Responsive: collapse to single column */
@media (max-width: 960px) {
    .agentic-columns {
        grid-template-columns: 1fr;
    }

    .agentic-col-results {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .paper-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .agentic-paper-container {
        padding: 1rem;
    }

    .paper-type-cards {
        flex-direction: column;
    }

    .config-row {
        flex-direction: column;
    }

    .paper-stats {
        grid-template-columns: 1fr 1fr;
    }

    .progress-steps {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .progress-steps::before {
        display: none;
    }

    .coverage-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .coverage-label {
        min-width: auto;
    }

    .coverage-track {
        width: 100%;
    }

    .template-specs {
        flex-direction: column;
        gap: 0.4rem;
    }

    .difficulty-sliders {
        flex-direction: column;
    }
}
