/* ОБЩИЕ СТИЛИ СБРОСА И ШРИФТЫ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #ffffff;
    color: #111111;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.row-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ЭКРАН АВТОРИЗАЦИИ */
.card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.card h1 {
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 700;
}

.card p {
    color: #666666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    gap: 10px;
}

input[type="text"], input[type="number"], input[type="password"] {
    flex: 1;
    padding: 12px;
    border: 1px solid #111111;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
}

button {
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary, #btn-auth {
    background: #111111;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
}

.btn-primary:hover, #btn-auth:hover {
    background: #333333;
}

.error-text {
    color: #ff3333;
    font-size: 13px;
    margin-top: 12px;
    text-align: left;
}

/* ГЛАВНЫЙ ИНТЕРФЕЙС */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 30px;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo span {
    font-weight: 300;
    color: #666666;
}

.status-badge {
    background: #f0f0f0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e0e0e0;
}

/* СЕТКА ХОЛСТА И СЕЙДБАРОВ */
/* Элементы управления в шапке */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px; /* Отступ между ссылкой и плашкой статуса */
}

/* Ссылка для администратора */
.admin-link {
    color: #666666;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.admin-link:hover {
    color: #111111;
    text-decoration: underline;
}

/* Правило для печати (чтобы ссылка не отображалась на распечатке) */
@media print {
    .admin-link {
        display: none !important;
    }
}

.main-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 40px;
}

@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
}

.panel h3 {
    font-size: 16px;
    margin-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 6px;
}

/* Инструкция */
.steps-list {
    padding-left: 20px;
}

.steps-list li {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 10px;
    color: #444444;
}

/* Блок загрузки */
.upload-panel {
    text-align: center;
}

.upload-btn {
    display: inline-block;
    background: #111111;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin: 10px 0;
}

.upload-btn:hover {
    background: #333333;
}

.hint {
    font-size: 11px;
    color: #888888;
}

/* Плеер */
.progress-container {
    text-align: center;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
}

.progress-text {
    font-size: 14px;
    color: #666666;
}

.current-instruction {
    font-size: 24px;
    font-weight: 800;
    margin-top: 8px;
}

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

.btn-secondary {
    background: #ffffff;
    border: 1px solid #111111;
    color: #111111;
    padding: 10px 18px;
    border-radius: 4px;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #f5f5f5;
}

.settings-group {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    gap: 5px;
    margin-bottom: 15px;
}

.btn-text {
    background: none;
    border: none;
    color: #0066cc;
    font-size: 13px;
    text-decoration: underline;
    width: 100%;
    text-align: center;
    cursor: pointer;
}

/* ПРАВАЯ ЧАСТЬ - ИНТЕРАКТИВНЫЙ ХОЛСТ */
.content-area {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.canvas-wrapper {
    position: relative;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    border-radius: 6px;
    padding: 10px;
    display: inline-block;
}

#string-canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Лоадер */
.loader-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #111111;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ПРАВИЛА ДЛЯ ПЕЧАТИ */
@media print {
    body, #auth-screen, .sidebar, .header, .status-badge, .loader-overlay, button, .panel, .voice-control-box, .player-buttons, .settings-group {
        display: none !important;
    }
    
    .container, .main-layout, .content-area, .canvas-wrapper {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    #string-canvas {
        max-width: 100% !important;
        width: 18cm !important;
        height: 18cm !important;
        margin: 0 auto !important;
        page-break-inside: avoid;
    }
}