/*
Copyright (c) 2026 Georgalas Athanasios Antonios, SV1TEU

This software is released under the MIT License.
See the LICENSE file in the repository root for full license text.
*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    background: rgba(25, 25, 25, 0.95);
}

/* Header */
header {
    background: linear-gradient(135deg, #0a3a0a 0%, #1a6a1a 100%);
    padding: 12px 20px;
    border-bottom: 2px solid #0f0;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

h1 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 4px;
    text-align: center;
}

.subtitle {
    color: #a0ffa0;
    font-size: 0.75rem;
    opacity: 0.9;
    text-align: center;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Left Sidebar */
.sidebar {
    width: 380px;
    background: rgba(30, 30, 30, 0.9);
    border-right: 1px solid #333;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0;
}

/* Sections */
.section {
    background: rgba(40, 40, 40, 0.8);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #444;
}

.section h2 {
    color: #0f0;
    font-size: 1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form Elements */
.form-group {
    margin-bottom: 15px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}
label {
    display: block;
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 6px;
    font-weight: 500;
}

select, input, textarea {
    width: 100%;
    background: #222;
    color: #0f0;
    border: 1px solid #333;
    padding: 10px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    transition: all 0.2s;
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: #0f0;
    box-shadow: 0 0 0 2px rgba(0, 255, 0, 0.2);
}

select {
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.checkbox-group input {
    width: auto;
}

.checkbox-group label {
    margin-bottom: 0;
    flex: 1;
    font-size: 0.8rem;
}

/* Right Output Panel */
.output-panel {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.output-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.output-card {
    background: #000;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.output-title {
    color: #0f0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    background: #333;
    color: #aaa;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.btn-icon:hover {
    background: #444;
    color: #fff;
}

.btn-icon.playing {
    background: #8a0a0a;
    color: #fff;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.output-content {
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #0f0;
    padding: 12px;
    background: #111;
    border-radius: 8px;
    border: 1px solid #222;
    font-weight: 500;
    overflow-y: auto;
    flex: 1;
    min-height: 150px;
}

/* Status Indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0f0;
}

.status-dot.playing {
    background: #f00;
    animation: pulse 1.5s infinite;
}

/* Playback Controls */
.playback-controls {
    background: rgba(30, 30, 30, 0.9);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid #444;
    flex-shrink: 0;
}

.playback-type {
    display: flex;
    gap: 10px;
    align-items: center;
}

.playback-type span {
    color: #aaa;
    font-size: 0.75rem;
    min-width: 70px;
}

.type-buttons {
    display: flex;
    gap: 4px;
}

.type-btn {
    background: #333;
    color: #aaa;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.type-btn:hover {
    background: #444;
}

.type-btn.active {
    background: #0a5a0a;
    color: #0f0;
}

.playback-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.playback-btn {
    background: linear-gradient(135deg, #1a6a1a 0%, #0f0 100%);
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.8rem;
    transition: all 0.2s;
    min-width: 100px;
}

.playback-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0f0 0%, #1a6a1a 100%);
    transform: translateY(-1px);
}

.playback-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.playback-btn.stop {
    background: linear-gradient(135deg, #8a0a0a 0%, #f00 100%);
    min-width: 80px;
}

.playback-btn.stop:hover:not(:disabled) {
    background: linear-gradient(135deg, #f00 0%, #8a0a0a 100%);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.control-group > div:first-child {
    font-size: 0.7rem;
    color: #aaa;
}

.playback-speed {
    display: flex;
    align-items: center;
    gap: 6px;
}

.playback-speed input {
    flex: 1;
    background: #222;
    border: 1px solid #444;
    padding: 4px 6px;
    border-radius: 4px;
    color: #0f0;
    font-size: 0.8rem;
    min-width: 60px;
}

.playback-speed span {
    color: #0f0;
    font-size: 0.75rem;
    min-width: 35px;
}

/* Branding Footer */
.branding-footer {
    margin-top: 15px;
    padding: 10px;
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    border-top: 1px solid #333;
}

.branding-footer p {
    margin: 5px 0;
}

.branding-footer .version {
    font-size: 0.7rem;
    color: #888;
}

/* Morse Code Styling */
.callsign {
    color: #ff9900;
    font-weight: bold;
    text-decoration: underline;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #222;
}

::-webkit-scrollbar-thumb {
    background: #0a5a0a;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0f0;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid #333;
    }
    
    .output-panel {
        min-height: 50vh;
    }
    
    .output-content {
        font-size: 13px;
        min-height: 120px;
    }
    
    h1 {
        font-size: 1rem;
    }
    
    .subtitle {
        font-size: 0.7rem;
    }
    
    .playback-controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .playback-btn, .playback-btn.stop {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    header {
        padding: 10px 15px;
    }
    
    .sidebar, .output-panel {
        padding: 10px;
    }
    
    .section {
        padding: 12px;
    }
    
    .output-card {
        padding: 12px;
    }
    
    .output-content {
        padding: 10px;
        font-size: 12px;
    }
}
.cw-decoder-wrapper {
    margin-bottom: 12px;
}

.cw-decode-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.cw-pill {
    background: #0a5a0a;
    color: #eaffea;
    border: 1px solid #0f0;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cw-pill.active {
    background: #8a0a0a;
    border-color: #f00;
}

.cw-status {
    font-size: 0.7rem;
    color: #aaa;
}

.cw-decoded-overlay {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #9dff9d;
    background: #071507;
    border: 1px solid #114411;
    padding: 6px 8px;
    border-radius: 6px;
    max-height: 60px;
    overflow-y: auto;
    white-space: pre-wrap;
}
/* Donate button (header, top-right) */
header {
    position: relative; /* allow absolutely-positioned donate button */
}

.donate-header {
    position: absolute;
    top: 10px;
    right: 12px;
}

.donate-header form {
    margin: 0;
}

.donate-header input[type="image"] {
    display: block;
}

/* CW Decoder Enhanced Styles - Add to your existing CSS file */

.cw-controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.cw-status-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1a1a1a;
    padding: 4px 12px 4px 16px;
    border-radius: 30px;
    border: 1px solid #333;
}

.cw-decoder-info {
    color: #8f8;
    font-size: 13px;
    font-weight: 500;
}

.cw-checkbox-container {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1a2a1a;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #2a6f2a;
    font-size: 12px;
    color: #8f8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cw-checkbox-container:hover {
    background: #1f3a1f;
    border-color: #0f0;
}

.cw-checkbox-container input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #0f0;
    margin: 0;
}

.cw-checkbox-container label {
    margin: 0;
    cursor: pointer;
    color: #8f8;
    font-size: 12px;
}

.cw-start-btn {
    background: linear-gradient(135deg, #1a6a1a 0%, #0f0 100%);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    min-width: 100px;
    border: 1px solid #2a8f2a;
}

.cw-start-btn:hover {
    background: linear-gradient(135deg, #0f0 0%, #1a6a1a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.2);
}

.cw-start-btn.active {
    background: linear-gradient(135deg, #8a0a0a 0%, #f44 100%);
    border-color: #f66;
}

.cw-start-btn.active:hover {
    background: linear-gradient(135deg, #f44 0%, #8a0a0a 100%);
}

.cw-decoded-overlay {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #0f0;
    background: #0a0f0a;
    border: 2px solid #1a4a1a;
    padding: 10px 12px;
    border-radius: 8px;
    min-height: 40px;
    max-height: 40px;
    width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    line-height: 1.4;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 15px rgba(0, 50, 0, 0.5);
    scroll-behavior: smooth;
}

.cw-decoded-overlay.expanded {
    max-height: 600px;
    min-height: 400px;
    white-space: pre-wrap !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    font-size: 13px;
    background: #0a120a;
    border-color: #2f8f2f;
    box-shadow: inset 0 0 20px rgba(0, 100, 0, 0.3);
}

/* Custom scrollbar for the overlay */
.cw-decoded-overlay::-webkit-scrollbar {
    height: 6px;
    width: 8px;
}

.cw-decoded-overlay::-webkit-scrollbar-track {
    background: #1a2a1a;
    border-radius: 4px;
}

.cw-decoded-overlay::-webkit-scrollbar-thumb {
    background: #2a8f2a;
    border-radius: 4px;
    border: 1px solid #0a3a0a;
}

.cw-decoded-overlay::-webkit-scrollbar-thumb:hover {
    background: #0f0;
}

.cw-status-text {
    font-family: monospace;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 16px;
    background: #1a1a1a;
    display: inline-block;
    font-size: 13px;
    border: 1px solid #333;
    margin-top: 8px;
}

.cw-debug-info {
    background: #1a1a1a;
    color: #888;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    margin-top: 8px;
    border-left: 3px solid #2a8f2a;
    font-family: monospace;
    min-height: 20px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .cw-controls-wrapper {
        gap: 10px;
    }
    
    .cw-status-wrapper {
        padding: 4px 8px 4px 12px;
    }
    
    .cw-decoder-info {
        font-size: 12px;
    }
    
    .cw-checkbox-container {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .cw-start-btn {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 80px;
    }
    
    .cw-decoded-overlay {
        min-height: 36px;
        max-height: 36px;
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .cw-decoded-overlay.expanded {
        max-height: 350px;
        min-height: 350px;
    }
}

/* =============================================================
   NEW — appended for v1.8 prosign support
   ============================================================= */

/* Larger textarea to fit templates without scrolling */
textarea {
    min-height: 180px;
}

/* Prosign highlight in expanded text output */
.prosign {
    color: #00ccff;
    font-weight: bold;
    letter-spacing: 0.03em;
}

/* Prosign chip bar below textarea */
.prosign-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.prosign-btn {
    background: transparent;
    border: 1px solid #1a4a55;
    color: #4ab8cc;
    border-radius: 4px;
    padding: 2px 7px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    font-weight: bold;
    line-height: 1.6;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.prosign-btn:hover {
    background: #0e2a35;
    border-color: #00ccff;
    color: #00eeff;
}

.prosign-btn:active {
    background: #0a3d4d;
}

.prosign-tooltip {
    margin-top: 4px;
    font-size: 0.68rem;
    color: #4a8a9a;
    min-height: 1em;
    font-style: italic;
    line-height: 1.3;
}
