/* ================================================ */
/* ТЕСТЫ ОФП - СТИЛИ */
/* ================================================ */

/* Screen wrapper */
#ofpTestsScreen {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Selector blocks */
.selector-block {
    background: white;
    border-radius: 15px;
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.selector-label {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 0.8em;
    color: rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: block;
}

.custom-select {
    width: 100%;
    padding: 14px;
    border: 2px solid rgba(217, 184, 110, 0.2);
    border-radius: 12px;
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    font-size: 0.95em;
    color: #1a1a1a;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23D9B86E' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.custom-select:focus {
    outline: none;
    border-color: #D9B86E;
    box-shadow: 0 0 0 3px rgba(217, 184, 110, 0.1);
}

/* Section tabs */
.section-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ofp-section-tab {
    background: #f8f8f8;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ofp-section-tab:active {
    transform: scale(0.96);
}

.ofp-section-tab.active {
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    color: white;
    border-color: #D9B86E;
    box-shadow: 0 3px 12px rgba(217, 184, 110, 0.3);
}

.ofp-section-tab.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.section-icon {
    font-size: 1.6em;
    margin-bottom: 4px;
}

.section-name {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.85em;
}

/* Exercise list */
.exercise-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exercise-item {
    background: #f8f8f8;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.exercise-item:active {
    transform: scale(0.98);
}

.exercise-item.active {
    background: rgba(217, 184, 110, 0.1);
    border-color: #D9B86E;
}

.exercise-info {
    flex: 1;
}

.exercise-name {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.95em;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.exercise-item.active .exercise-name {
    color: #D9B86E;
}

.exercise-detail {
    font-family: 'Lato', sans-serif;
    font-size: 0.8em;
    color: rgba(0, 0, 0, 0.5);
}

.exercise-check {
    font-size: 1.2em;
    color: #D9B86E;
    display: none;
}

.exercise-item.active .exercise-check {
    display: block;
}

/* Info message */
.info-message {
    background: rgba(217, 184, 110, 0.08);
    border-left: 3px solid #D9B86E;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 12px;
    font-family: 'Lato', sans-serif;
    font-size: 0.82em;
    color: rgba(0, 0, 0, 0.6);
    line-height: 1.5;
}

/* Results table */
.results-table {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-top: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.results-header {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 0.95em;
    color: #1a1a1a;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f5f5f5;
}

.result-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px;
    background: #f8f8f8;
    border-radius: 10px;
    margin-bottom: 8px;
}

.result-place {
    font-size: 1.4em;
    width: 32px;
    text-align: center;
}

.result-student {
    flex: 1;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 0.9em;
    color: #1a1a1a;
}

.result-value {
    font-family: 'Raleway', sans-serif;
    font-weight: 900;
    font-size: 1.2em;
    color: #D9B86E;
    min-width: 55px;
    text-align: right;
}

.result-retake {
    padding: 7px 11px;
    background: rgba(217, 184, 110, 0.1);
    border: 1px solid rgba(217, 184, 110, 0.25);
    border-radius: 8px;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.7em;
    color: #D9B86E;
    cursor: pointer;
    white-space: nowrap;
}

/* Адаптив для маленьких экранов */
@media (max-width: 400px) {
    .result-retake {
        padding: 6px 8px;
        font-size: 0.65em;  /* Меньше шрифт */
    }
    
    .result-row {
        gap: 6px;  /* Меньше gap между элементами */
    }
}

.empty-results {
    text-align: center;
    padding: 25px 15px;
    color: rgba(0, 0, 0, 0.4);
    font-family: 'Lato', sans-serif;
}

.empty-icon {
    font-size: 2.5em;
    margin-bottom: 8px;
}

/* Testing screen */
.testing-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8f8f8;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.testing-screen.active {
    display: block;
}

/* Когда testing-screen активен, блокируем скролл body */
body:has(.testing-screen.active) {
    overflow: hidden !important;
}

.testing-screen .test-header {
    padding: 8px 10px 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(217, 184, 110, 0.95), rgba(184, 134, 11, 0.95));
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(217, 184, 110, 0.3);
    max-width: 500px;      /* ← Ограничиваем ширину! */
    margin: 0 auto;        /* ← Центрируем! */
    left: 0;
    right: 0;
}

.testing-screen .test-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: shimmer 8s linear infinite;
}

.testing-screen .header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.testing-screen .logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
    flex-shrink: 0;
    margin-top: 3px;
}

.testing-screen .logo-placeholder {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5em;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
    flex-shrink: 0;
    margin-top: 3px;
}

.testing-screen .header-title {
    flex: 1;
    font-family: 'Raleway', sans-serif;
    font-weight: 900;
    font-size: 1.2em;
    letter-spacing: 3px;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.testing-screen .subtitle {
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    font-size: 0.5em;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 8px;
}

.testing-screen .page-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.85em;
    letter-spacing: 2px;
    color: white;
    text-align: left;
    margin-top: 2px;
    margin-left: 102px;
    margin-bottom: 0;
    padding: 6px 18px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 20px;
    display: inline-block;
    position: relative;
    z-index: 1;
}

.testing-content {
    padding: 25px 18px;
    padding-bottom: 150px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

/* Элементы внутри контента на полную ширину */
.testing-content > * {
    width: 100%;
    max-width: 100%;  /* Убираем ограничения! */
}

.exercise-name {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1em;
    color: #D9B86E;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.student-name-big {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 1.6em;
    color: #D9B86E;
    margin-bottom: 25px;
}

.timer-display {
    font-family: 'Raleway', sans-serif;
    font-weight: 900;
    font-size: 4em;
    color: #1a1a1a;
    margin-bottom: 18px;
    line-height: 1;
    max-height: 150px;
}

.counter-display {
    font-family: 'Raleway', sans-serif;
    font-weight: 900;
    font-size: 4.5em;
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 25px;
    line-height: 1;
    max-height: 150px;
}

.control-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    max-width: 100%;
}

.control-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    max-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-start {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: white;
}

.btn-pause {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.btn-reset {
    background: rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}

/* Action buttons container */
.action-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 25px;
}

.cancel-btn {
    flex: 1;
    padding: 16px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1em;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:active {
    transform: scale(0.98);
    background: rgba(0, 0, 0, 0.1);
}

.save-result-btn {
    flex: 2;
    padding: 18px;
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    border: none;
    border-radius: 12px;
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 1.05em;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(217, 184, 110, 0.3);
    transition: all 0.2s ease;
}

.save-result-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(217, 184, 110, 0.4);
}

/* Slider */
.slider-container {
    margin: 25px 0;
    padding: 18px;
    background: rgba(217, 184, 110, 0.04);
    border-radius: 14px;
}

.slider-label {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.85em;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 14px;
    text-align: center;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e5e5e5;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(217, 184, 110, 0.5);
}

.slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D9B86E, #C4A962);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(217, 184, 110, 0.5);
    border: none;
}

.slider-values {
    display: flex;
    justify-content: space-between;
    margin-top: 9px;
    font-family: 'Lato', sans-serif;
    font-size: 0.8em;
    color: rgba(0, 0, 0, 0.5);
}

.manual-input {
    width: 180px;
    padding: 14px;
    font-size: 1.4em;
    text-align: center;
    border: 2px solid #D9B86E;
    border-radius: 12px;
    margin: 25px 0;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
}

.manual-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(217, 184, 110, 0.15);
}

/* Modal */
.ofp-sound-modal.ofp-modal-content {
    background: white !important;
    border-radius: 20px !important;
    padding: 40px 30px !important;
    max-width: 280px !important;
    min-width: 280px !important;
    width: 85% !important;
    text-align: center !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    animation: modalBounce 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    height: auto !important;
    max-height: 400px !important;
}

/* Confirm modal - специальная для подтверждения */
.ofp-confirm-sound-modal.ofp-confirm-modal {
    background: white !important;
    border-radius: 20px !important;
    padding: 35px 30px 25px !important;
    max-width: 320px !important;
    min-width: 320px !important;
    width: 90% !important;
    text-align: center !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    animation: modalBounce 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    height: auto !important;
    max-height: 450px !important;
}

.confirm-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
}

.confirm-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 1.3em;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.confirm-message {
    font-family: 'Lato', sans-serif;
    font-size: 0.95em;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 10px;
}

.confirm-btn {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.confirm-btn-cancel {
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #666;
}

.confirm-btn-cancel:active {
    transform: scale(0.98);
    background: rgba(0, 0, 0, 0.1);
}

.confirm-btn-confirm {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.confirm-btn-confirm:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

.modal-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: iconPulse 0.6s ease;
}

.modal-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    font-size: 1.4em;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.modal-message {
    font-family: 'Lato', sans-serif;
    font-size: 0.95em;
    color: rgba(0, 0, 0, 0.6);
}

@keyframes modalBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.modal-overlay.show {
    display: flex !important;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}


/* === FIX: Center range slider thumb vertically === */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -8px; /* centers thumb on 8px track */
}

input[type="range"]::-moz-range-track {
  height: 8px;
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
}

/* ================================================
   PROGRAM TABS - Табы выбора программы
   ================================================ */

.program-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;
}

.program-tab {
    background: white;
    border: 2px solid rgba(217, 184, 110, 0.3);
    border-radius: 12px;
    padding: 18px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.program-tab:hover {
    border-color: rgba(217, 184, 110, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.program-tab.active {
    background: linear-gradient(135deg, rgba(217, 184, 110, 0.15), rgba(217, 184, 110, 0.05));
    border-color: #D9B86E;
    border-width: 3px;
    box-shadow: 0 4px 16px rgba(217, 184, 110, 0.25);
}

.program-name {
    font-weight: 700;
    font-size: 0.95em;
    color: rgba(0,0,0,0.85);
    font-family: 'Raleway', sans-serif;
}

@media (max-width: 768px) {
    .program-tabs {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .program-tab {
        padding: 16px 12px;
    }
    
    .program-name {
        font-size: 0.9em;
    }
}
