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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #f5f0e6;
    --bg-secondary: #fff;
    --text-color: #333;
    --text-light: #666;
    --correct: #4caf50;
    --incorrect: #f44336;
    --accent: #2196f3;
    --accent-light: #64b5f6;
    --shadow: rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --clock-face: #fff;
    --clock-border: #333;
    --hour-hand: #222;
    --minute-hand: #2196f3;
}

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;
}

.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);
}

.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
}

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

.status-item {
    text-align: center;
    flex-shrink: 0;
}

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

.progress-container {
    flex: 1;
    height: 6px;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
}

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

.start-section {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px var(--shadow);
}

.start-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.start-section h2 {
    margin-bottom: 10px;
    color: var(--text-color);
}

.start-section p {
    color: var(--text-light);
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.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;
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.2rem;
}

.hidden {
    display: none !important;
}

/* Sekcja gry */
.game-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.time-display {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 10px 25px;
    box-shadow: 0 4px 15px var(--shadow);
    text-align: center;
}

.time-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 2px;
}

.time-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-color);
    font-family: 'Consolas', 'Courier New', monospace;
}

.clock-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 4px 15px var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: visible;
}

.bubbles-container {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: none;
}

.point-bubble {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
    animation: bubble-float 2s ease-out forwards;
}

@keyframes bubble-float {
    0% {
        transform: scale(0) translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        transform: scale(1.2) translateY(0) translateX(0);
        opacity: 1;
    }
    20% {
        transform: scale(1) translateY(-20px) translateX(8px);
        opacity: 1;
    }
    40% {
        transform: scale(1) translateY(-60px) translateX(-8px);
        opacity: 1;
    }
    60% {
        transform: scale(1) translateY(-100px) translateX(8px);
        opacity: 1;
    }
    80% {
        transform: scale(0.9) translateY(-140px) translateX(-5px);
        opacity: 0.7;
    }
    100% {
        transform: scale(0.8) translateY(-180px) translateX(0);
        opacity: 0;
    }
}

.clock-container {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    overflow: visible;
}

#clock-svg {
    width: 100%;
    height: 100%;
    cursor: default;
    overflow: visible;
}

.clock-face {
    fill: var(--clock-face);
    stroke: var(--clock-border);
    stroke-width: 4;
}

.clock-center {
    fill: var(--clock-border);
}

.clock-number {
    font-family: 'Segoe UI', sans-serif;
    font-size: 24px;
    font-weight: bold;
    fill: var(--text-color);
    text-anchor: middle;
    dominant-baseline: central;
    user-select: none;
}

.minute-mark {
    stroke: #999;
    stroke-width: 1;
}

.hour-mark {
    stroke: var(--clock-border);
    stroke-width: 3;
}

.zone-divider {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 1;
    stroke-dasharray: 4 6;
}

.hour-hand {
    fill: var(--hour-hand);
    cursor: grab;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
    transition: filter 0.1s;
}

.hour-hand.hover,
.hour-hand.dragging {
    filter: drop-shadow(3px 3px 4px rgba(0,0,0,0.4));
    cursor: grabbing;
}

.minute-hand {
    fill: var(--minute-hand);
    cursor: grab;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
    transition: filter 0.1s;
}

.minute-hand.hover,
.minute-hand.dragging {
    filter: drop-shadow(3px 3px 4px rgba(0,0,0,0.4));
    cursor: grabbing;
}

.pin-marker {
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.pin-marker.active {
    opacity: 1;
}

.pin-marker.disabled {
    opacity: 0;
}

.pin-marker .pin-circle {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.pin-circle {
    stroke: #333;
    stroke-width: 2;
}

.pin-leg {
    stroke: #333;
    stroke-width: 3;
}

.pin-letter {
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: bold;
    fill: white;
    user-select: none;
}

.pin-marker.hour-pin .pin-circle {
    fill: var(--hour-hand);
}

.pin-marker.minute-pin .pin-circle {
    fill: var(--minute-hand);
}

.action-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

#feedback-container {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
}

#feedback-container.hidden {
    display: none;
}

.feedback {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.feedback.correct {
    background: var(--correct);
    color: white;
}

.feedback.partial {
    background: #ff9800;
    color: white;
}

.feedback.incorrect {
    background: var(--incorrect);
    color: white;
}

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

/* 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-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: 50px;
    text-align: center;
}

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

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

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

    .status-panel {
        gap: 20px;
        padding: 8px 10px;
        margin-bottom: 15px;
    }

    .status-value {
        font-size: 1.2rem;
    }

    .time-value {
        font-size: 1.5rem;
    }

    .clock-section {
        padding: 15px;
    }

    .clock-container {
        max-width: 300px;
    }

    .point-bubble {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    .clock-number {
        font-size: 18px;
    }

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

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

    .action-section {
        width: 100%;
    }

    .action-section .btn {
        flex: 1;
    }
}
