* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
    color: #4a5568;
    font-size: 2rem;
    font-weight: 700;
}

.header h1 i {
    color: #667eea;
    margin-right: 10px;
}

.test-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.timer-display {
    background: #2d3748;
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    justify-content: center;
}

.timer-display i {
    color: #68d391;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #718096, #4a5568);
    color: white;
}

/* Test Area */
.test-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.question-section,
.editor-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Question Section */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.question-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
}

.question-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.difficulty {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty.easy {
    background: #c6f6d5;
    color: #22543d;
}

.difficulty.medium {
    background: #feebc8;
    color: #7b341e;
}

.difficulty.hard {
    background: #fed7d7;
    color: #742a2a;
}

.points {
    background: #bee3f8;
    color: #2a4365;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.question-content p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #4a5568;
}

.example,
.requirements {
    margin-bottom: 20px;
}

.example h4,
.requirements h4 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.example pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    overflow-x: auto;
}

.requirements ul {
    padding-left: 20px;
}

.requirements li {
    margin-bottom: 8px;
    color: #4a5568;
}

.requirements code {
    background: #edf2f7;
    color: #2d3748;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Editor Section */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.editor-header h3 {
    color: #2d3748;
    font-size: 1.3rem;
}

.editor-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.language-select {
    padding: 8px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    color: #4a5568;
    cursor: pointer;
}

.editor-container {
    margin-bottom: 20px;
}

#codeEditor {
    width: 100%;
    height: 300px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    background: #f7fafc;
    color: #2d3748;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#codeEditor:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.output-section h4 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.output-display {
    background: #1a202c;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    min-height: 100px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-x: auto;
}

.output-placeholder {
    color: #718096;
    font-style: italic;
}

/* Monitoring Panel */
.monitoring-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.monitoring-panel h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.monitoring-card {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.monitoring-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.monitoring-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.monitoring-icon.tab-switch {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.monitoring-icon.copy-paste {
    background: linear-gradient(135deg, #f56565, #e53e3e);
}

.monitoring-icon.test-status {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.monitoring-icon.fullscreen-status {
    background: linear-gradient(135deg, #9f7aea, #805ad5);
}

.monitoring-icon.webcam-status {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
}

.monitoring-icon.screen-status {
    background: linear-gradient(135deg, #4299e1, #3182ce);
}

.monitoring-icon.snapshot-count {
    background: linear-gradient(135deg, #38b2ac, #319795);
}

.monitoring-icon.webcam-status {
    background: linear-gradient(135deg, #4299e1, #3182ce);
}

.monitoring-icon.snapshots-count {
    background: linear-gradient(135deg, #38b2ac, #319795);
}

.monitoring-info h4 {
    color: #2d3748;
    font-size: 1rem;
    margin-bottom: 5px;
}

.count {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
}

.status {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
}

/* Activity Log */
.activity-log h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.log-container {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.log-entry {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-entry.warning {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #f56565;
}

.log-entry.info {
    background: #bee3f8;
    color: #2a4365;
    border-left: 4px solid #4299e1;
}

.log-timestamp {
    font-size: 0.8rem;
    opacity: 0.7;
}

.log-placeholder {
    color: #718096;
    font-style: italic;
    text-align: center;
}

/* Warning Overlay */
.warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.warning-overlay.show {
    display: flex;
}

.warning-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.warning-content i {
    font-size: 4rem;
    color: #f56565;
    margin-bottom: 20px;
}

.warning-content h2 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 2rem;
}

.warning-content p {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

/* Permission Overlays */
.permission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(5px);
}

.permission-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.permission-content i {
    font-size: 4rem;
    color: #4299e1;
    margin-bottom: 20px;
}

.permission-content h2 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 2rem;
}

.permission-content p {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.permission-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Recording Indicators */
.webcam-indicator,
.screen-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1002;
    backdrop-filter: blur(10px);
    animation: pulse 2s infinite;
}

.screen-indicator {
    top: 60px;
    background: rgba(66, 153, 225, 0.9);
}

/* Webcam video recording style */
.recording {
    border: 3px solid #e53e3e;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Permission Overlay */
.permission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(10px);
}

.permission-overlay.show {
    display: flex;
}

.permission-content {
    background: white;
    padding: 50px;
    border-radius: 25px;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

.permission-content i {
    font-size: 5rem;
    color: #4299e1;
    margin-bottom: 25px;
}

.permission-content h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 2.2rem;
}

.permission-content p {
    color: #4a5568;
    margin-bottom: 30px;
    font-size: 1.2rem;
    line-height: 1.6;
}

.permission-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 25px;
}

.privacy-note {
    font-size: 0.9rem;
    color: #718096;
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #4299e1;
    margin-bottom: 0;
}

.privacy-note i {
    font-size: 1rem;
    color: #4299e1;
    margin-right: 8px;
}

/* Webcam Video Styles */
#webcamVideo {
    border: 3px solid #4299e1;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#webcamVideo.recording {
    border-color: #f56565;
    animation: recordingPulse 2s infinite;
}

@keyframes recordingPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 101, 101, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(245, 101, 101, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 101, 101, 0);
    }
}

/* Webcam Status Indicator */
.webcam-indicator {
    position: fixed;
    top: 180px;
    right: 25px;
    background: #f56565;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1000;
    animation: pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .test-area {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .test-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .question-section,
    .editor-section,
    .monitoring-panel {
        padding: 20px;
    }
    
    .monitoring-grid {
        grid-template-columns: 1fr;
    }
    
    .timer-display {
        font-size: 1rem;
        padding: 8px 16px;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.warning-pulse {
    animation: pulse 2s infinite;
}

/* Scrollbar Styling */
.log-container::-webkit-scrollbar,
#codeEditor::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track,
#codeEditor::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb,
#codeEditor::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover,
#codeEditor::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
