@charset "utf-8";
/* ============================================
   RUDN Test Platform - Unified Styles
   File: assets/css/main.css
   Includes: index.php + exam.php styles
   ============================================ */

/* ============================================
   BASE RESET & GLOBAL
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body - Shared gradient background */
body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

body.exam-page {
    display: block;
    padding: 20px;
}

body.exam-page #exam-container {
    margin: 0 auto;
}

body.index-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* ============================================
   INDEX PAGE STYLES (#main-container)
   ============================================ */
#main-container {
    width: 100%;
    max-width: 1200px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Index Header */
#main-container #header {
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#main-container #header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

#main-container #header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

#main-container #header p {
    margin: 0;
    font-size: 15px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* Index Content */
#main-container #content {
    padding: 40px;
}

/* Language Sections (Index) */
.language-section {
    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.language-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.language-title {
    font-size: 26px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #ddd;
    display: flex;
    align-items: center;
    color: #333;
}

/* Test Grid (Index) */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Test Cards (Index) */
.test-card {
    padding: 25px;
    border: 2px solid #e1e1e1;
    border-radius: 12px;
    background: white;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 240px;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 136, 221, 0.2);
    border-color: #0088dd;
}

.test-card h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.test-card p {
    margin: 6px 0;
    color: #666;
    font-size: 14px;
}

.test-card p strong {
    font-weight: 600;
    color: #333;
}

/* Test Buttons (Index) */
.test-button {
    margin-top: 20px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    text-align: center;
    border: none;
    color: white;
    display: inline-block;
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
}

.test-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 136, 221, 0.4);
}

.test-button:active {
    transform: translateY(0);
}

/* Language Theme Colors (Index) */
.english .language-title {
    color: #0088dd;
    border-bottom-color: #0088dd;
}

.english .test-button {
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
}

.english .test-button:hover {
    box-shadow: 0 10px 30px rgba(0, 136, 221, 0.4);
}

.english .test-card:hover {
    border-color: #0088dd;
}

.italian .language-title {
    color: #27ae60;
    border-bottom-color: #27ae60;
}

.italian .test-button {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
}

.italian .test-button:hover {
    box-shadow: 0 10px 30px rgba(39, 174, 96, 0.4);
}

.italian .test-card:hover {
    border-color: #27ae60;
}

.spanish .language-title {
    color: #e74c3c;
    border-bottom-color: #e74c3c;
}

.spanish .test-button {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.spanish .test-button:hover {
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.4);
}

.spanish .test-card:hover {
    border-color: #e74c3c;
}

.french .language-title {
    color: #8e44ad;
    border-bottom-color: #8e44ad;
}

.french .test-button {
    background: linear-gradient(135deg, #8e44ad 0%, #6c3483 100%);
}

.french .test-button:hover {
    box-shadow: 0 10px 30px rgba(142, 68, 173, 0.4);
}

.french .test-card:hover {
    border-color: #8e44ad;
}

.other .language-title {
    color: #6c757d;
    border-bottom-color: #6c757d;
}

.other .test-button {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.other .test-button:hover {
    box-shadow: 0 10px 30px rgba(108, 117, 125, 0.4);
}

.other .test-card:hover {
    border-color: #6c757d;
}

/* Footer Info (Index) */
.footer-info {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #e1e1e1;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.footer-info h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.footer-info p {
    margin: 5px 0;
}

/* Empty State (Index) */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.empty-state p {
    font-size: 16px;
    margin: 10px 0;
}

/* ============================================
   EXAM PAGE STYLES (#exam-container)
   ============================================ */
#exam-container {
    width: 100%;
    max-width: 1200px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    margin: 20px;
}

#exam-container #header {
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: -webkit-sticky; /* Для Safari */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

#exam-container #header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

/* Progress Indicator (Exam) */
#exam-container #progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

#exam-container #progress-indicator {
    display: flex;
    gap: 5px;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: all 0.3s;
}

.progress-dot.active {
    background: white;
    transform: scale(1.2);
}

.progress-dot.completed {
    background: #28a745;
}

/* Timer (Exam) */
#exam-container #timer {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

/* Audio Container (Exam - Listening) */
#audio-container {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e1e1;
}

.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.play-button {
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.play-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Progress Bar (Exam Audio) */
.progress-bar {
    flex: 1;
    height: 6px;
    background: #e1e1e1;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    width: 0%;
    transition: width 0.1s;
}

/* Exam Content */
#exam-container #content {
    padding: 40px 30px;
    min-height: 400px;
    position: relative;
}

/* Exam Parts */
.part {
    display: none;
}

.part.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.part.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.part h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 22px;
}

.part p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Name Input (Exam) */
#name-input {
    width: 100%;
    max-width: 400px;
    padding: 14px 18px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
}

#name-input:focus {
    outline: none;
    border-color: #0088dd;
}

/* Two Column Layout (Exam - Reading) */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 20px 0;
}

.column-text {
    border-right: 1px solid #e1e1e1;
    padding-right: 20px;
}

.reading-text, .audio-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    font-size: 15px;
}

/* Questions (Exam) */
.questions {
    /*margin-top: 20px;*/
}

.questions > div {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Input Fields (Exam) */
.gap-fill-input {
    border: 2px solid #0088dd;
    border-radius: 4px;
    padding: 6px 10px;
    width: 120px;
    margin: 0 5px;
    font-size: 14px;
}

.cloze-input {
    border: 2px solid #0088dd;
    border-radius: 4px;
    padding: 6px 10px;
    width: 100px;
    margin: 0 5px;
    font-size: 14px;
}

/* Navigation (Exam) */
#exam-container #navigation {
    display: flex;
    justify-content: space-between;
    padding: 20px 30px;
    border-top: 1px solid #e1e1e1;
    background: #f8f9fa;
}

#exam-container #navigation button {
    background: linear-gradient(135deg, #0088dd 0%, #091c39 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

#exam-container #navigation button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 136, 221, 0.4);
}

#exam-container #navigation button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Answer Review (Exam) */
.review-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid #e1e1e1;
    font-size: 14px;
}

.review-mark.correct {
    color: #28a745;
    font-weight: bold;
}

.review-mark.incorrect {
    color: #e74c3c;
    font-weight: bold;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Index Section Animation */
.language-section.visible {
    animation: fadeInUp 0.5s ease forwards;
}

.language-section.visible:nth-child(2) { animation-delay: 0.1s; }
.language-section.visible:nth-child(3) { animation-delay: 0.2s; }
.language-section.visible:nth-child(4) { animation-delay: 0.3s; }
.language-section.visible:nth-child(5) { animation-delay: 0.4s; }
.language-section.visible:nth-child(6) { animation-delay: 0.5s; }

/* ============================================
   RESPONSIVE - INDEX PAGE
   ============================================ */
@media (max-width: 992px) {
    #main-container #content {
        padding: 30px;
    }
    
    .test-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    #main-container #header {
        padding: 25px 30px;
    }
    
    #main-container #header h1 {
        font-size: 24px;
    }
    
    #main-container #header p {
        font-size: 14px;
    }
    
    #main-container #content {
        padding: 25px 20px;
    }
    
    .language-title {
        font-size: 22px;
    }
    
    .test-card {
        min-height: 220px;
        padding: 20px;
    }
    
    .test-card h3 {
        font-size: 16px;
    }
    
    /* Exam Responsive */
    .two-column-layout {
        grid-template-columns: 1fr;
    }
    
    .column-text {
        border-right: none;
        border-bottom: 1px solid #e1e1e1;
        padding-right: 0;
        padding-bottom: 20px;
    }
    
    #exam-container #header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        position: sticky;
        top: 0;
    }
    
    #exam-container #navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    #exam-container #navigation button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #main-container #header h1 {
        font-size: 20px;
    }
    
    .language-title {
        font-size: 18px;
    }
    
    .test-button {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .footer-info {
        font-size: 13px;
    }
}

/* ============================================
   SMOOTH SCROLL
   ============================================ */
html {
    scroll-behavior: smooth;
}