/* Modern Morse Code Training App Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --font-mono: 'Roboto Mono', monospace;
    --font-sans: 'Roboto', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background: linear-gradient(180deg, #000000, #fff500);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.header-logo {
    width: 200px;
    height: 200px;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.header-logo:hover {
    opacity: 0.8;
}

header h1 {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 2.5rem;
    color: #fbbf24;
    margin: 0;
}

/* Responsive header for smaller screens */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-logo {
        width: 150px;
        height: 150px;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

header p {
    color: yellow; /* Of elke andere kleur zoals blue, red, #ff6600, etc. */;
    font-size: 1.1rem;
}

/* Navigation Tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 30px;
    background-color: var(--surface);
    padding: 8px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background-color: var(--background);
    color: var(--text-primary);
}

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

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Animations */

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

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.card h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Form Elements */
.input-group, .output-group {
    margin-bottom: 20px;
}

.input-group label, .output-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

textarea, input[type="text"], select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-mono);
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

textarea:focus, input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea[readonly] {
    background-color: #f1f5f9;
    cursor: default;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: #475569;
}

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

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

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

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
    justify-content: center;
}

/* Training Display */
.training-display {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: var(--border-radius);
    margin: 20px 0;
}

#currentCharacter {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary-color);
    font-family: var(--font-mono);
}

#morseDisplay {
    font-size: 2rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    letter-spacing: 4px;
}

/* Training Stats */
.training-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.stat {
    text-align: center;
    padding: 12px;
    background: var(--background);
    border-radius: var(--border-radius);
    min-width: 80px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* Game Layout */
.main-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

.game-main {
    min-width: 0; /* Allow flexbox to shrink */
}

.highscores-sidebar .card {
    position: sticky;
    top: 20px;
    min-height: 700px;
}

/* Game Styles */
.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--background);
    border-radius: var(--border-radius);
}

/* Responsive layout for smaller screens */
@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .highscores-sidebar .card {
        position: static;
    }
}

.competitive-rules {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7, #fbbf24);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--warning-color);
}

.dropdown-rules .rules-header {
    cursor: pointer;
    user-select: none;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s ease;
}

.dropdown-rules .rules-header:hover {
    color: #92400e;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8em;
}

.dropdown-arrow.rotated {
    transform: rotate(180deg);
}

.rules-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
}

.rules-content.show {
    max-height: 300px;
    opacity: 1;
    margin-top: 12px;
}

.wide-input {
    width: 300px !important;
    max-width: 100%;
    font-size: 18px !important;
    text-align: center;
    padding: 16px !important;
}

.competitive-rules h3 {
    margin-bottom: 12px;
    color: #92400e;
    font-size: 1.1rem;
}

.competitive-rules ul {
    margin: 0;
    padding-left: 20px;
    color: #92400e;
}

.competitive-rules li {
    margin-bottom: 6px;
    font-weight: 500;
}

.game-stat {
    text-align: center;
    font-weight: 500;
}

.game-display {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #fef3c7, #fbbf24);
    border-radius: var(--border-radius);
    margin: 20px 0;
    position: relative;
}

#gameQuestion {
    font-size: 1.2rem;
    margin-bottom: 16px;
    font-weight: 500;
}

#gameMorse {
    font-size: 2rem;
    font-family: var(--font-mono);
    letter-spacing: 4px;
    color: #92400e;
    margin-bottom: 20px;
}

/* Time Progress Bar */
.time-progress-container {
    position: relative;
    width: 100%;
    height: 12px;
    background: rgba(146, 64, 14, 0.2);
    border-radius: 6px;
    margin: 20px 0 10px 0;
    overflow: hidden;
}

.time-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
    border-radius: 6px;
    width: 100%;
    transition: width 0.1s linear;
    transform-origin: left;
}

.time-progress-text {
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #92400e;
    font-family: var(--font-mono);
}

.game-input {
    margin: 20px 0;
    text-align: center;
}

.game-input input {
    font-size: 1.5rem;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    max-width: 200px;
    margin: 0 auto;
    display: block;
}

.auto-submit-info {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.game-result {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
}

.game-result.correct {
    background: #d1fae5;
    color: #065f46;
}

.game-result.wrong {
    background: #fee2e2;
    color: #991b1b;
}

/* Settings */
.setting-group {
    margin-bottom: 24px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="range"] {
    width: 100%;
    margin: 8px 0;
}

input[type="checkbox"] {
    margin-right: 8px;
}

/* Scores */
.score-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.scores-list {
    max-height: 500px;
    overflow-y: auto;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.score-item:last-child {
    border-bottom: none;
}

/* Reference Card */
.reference-card {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.morse-ref {
    position: absolute;
    bottom: 50px;
    right: 0;
    background: var(--surface);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.morse-ref.hidden {
    display: none;
}

.morse-ref h3 {
    margin-bottom: 16px;
    font-size: 1.2rem;
}

#morseChart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 14px;
}

.morse-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    background: var(--background);
    border-radius: 4px;
}

/* Training Controls */
.training-controls {
    margin-bottom: 20px;
}

.training-controls label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.training-controls select {
    width: 100%;
    max-width: 300px;
}

/* Visual Feedback */
.morse-visual {
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    margin: 8px 0;
    transition: opacity 0.1s ease;
}

.morse-visual.dit {
    width: 20px;
}

.morse-visual.dah {
    width: 60px;
}

.morse-visual.off {
    opacity: 0.2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        min-width: auto;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .game-display {
        padding: 20px 16px;
    }
    
    #currentCharacter {
        font-size: 3rem;
    }
    
    .game-input input {
        font-size: 1.8rem;
        max-width: 150px;
    }
    
    .auto-submit-info {
        font-size: 0.8rem;
        margin-top: 12px;
    }
    
    .time-progress-text {
        font-size: 0.8rem;
    }
    
    .training-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .game-info {
        flex-direction: column;
        gap: 12px;
    }
    
    .game-input {
        flex-direction: column;
    }
    
    .reference-card {
        position: static;
        margin: 20px 0;
    }
    
    .morse-ref {
        position: static;
        width: 100%;
        box-shadow: var(--shadow);
    }
    
    .score-controls {
        flex-direction: column;
    }
}

/* Animation Classes */
.pulse {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}