/* =====================================================
   Stereoscope Modal - Submission Version Comparison
   ===================================================== */

/* Overlay */
.stereo-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.stereo-overlay.visible {
    display: flex;
}

/* Modal Container */
.stereo-modal {
    background: #f5f7fa;
    border-radius: 16px;
    width: 96vw;
    height: 92vh;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

/* Header */
.stereo-header {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    gap: 16px;
    flex-shrink: 0;
}

.stereo-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin: 0;
    white-space: nowrap;
}

.stereo-sync-group {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.stereo-sync-btn {
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.stereo-sync-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.stereo-sync-btn.active {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    border-color: transparent;
}

.stereo-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.stereo-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Panels Container */
.stereo-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    flex: 1;
    min-height: 0;
    padding: 4px;
}

/* Individual Panel */
.stereo-panel {
    background: white;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Allow grid child to shrink below content size */
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Panel Header */
.stereo-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fafbfc;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.stereo-version-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.stereo-version-select {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: white;
    cursor: pointer;
}

.stereo-zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.stereo-zoom-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}

.stereo-zoom-btn:hover {
    background: #f3f4f6;
}

.stereo-zoom-level {
    font-size: 11px;
    color: #6b7280;
    min-width: 36px;
    text-align: center;
    font-weight: 600;
}

/* Scrollable Content Wrapper */
.stereo-content-wrapper {
    flex: 1;
    overflow: auto;
    padding: 16px;
    min-height: 0;
}

.stereo-content-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.stereo-content-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.stereo-content-wrapper::-webkit-scrollbar-thumb {
    background: #c4b5fd;
    border-radius: 4px;
}

.stereo-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a78bfa;
}

/* Content Area */
.stereo-content {
    transform-origin: top left;
    transition: transform 0.1s ease-out;
}

/* Content Sections */
.stereo-section {
    margin-bottom: 20px;
}

.stereo-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #667eea;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid #e5e7eb;
}

.stereo-rich-text {
    font-size: 14px;
    line-height: 1.7;
    color: #1e293b;
    word-wrap: break-word;
}

.stereo-rich-text p {
    margin-bottom: 8px;
}

.stereo-canvas-img {
    max-width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
}

.stereo-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stereo-photo {
    max-width: 100%;
    max-height: 300px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    object-fit: contain;
    background: #f9fafb;
}

.stereo-reflection {
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
}

.stereo-reflection div {
    margin-bottom: 4px;
}

.stereo-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

/* Teacher Feedback Section */
.stereo-feedback-section {
    margin-top: 20px;
    padding: 14px;
    background: #fef9ee;
    border: 1px solid #fcd34d;
    border-radius: 10px;
}

.stereo-feedback-section .stereo-section-label {
    color: #92400e;
    border-bottom-color: #fcd34d;
}

.stereo-grade {
    font-size: 15px;
    color: #1e293b;
    margin-bottom: 6px;
}

.stereo-feedback-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.stereo-feedback-list {
    font-size: 13px;
    color: #374151;
    margin-bottom: 4px;
}

.stereo-returned-at {
    font-size: 13px;
    color: #92400e;
    font-weight: 600;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: #fef3c7;
    border-radius: 6px;
    display: inline-block;
}

/* When originals shown alongside annotated, dim them slightly */
.stereo-originals-collapsed {
    opacity: 0.7;
}
.stereo-originals-collapsed .stereo-section-label {
    font-style: italic;
}

/* Loading / Empty states */
.stereo-loading,
.stereo-empty {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* =====================================================
   RESPONSIVE: Stack panels vertically on narrow screens
   ===================================================== */
@media (max-width: 768px) {
    .stereo-modal {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-width: none;
    }

    .stereo-panels {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .stereo-header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 14px;
    }

    .stereo-sync-group {
        order: 3;
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .stereo-close-btn {
        margin-left: auto;
    }

    .stereo-panel-header {
        flex-wrap: wrap;
        gap: 6px;
    }

    .stereo-zoom-controls {
        margin-left: 0;
    }
}
