/* MC Demo Section - Light Mode Replica */
.mc-demo-section {
    padding: 6rem 0;
    position: relative;
    background: transparent;
}

.mc-interface-container {
    background: #ffffff;
    border: 1px solid var(--border-color, rgba(0,0,0,0.1));
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    text-align: left;
    color: #333;
}

/* App Header Mockup */
.mc-app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.mc-breadcrumbs {
    display: flex;
    flex-direction: column;
}

.mc-crumb-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
}

.mc-crumb-path {
    font-size: 0.85rem;
    color: #888;
}

.mc-app-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    color: #6c757d;
}

.mc-app-actions i {
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
}

.mc-app-actions i:hover {
    color: #333;
}

.mc-user-avatar {
    width: 36px;
    height: 36px;
    background: #e0e0e0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* Exercise Banner */
.mc-exercise-banner {
    background: #6224f2; /* Purple from screenshot */
    padding: 1rem 1.5rem;
    margin: 1rem 1.5rem 0.5rem;
    border-radius: 12px;
    color: white;
}

.mc-exercise-banner h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* Pagination Strip */
.mc-pagination-strip {
    display: flex;
    gap: 0.5rem;
    margin: 0 1.5rem 1.5rem;
    padding: 0.5rem 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mc-pagination-strip::-webkit-scrollbar {
    display: none;
}

.mc-page-btn {
    min-width: 36px;
    height: 36px;
    border: none;
    background: #f1f1f2;
    border-radius: 6px;
    color: #555;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.mc-page-btn.active {
    background: #007bff; /* Blue active state */
    color: white;
}

.mc-page-btn:hover:not(.active) {
    background: #e2e2e4;
}

.mc-page-btn.arrow {
    background: transparent;
    color: #888;
}

.mc-page-btn.arrow:hover {
    background: #f1f1f2;
    color: #333;
}

/* Content Area */
.mc-content-wrapper {
    padding: 0 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Question Card */
.mc-question-card {
    background: #fff;
    border: 1px solid #eef0f2;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    display: flex;
    overflow: hidden;
    position: relative;
    /* Create the "card" feel */
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
    width: 100%;
}

.mc-card-accent {
    width: 4px;
    background: #007bff;
    flex-shrink: 0;
}

.mc-card-content {
    flex-grow: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

.mc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.mc-badges {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.mc-badge {
    background: #eef6ff;
    color: #007bff;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.mc-badge.number {
    color: #99a1b3;
    background: transparent;
    padding-left: 0;
    font-size: 1rem;
}

.mc-ask-ai-btn {
    background: #7a3aed; /* Lighter purple button */
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(122, 58, 237, 0.3);
}

.mc-question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: #212529;
}

/* Table */
.mc-table-container {
    overflow-x: auto;
    margin-bottom: 2rem;
}

.mc-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    color: #333;
}

.mc-data-table th, 
.mc-data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
}

.mc-data-table th {
    font-weight: 700;
    border-bottom: 2px solid #f0f0f0;
}

.mc-data-table td {
    border-bottom: 1px solid #f8f9fa;
}

.mc-data-table tr:last-child td {
    border-bottom: none;
}

/* Star Icon */
.mc-card-footer {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    color: #adb5bd;
    cursor: pointer;
    font-size: 1.1rem;
}

.mc-card-footer:hover {
    color: #ffc107;
}

/* Answer Section */
.mc-answer-section {
    padding: 0 0.5rem;
}

.mc-answer-section h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.mc-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mc-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.mc-option:hover {
    background: #f8f9fa;
}

.mc-option input {
    display: none;
}

.mc-opt-circle {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.mc-option input:checked + .mc-opt-circle {
    border-color: #007bff;
}

.mc-option input:checked + .mc-opt-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #007bff;
    border-radius: 50%;
}

.mc-opt-label {
    font-weight: 600;
    color: #6c757d;
}

.mc-opt-text {
    color: #333;
}



/* Bottom Navigation */
.mc-bottom-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.mc-nav-arrow {
    width: 40px;
    height: 40px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
}

.mc-nav-arrow:hover {
    background: #e2e8f0;
    color: #333;
}

.mc-submit-btn {
    background: #10b981; /* Green */
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.mc-submit-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

@media (max-width: 768px) {
    .mc-exercise-banner, 
    .mc-pagination-strip, 
    .mc-content-wrapper {
        margin-left: 1rem;
        margin-right: 1rem;
    }
    
    .mc-content-wrapper {
        padding: 0 1rem 1.5rem;
    }
}

/* ORAL ASSESSMENT Styles */

.oral-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem 1.5rem;
}

@media (max-width: 992px) {
    .oral-layout {
        grid-template-columns: 1fr;
    }
}

/* Common Card Style (extends mc-question-card idea) */
.oral-card {
    background: #fff;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.oral-card-header {
    background: #fff;
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.oral-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.oral-card-body {
    padding: 1.5rem;
    flex: 1;
}

/* Input Section */
.oral-passage-box {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
    border: 1px solid #eee;
    margin-bottom: 1.5rem;
    min-height: 150px;
}

.oral-controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.oral-lang-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.oral-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.oral-radio input {
    accent-color: #007bff;
}

.oral-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    color: #333;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
}

.oral-advanced-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.oral-actions-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-record {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-record:hover {
    background: #0056b3;
}

.audio-player-mock {
    flex: 1;
    background: #f1f3f4;
    border-radius: 20px;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
    color: #555;
    font-size: 0.85rem;
}

.btn-play-sm {
    color: #333;
    cursor: pointer;
}

.audio-track {
    flex: 1;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    position: relative;
}

.audio-track::after {
    content: '';
    position: absolute;
    left: 30%;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #555;
    border-radius: 50%;
}

.oral-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 1.5rem 0;
}

.oral-divider::before,
.oral-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #eee;
}

.oral-divider::before {
    margin-right: 1rem;
}

.oral-divider::after {
    margin-left: 1rem;
}

.upload-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-upload {
    background: #eef6ff;
    color: #007bff;
    border: 1px solid #b8dfff;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.upload-hint {
    font-size: 0.8rem;
    color: #888;
}

.btn-analyze {
    width: 100%;
    background: #10b981;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-analyze:hover {
    background: #059669;
}


/* Results Section */
.result-success-box {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.success-icon {
    background: #10b981;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.success-content h4 {
    color: #065f46;
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 700;
}

.success-content p {
    color: #047857;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.score-card {
    border: 1px dashed #ced4da;
    border-radius: 8px;
    padding: 1rem 0.5rem;
    text-align: center;
}

.score-card.overall {
    background: #eef6ff;
    border-style: solid;
    border-color: #b8dfff;
}

.score-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: #333;
    margin-bottom: 0.25rem;
}

.score-card.overall .score-val {
    color: #007bff;
}

.score-label {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
}

.what-heard-box {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.what-heard-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 0.5rem;
}

.what-heard-text {
    font-style: italic;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

.detailed-analysis-box {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 1.25rem;
    font-size: 1rem;
    line-height: 2;
    color: #333;
    margin-bottom: 1.5rem;
}

.word-correct {
    color: #10b981;
    font-weight: 600;
}

.word-mis {
    color: #ef4444;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.word-fair {
    color: #f59e0b;
    font-weight: 600;
}

.legend-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.legend-item {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.lg-high { background: #d1fae5; color: #065f46; }
.lg-fair { background: #fef3c7; color: #92400e; }
.lg-mis { color: #ef4444; text-decoration: underline; }

.word-strike {
    color: #ef4444;
    text-decoration: line-through;
    opacity: 0.7;
    margin-right: 0.25rem;
    font-weight: 600;
}

/* Shared Grid Layout */
.demos-section {
    padding: 6rem 0;
    position: relative;
    background: transparent;
}

.demos-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

.demos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1200px) {
    .demos-grid {
        grid-template-columns: 1fr;
    }
}

/* Ensure cards stretch to match heights if needed, though 'align-items: start' lets them be natural. 
   If we want equal height, use 'align-items: stretch' (default for grid). 
*/
.demos-grid {
    align-items: stretch; 
}


.demo-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.demo-item .mc-interface-container {
    height: 100%;
    margin: 0; 
    /* Force internal stacking for constrained width */
}

/* When in grid, force Oral Layout to Stack Internally if narrow */
.demos-grid .oral-layout {
    grid-template-columns: 1fr; /* Stack visually in the half-width column */
    gap: 1.5rem;
}

/* Placeholder Slots */
.white-placeholder {
    background: rgba(255,255,255,0.05); /* slightly visible */
    border: 2px dashed rgba(255,255,255,0.1);
    border-radius: 12px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
    font-size: 1.5rem;
    font-weight: 700;
}

/* COMPACT MODE FOR GRID */
/* This forces a max-height on the demo items to achieve the ~50% reduction request */
.demo-item .mc-interface-container {
    height: 540px !important;  /* Strict height constraint */
    display: flex;
    flex-direction: column;
}

/* Allow scrolling within content areas if needed, but try to fit first */
.demo-item .mc-content-wrapper,
.demo-item .oral-card-body {
    overflow-y: auto;
    flex: 1; /* Take remaining space */
    scrollbar-width: thin; /* Firefox */
}

/* Custom weak scrollbar for webkit */
.demo-item .mc-content-wrapper::-webkit-scrollbar,
.demo-item .oral-card-body::-webkit-scrollbar {
    width: 6px;
}
.demo-item .mc-content-wrapper::-webkit-scrollbar-thumb,
.demo-item .oral-card-body::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 3px;
}

/* Reduces padding inside the MC Wrapper for grid mode */
.demo-item .mc-content-wrapper {
    padding-bottom: 1rem !important;
    gap: 1rem !important;
}

/* Adjust Oral Layout for compact space */
.demo-item .oral-layout {
    overflow: hidden; /* Don't scroll the whole layout, scroll individual cards if needed or manage flex */
    gap: 1rem !important;
    padding: 1rem !important;
    height: 100%;
}

/* Force Oral Cards to flex/shrink properly */
.demo-item .oral-card {
    min-height: 0; /* Important for flex children scrolling */
    flex-shrink: 1;
}

/* Reduce header sizes slightly in grid */
.demo-item .mc-app-header {
    padding: 0.75rem 1rem;
    min-height: 50px;
}
.demo-item .mc-exercise-banner {
    margin: 0.75rem 1rem 0.5rem;
    padding: 0.75rem 1rem;
}
.demo-item .mc-exercise-banner h1 {
    font-size: 1.1rem;
}

/* Compact pagination */
.demo-item .mc-pagination-strip {
    margin: 0 1rem 1rem;
}

/* Make oral Passage Box smaller/scrollable */
.demo-item .oral-passage-box {
    min-height: 80px !important; /* Reduced from 150 */
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
}

/* Compact Oral Controls */
.demo-item .oral-controls .btn-record,
.demo-item .oral-controls .btn-analyze {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    margin-top: 0;
}
.demo-item .oral-controls {
    gap: 0.75rem;
}

/* Compact Results */
.demo-item .result-success-box {
    padding: 0.6rem;
    margin-bottom: 0.75rem;
}
.demo-item .score-grid {
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}
.demo-item .score-card {
    padding: 0.5rem 0.25rem;
}
.demo-item .score-val {
    font-size: 1.1rem;
}
.demo-item .detailed-analysis-box {
    padding: 0.75rem;
    margin-bottom: 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Placeholder adjustments */
.white-placeholder {
    min-height: 540px; /* Match the new demo height */
}

/* AI Story Demo Styles */

.ai-story-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem 1.5rem;
}

.story-card {
    background: #fff;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.story-card-header {
    background: #fff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.story-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.editor-toolbar-top {
    border-bottom: 1px solid #f0f0f0;
    padding: 0.5rem 1rem;
    background: #fcfcfc;
    font-size: 0.85rem;
    color: #555;
    display: flex;
    gap: 1rem;
}

.editor-toolbar-top span {
    cursor: pointer;
}
.editor-toolbar-top span:hover { color: #000; }

.editor-icon-bar {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    border-right: 1px solid #eee;
    padding-right: 1rem;
}
.toolbar-group:last-child { border-right: none; }

.tool-icon {
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}
.tool-icon:hover { background: #eee; color: #000; }

.story-content-area {
    padding: 2rem;
    min-height: 200px;
    font-family: 'Georgia', serif; /* Story-like font */
    font-size: 1.05rem;
    line-height: 1.7;
    color: #333;
    background: #fff;
}

.config-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.config-panel {
    background: #fff;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.panel-title {
    font-weight: 700;
    font-size: 1rem;
    color: #333;
}

.btn-regen {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-regen:hover { background: #0056b3; }

.config-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.config-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}
.config-input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
    color: #333;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}
.preview-img-box {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1/1;
    background: #f0f0f0;
}
.preview-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.img-caption {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

.audio-preview-box {
    margin-top: 1rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 768px) {
    .config-split { grid-template-columns: 1fr; }
}

