/**
 * style.css - Style aplikacji do nauki nut
 */

/* Reset i podstawy */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #f5f0e6;
    --bg-secondary: #fff;
    --text-color: #333;
    --text-light: #666;
    --staff-color: #333;
    --note-color: #222;
    --key-white: #fff;
    --key-black: #222;
    --correct: #4caf50;
    --incorrect: #f44336;
    --accent: #2196f3;
    --accent-light: #64b5f6;
    --shadow: rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
}

/* Nagłówek */
.header {
    background: var(--bg-secondary);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
}

.logo-icon {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s;
}

.nav-link:hover {
    background: var(--accent-light);
}

/* Kontener główny */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Sekcja pięciolinii */
.staff-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px var(--shadow);
}

.staff-canvas-container {
    width: 100%;
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#staff-canvas {
    max-width: 100%;
}

/* Panel statusu */
.status-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 80px;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: 0 2px 10px var(--shadow);
}

.status-item {
    text-align: center;
}

.status-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
}

.status-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Pasek postępu */
.progress-container {
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Sekcja klawiatury */
.piano-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 4px 15px var(--shadow);
    display: flex;
    justify-content: center;
    overflow: hidden;
}

/* Przyciski */
.btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #ddd;
    color: var(--text-color);
}

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

.start-section {
    text-align: center;
    padding: 40px 20px;
}

.start-section h2 {
    margin-bottom: 10px;
}

.start-section p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Panel wyników */
.result-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.result-content {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideIn 0.3s ease;
}

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

.result-emoji {
    font-size: 4rem;
    margin-bottom: 10px;
}

.result-content h2 {
    margin-bottom: 20px;
    color: var(--accent);
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Strona konfiguracji */
.config-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.config-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 4px 15px var(--shadow);
}

.config-card h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--accent);
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.form-group-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.radio-option:hover,
.checkbox-option:hover {
    background: #eee;
}

.radio-option input,
.checkbox-option input {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}

/* Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    flex: 1;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.slider-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
    min-width: 30px;
    text-align: center;
}

/* Select */
select {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Przyciski formularza */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.form-actions .btn {
    flex: 1;
}

/* Responsywność */
@media (max-width: 1200px) {
    .piano-keyboard {
        transform: scale(0.83);
        transform-origin: center top;
    }
}

@media (max-width: 800px) {
    .piano-keyboard {
        transform: scale(0.6);
    }
}

@media (max-width: 600px) {
    .piano-keyboard {
        transform: scale(0.5);
    }
}

@media (max-width: 480px) {
    .piano-keyboard {
        transform: scale(0.4);
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        gap: 10px;
    }

    .status-panel {
        flex-direction: column;
        gap: 15px;
    }

    .result-stats {
        flex-direction: column;
        gap: 15px;
    }

    .form-actions {
        flex-direction: column;
    }

    .piano-section {
        padding: 10px;
    }
}

/* Animacje */
@keyframes correct-flash {
    0%, 100% { background-color: var(--correct); }
    50% { background-color: #81c784; }
}

@keyframes wrong-flash {
    0%, 100% { background-color: var(--incorrect); }
    50% { background-color: #e57373; }
}

/* Pomocnicze */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}
