:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --gray: #95a5a6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Шапка */
.header {
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    color: white;
}

.header .logo {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.header .logo i {
    font-size: 3em;
    color: var(--secondary);
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 5px;
    color: white;
}

.header .subtitle {
    opacity: 0.9;
    font-size: 1.1em;
}

.session-info {
    text-align: right;
    opacity: 0.7;
    font-size: 0.9em;
}

/* Навигация по модулям */
.module-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.module-btn {
    padding: 20px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}

.module-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--secondary);
}

.module-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.module-btn i {
    font-size: 2em;
    margin-bottom: 5px;
}

.module-btn span {
    font-size: 1.3em;
    font-weight: 600;
}

.module-btn small {
    font-size: 0.9em;
    opacity: 0.8;
}

.module-progress {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: bold;
}

/* Контейнер модуля */
.module-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    min-height: 400px;
}

.loading-message {
    text-align: center;
    padding: 50px;
    color: var(--gray);
}

.loading-message i {
    font-size: 3em;
    margin-bottom: 20px;
}

.error-message {
    text-align: center;
    padding: 50px;
    color: var(--danger);
}

.error-message i {
    font-size: 3em;
    margin-bottom: 20px;
}

.module-title {
    color: var(--primary);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--secondary);
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 15px;
}

.module-title i {
    color: var(--secondary);
}

/* Инструкции */
.instructions {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border-left: 5px solid var(--secondary);
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.instructions h3 {
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions p {
    margin-bottom: 10px;
    line-height: 1.7;
}

/* Пагинация */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    justify-content: center;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid var(--gray);
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: var(--light);
}

.pagination-btn.active {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.page-indicator {
    text-align: center;
    color: var(--gray);
    margin: 20px 0;
    font-style: italic;
}

/* Контейнер вопроса */
.question-container {
    margin-bottom: 25px;
    padding: 20px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: white;
}

.question-container:hover {
    border-color: var(--secondary);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
}

.question-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 15px;
}

.question-number {
    background: linear-gradient(135deg, var(--secondary) 0%, #2980b9 100%);
    color: white;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    flex-shrink: 0;
}

.question-text {
    font-size: 1.1em;
    color: var(--dark);
    line-height: 1.7;
    flex-grow: 1;
}

/* Варианты ответов */
.options-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.option-btn {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.option-btn:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
}

.option-btn.selected {
    background: linear-gradient(135deg, var(--success) 0%, #219653 100%);
    color: white;
    border-color: var(--success);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(39, 174, 96, 0.2);
}

.option-btn.selected::after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
}

/* Прогресс бар */
.progress-container {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin: 30px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.progress-bar {
    height: 12px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, #2ecc71 100%);
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.3) 50%, 
        rgba(255,255,255,0) 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
}

.progress-info {
    font-weight: 600;
    color: var(--primary);
}

.progress-percent {
    background: var(--primary);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

/* Кнопки навигации */
.navigation-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.nav-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.nav-btn.prev {
    background: var(--gray);
    color: white;
}

.nav-btn.next {
    background: var(--secondary);
    color: white;
}

.nav-btn.complete {
    background: linear-gradient(135deg, var(--success) 0%, #27ae60 100%);
    color: white;
}

.nav-btn.complete:hover {
    background: linear-gradient(135deg, #219653 0%, #1e874b 100%);
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    border-top: 1px solid #eee;
}

.results-section {
    margin-bottom: 30px;
}

.results-section h4 {
    color: var(--primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light);
}

.scale-result {
    padding: 10px 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--secondary);
}

.scale-result.suicidal {
    border-left-color: var(--danger);
    background: #fee;
}

.scale-result.ptsd {
    border-left-color: var(--warning);
    background: #fff3cd;
}

.scale-result.adaptability {
    border-left-color: var(--success);
    background: #d4edda;
}

.scale-result.total {
    border-left-color: var(--primary);
    background: #e2e3e5;
    font-weight: bold;
}

/* Кнопки действий */
.action-btn {
    padding: 12px 25px;
    background: var(--secondary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.action-btn:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Футер */
.footer {
    margin-top: 50px;
    padding: 20px;
    text-align: center;
    color: var(--gray);
    border-top: 1px solid #eee;
    background: white;
    border-radius: 10px;
}

.footer p {
    margin: 5px 0;
    font-size: 0.9em;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .module-nav {
        grid-template-columns: 1fr;
    }
    
    .module-container {
        padding: 20px;
    }
    
    .question-container {
        padding: 15px;
    }
    
    .options-container {
        grid-template-columns: 1fr;
    }
    
    .option-btn {
        font-size: 13px;
        padding: 10px;
    }
    
    .navigation-buttons {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .question-number {
        width: 35px;
        height: 35px;
        font-size: 1em;
    }
    
    .module-title {
        font-size: 1.5em;
    }
    
    .pagination {
        gap: 3px;
    }
    
    .pagination-btn {
        padding: 6px 8px;
        font-size: 0.9em;
    }
}


/* Добавьте в конец файла style.css */

.page-completion-status {
    text-align: center;
    margin: 15px 0;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.page-completion-status.complete {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.page-completion-status.incomplete {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.page-completion-status i {
    margin-right: 8px;
}