/**
 * Τεστ Θεωρίας Πληροφορικής - Στυλ
 * Σταμάτης Χαλικιάς
 */

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* === Containers === */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container-quiz {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.container-results {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
}

/* === Screen Management === */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* === Cards === */
.card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.quiz-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
}

.results-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

/* === Icons & Logo === */
.icon-circle {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

.icon {
    width: 50px;
    height: 50px;
    color: white;
}

/* === Typography === */
h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 10px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 15px;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
}

.subtitle {
    font-size: 18px;
    color: #718096;
    margin-bottom: 30px;
}

.student-name {
    font-size: 16px;
    color: #4a5568;
    margin-top: 5px;
}

/* === Forms === */
.form {
    text-align: left;
    margin-top: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #718096;
}

/* === Buttons === */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.btn-info {
    background: #dbeafe;
    color: #1e40af;
}

.btn-info:hover:not(:disabled) {
    background: #bfdbfe;
}

.btn-full {
    width: 100%;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

/* === Quiz Header === */
.quiz-header {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.quiz-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.timer {
    font-size: 24px;
    font-weight: 700;
    color: #6366f1;
    font-family: 'Courier New', monospace;
}

.progress {
    font-size: 16px;
    color: #64748b;
    font-weight: 600;
}

/* === Question Section === */
.question-section {
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.question-text {
    color: #1e293b;
    white-space: pre-line;
    line-height: 1.8;
}

/* === Answer Section === */
.answer-section {
    margin-bottom: 24px;
}

.answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.score-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.score-excellent {
    background: #d1fae5;
    color: #065f46;
}

.score-good {
    background: #fef3c7;
    color: #92400e;
}

.score-poor {
    background: #fee2e2;
    color: #991b1b;
}

textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
    transition: all 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* === Microphone Button === */
.mic-icon {
    font-size: 20px;
}

.btn-secondary.recording {
    background: #ef4444;
    color: white;
    animation: pulse 1.5s infinite;
}

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

/* === Ideal Answer === */
.ideal-answer {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.ideal-text {
    color: #166534;
    line-height: 1.8;
    white-space: pre-line;
}

/* === Reasoning Box === */
.reasoning-box {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease;
}

.reasoning-header {
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 12px;
    font-size: 16px;
}

.reasoning-text {
    color: #1e3a8a;
    line-height: 1.8;
    font-style: italic;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Navigation === */
.navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 24px;
    border-top: 2px solid #f1f5f9;
}

/* === Notices === */
.notice {
    padding: 16px 20px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
}

.notice-warning {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    color: #92400e;
}

.notice-success {
    background: #d1fae5;
    border: 2px solid #34d399;
    color: #065f46;
}

/* === Results Summary === */
.results-summary {
    text-align: center;
    margin-bottom: 40px;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 700;
    color: white;
    margin: 0 auto 30px;
}

.score-excellent-circle {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.score-good-circle {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.score-poor-circle {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    padding: 24px;
    border-radius: 12px;
    text-align: center;
}

.stat-blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.stat-green {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.stat-purple {
    background: linear-gradient(135deg, #e9d5ff 0%, #ddd6fe 100%);
}

.stat-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

/* === Detailed Results === */
.detailed-results {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.detailed-results h2 {
    color: #1e293b;
    margin-bottom: 30px;
    font-size: 24px;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.answer-item {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.answer-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.answer-header-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.answer-number {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.answer-score {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
}

.answer-question {
    color: #475569;
    margin-bottom: 16px;
    font-weight: 500;
    line-height: 1.6;
}

.answer-student {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.answer-student-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.answer-student-text {
    color: #1e293b;
    white-space: pre-line;
    line-height: 1.6;
}

.answer-ideal {
    background: #f0fdf4;
    padding: 16px;
    border-radius: 8px;
}

.answer-ideal-label {
    font-size: 12px;
    font-weight: 700;
    color: #065f46;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.answer-ideal-text {
    color: #1e293b;
    white-space: pre-line;
    line-height: 1.6;
}

/* === Loading Overlay === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    font-size: 18px;
    margin-top: 20px;
    font-weight: 600;
}

/* === Speech Recognition Notification === */
.speech-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
}

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

.speech-notification-content {
    padding: 24px;
    position: relative;
}

.close-notification {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-notification:hover {
    background: #f1f5f9;
    color: #475569;
}

.notification-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 12px;
}

.speech-notification h3 {
    color: #1e293b;
    font-size: 18px;
    margin-bottom: 12px;
    padding-right: 30px;
}

.speech-notification p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
}

/* Notification types */
.speech-notification.error .notification-icon {
    color: #ef4444;
}

.speech-notification.warning .notification-icon {
    color: #f59e0b;
}

.speech-notification.info .notification-icon {
    color: #3b82f6;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .container,
    .container-quiz,
    .container-results {
        padding: 20px 15px;
    }

    .card,
    .quiz-card,
    .results-card,
    .detailed-results {
        padding: 24px 20px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 18px;
    }

    .quiz-header {
        flex-direction: column;
        text-align: center;
    }

    .quiz-info {
        flex-direction: column;
        width: 100%;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .btn {
        width: 100%;
    }

    .navigation {
        flex-direction: column;
    }

    .navigation .btn {
        width: 100%;
    }

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

    .stat-value {
        font-size: 24px;
    }

    .score-circle {
        width: 120px;
        height: 120px;
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 20px;
    }

    .timer {
        font-size: 20px;
    }

    .progress {
        font-size: 14px;
    }

    .card,
    .quiz-card,
    .results-card {
        padding: 20px 16px;
    }
}