/**
 * Morsecode-Übersetzer Tool Styles
 * Nutzt CSS-Variablen aus style.css für Konsistenz
 */

.morse-tool {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 2rem 0;
}

.morse-tool-title {
    margin: 0 0 1rem 0;
    font-size: var(--h3-size);
    color: var(--text);
}

/* Input/Output Groups */
.morse-input-group,
.morse-output-group {
    margin-bottom: 1rem;
}

.morse-input-group label,
.morse-output-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.morse-tool textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    background: white;
    color: var(--text);
    transition: border-color 0.2s;
}

.morse-tool textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.morse-tool textarea.morse-output {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2rem;
    letter-spacing: 2px;
    line-height: 1.8;
}

.morse-tool textarea[readonly] {
    background: var(--bg);
    cursor: default;
}

/* Controls - nutzt bestehende .btn Klassen */
.morse-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* Play Button - grün wie .btn-success */
.morse-controls .btn-play {
    background: var(--success);
    color: white;
}

.morse-controls .btn-play:hover {
    background: #15803d;
}

.morse-controls .btn-play.playing {
    background: var(--error);
}

.morse-controls .btn-play.playing::before {
    content: '◼ ';
}

/* Download Button */
.morse-controls .btn-download {
    background: var(--text-light);
    color: white;
}

.morse-controls .btn-download:hover {
    background: var(--text);
}

.morse-controls .btn-download:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* WPM Slider */
.wpm-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.wpm-control label {
    font-size: 0.9rem;
    color: var(--text-light);
    white-space: nowrap;
}

.wpm-control #wpm-value {
    font-weight: 600;
    color: var(--primary);
    min-width: 2ch;
    display: inline-block;
    text-align: right;
}

.wpm-control input[type="range"] {
    width: 120px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Error Message */
.morse-error {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.morse-error.visible {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .morse-tool {
        padding: 1rem;
    }

    .morse-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .morse-controls .btn {
        width: 100%;
        text-align: center;
    }

    .wpm-control {
        margin-left: 0;
        margin-top: 0.5rem;
        justify-content: space-between;
        width: 100%;
    }

    .wpm-control input[type="range"] {
        flex: 1;
    }

    .morse-tool textarea.morse-output {
        font-size: 1rem;
        letter-spacing: 1px;
    }
}

@media (max-width: 480px) {
    .morse-tool textarea {
        min-height: 80px;
    }
}
