/* static/css/pages/drill-session.css - COMPLETELY REWRITTEN */

.drill-session {
    min-height: 100vh;
    background: var(--background);
    color: var(--text-dark);
    position: relative;
    overflow-x: hidden;
}

/* Remove sketchpad background effects */
.session-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.1;
}

/* Fixed Header */
.session-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(var(--surface-rgb), 0.95);
}

.header-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.drill-title-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.drill-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.drill-subtitle {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.language-badge {
    background: var(--primary-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
}

.difficulty-beginner { background: var(--success); }
.difficulty-intermediate { background: var(--warning); color: var(--text-dark); }
.difficulty-advanced { background: var(--error); }
.difficulty-expert { 
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.drill-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-soft);
}

.meta-item i {
    color: var(--primary-blue);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.timer.warning { color: var(--warning); }
.timer.critical { color: var(--error); }

.timer-label {
    font-size: 0.75rem;
    color: var(--text-soft);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Progress Bar */
.progress-container {
    top: 70px; /* Adjust based on header height */
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border);
    z-index: 999;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-purple));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 0 2px 2px 0;
}

.progress-label {
    position: absolute;
    top: 8px;
    right: 20px;
    font-size: 0.75rem;
    color: var(--text-soft);
}

/* Main Content Layout */
.session-content {
    display: grid;
    grid-template-columns: 280px 1fr 350px;
    gap: 2rem;
    padding: calc(70px + 2rem) 2rem 2rem; /* Account for fixed header and progress bar */
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Questions Sidebar */
.questions-sidebar {
    position: sticky;
    top: calc(70px + 2rem);
    height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-section h3 {
    font-size: 1rem;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dark);
}

.sidebar-badge {
    background: var(--primary-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-left: auto;
}

.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 0.5rem;
}

.question-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.question-number:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

.question-number.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.question-number.answered {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.question-number.flagged {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

.tools-grid {
    display: grid;
    gap: 0.75rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.25rem;
}

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

/* Main Question Area */
.question-main {
    min-height: 600px;
}

.question-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.question-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-title-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.question-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.question-points {
    color: var(--text-soft);
    font-size: 0.875rem;
}

.question-meta {
    display: flex;
    gap: 0.75rem;
}

.meta-chip {
    background: var(--background);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question-actions {
    display: flex;
    gap: 0.5rem;
}

.action-group {
    display: flex;
    gap: 0.5rem;
    background: var(--background);
    padding: 0.5rem;
    border-radius: 12px;
}

.question-content {
    padding: 2rem;
}

.question-description-container {
    margin-bottom: 2rem;
}

.question-description {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.question-description pre,
.question-description code {
    font-family: 'Space Mono', monospace;
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.question-description code {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.options-section {
    margin-top: 2rem;
}

.options-title {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-item:hover {
    border-color: var(--primary-blue);
    transform: translateX(4px);
}

.option-item.selected {
    background: var(--primary-blue-light);
    border-color: var(--primary-blue);
}

.option-marker {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-weight: 700;
    color: var(--text-soft);
    transition: all 0.2s ease;
}

.option-item.selected .option-marker {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.option-content {
    flex: 1;
    line-height: 1.6;
    color: var(--text-dark);
}

.question-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navigation-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-soft);
    font-size: 0.875rem;
}

.navigation-info kbd {
    background: var(--background);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: 'Space Mono', monospace;
}

/* Sketchpad Sidebar (Removing sketchpad) */
.sketchpad-sidebar {
    position: sticky;
    top: calc(70px + 2rem);
    height: calc(100vh - 120px);
    overflow-y: auto;
}

/* Replace sketchpad with enhanced notes and announcements */
.sketchpad-sidebar .sidebar-section:nth-child(2) {
    /* Hide sketchpad section */
    display: none;
}

.notes-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.notes-section h3 {
    font-size: 1rem;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dark);
}

.auto-save-status {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.notes-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-dark);
    resize: vertical;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--primary-blue-light);
}

.notes-tip {
    font-size: 0.75rem;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Announcements Container */
.announcements-container {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 1rem;
}

.empty-announcements {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-soft);
}

.empty-announcements i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--border);
}

.announcement-item {
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary-blue);
}

.announcement-item.urgent {
    border-left-color: var(--error);
    background: rgba(var(--error-rgb), 0.05);
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.announcement-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-soft);
}

.announcement-time {
    color: var(--text-soft);
}

.announcement-message {
    line-height: 1.5;
    color: var(--text-dark);
}

.urgent-badge {
    display: inline-block;
    background: var(--error);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Security Warning */
.cheating-warning {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--error);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: none;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    max-width: 500px;
    width: 90%;
}

.warning-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.warning-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
}

/* Session Instructions */
.session-instructions {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.instructions-content {
    font-size: 0.875rem;
}

.instructions-content h4 {
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instructions-content ul {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-soft);
}

.instructions-content li {
    margin-bottom: 0.5rem;
}

.warning-text {
    color: var(--error);
    font-weight: 600;
}

/* Floating Announcements Panel */
.announcements-panel {
    position: fixed;
    top: 120px;
    right: 2rem;
    width: 350px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 200;
    overflow: hidden;
    display: none;
}

.announcements-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-blue);
    color: white;
}

.announcements-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.live-badge {
    background: var(--error);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.announcements-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
}

.announcements-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-soft);
    font-size: 0.75rem;
}

/* Security Overlay */
.security-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(5px);
}

.security-alert {
    background: var(--surface);
    padding: 2rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 2px solid var(--error);
    animation: shake 0.5s ease;
}

.security-alert i {
    font-size: 3rem;
    color: var(--error);
    margin-bottom: 1rem;
}

.security-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Camera Request Modal */
.camera-request-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(5px);
}

.camera-request-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 2px solid var(--primary-blue);
}

.camera-request-content i {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.camera-preview {
    width: 100%;
    height: 200px;
    background: var(--background);
    border-radius: 8px;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.camera-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-camera {
    color: var(--text-soft);
}

.camera-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.camera-note {
    margin-top: 1rem;
    color: var(--text-soft);
    font-size: 0.875rem;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .session-content {
        grid-template-columns: 250px 1fr 320px;
        gap: 1.5rem;
        padding: calc(70px + 1.5rem) 1.5rem 1.5rem;
    }
}

@media (max-width: 992px) {
    .session-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 1.5rem;
    }
    
    .questions-sidebar,
    .sketchpad-sidebar {
        position: static;
        height: auto;
        max-height: 400px;
        overflow-y: auto;
    }
    
    .questions-sidebar {
        order: 2;
    }
    
    .question-main {
        order: 1;
    }
    
    .sketchpad-sidebar {
        order: 3;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .announcements-panel {
        position: fixed;
        bottom: 1rem;
        top: auto;
        right: 1rem;
        left: 1rem;
        width: auto;
    }
    
    .session-instructions {
        display: none;
    }
}

@media (max-width: 768px) {
    .session-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .session-content {
        padding: calc(120px + 1rem) 1rem 1rem;
    }
    
    .sketchpad-sidebar {
        grid-template-columns: 1fr;
    }
    
    .drill-meta {
        justify-content: center;
    }
    
    .question-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .question-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .questions-grid {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    }
    
    .question-number {
        width: 35px;
        height: 35px;
    }
    
    .option-item {
        padding: 1rem;
    }
    
    .timer {
        font-size: 1.25rem;
    }
    
    .cheating-warning {
        bottom: 1rem;
        padding: 0.75rem 1rem;
    }
}
.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-xl);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 10;
    backdrop-filter: blur(10px);
}