/* AFSK Modem Web Application - Classic 2000s Style */

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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #000000;
    line-height: 1.4;
    padding: 20px;
}

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

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #cccccc;
    border: 2px solid #000000;
    position: relative;
}

/* TX Mode Header - Green */
header.tx-header {
    background: #ccffcc;
    border: 3px solid #000000;
}

header.tx-header h1 {
    color: #00aa00;
}

/* RX Mode Header - Blue */
header.rx-header {
    background: #ccccff;
    border: 3px solid #000000;
}

header.rx-header h1 {
    color: #0000aa;
}

header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #000000;
    font-weight: bold;
}

.subtitle {
    color: #333333;
    font-size: 14px;
}

.back-button {
    position: absolute;
    left: 10px;
    top: 10px;
    padding: 5px 15px;
    background: #dddddd;
    color: #000000;
    text-decoration: none;
    border: 2px solid #000000;
    font-weight: bold;
}

.back-button:hover {
    background: #aaaaaa;
}

/* Main Menu Styles */
.menu {
    padding: 20px 0;
}

.button-container {
    display: table;
    width: 100%;
    border-collapse: collapse;
}

.mode-button {
    display: table-cell;
    width: 50%;
    padding: 40px 20px;
    text-align: center;
    border: 3px solid #000000;
    text-decoration: none;
    background: #f0f0f0;
}

.mode-button:first-child {
    border-right: 1px solid #000000;
}

.mode-button:hover {
    background: #e0e0e0;
}

.tx-button {
    background: #ccffcc;
}

.tx-button:hover {
    background: #99ff99;
}

.rx-button {
    background: #ccccff;
}

.rx-button:hover {
    background: #9999ff;
}

.button-icon {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
}

.tx-button .button-icon {
    color: #00aa00;
}

.rx-button .button-icon {
    color: #0000aa;
}

.button-label {
    font-size: 20px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 5px;
    display: block;
}

.button-description {
    color: #333333;
    font-size: 12px;
}

/* Form Styles */
.input-section, .record-section, .decode-section, .result-section, .output-section {
    background: #f5f5f5;
    padding: 20px;
    border: 2px solid #000000;
    margin-bottom: 20px;
}

.input-section h2,
.record-section h2,
.decode-section h2,
.result-section h2,
.output-section h2 {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: bold;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #000000;
}

textarea {
    width: 100%;
    padding: 10px;
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 5px;
}

textarea:focus {
    outline: 2px solid #0000ff;
}

.char-counter {
    text-align: right;
    color: #666666;
    font-size: 12px;
    margin-bottom: 10px;
}

/* Button Styles */
.action-button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid #000000;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.action-button.tx-button {
    background: #00cc00;
    color: #ffffff;
}

.action-button.tx-button:hover {
    background: #009900;
}

.action-button.rx-button {
    background: #0000ff;
    color: #ffffff;
}

.action-button.rx-button:hover {
    background: #0000cc;
}

.action-button.danger-button {
    background: #ff0000;
    color: #ffffff;
}

.action-button.danger-button:hover {
    background: #cc0000;
}

.action-button.secondary-button {
    background: #666666;
    color: #ffffff;
}

.action-button.secondary-button:hover {
    background: #444444;
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Waveform Display */
.waveform-container {
    background: #ffffff;
    border: 2px solid #000000;
    padding: 10px;
    margin: 10px 0;
}

#waveformCanvas {
    width: 100%;
    height: 150px;
    display: block;
    background: #ffffff;
}

/* Audio Controls */
.audio-controls {
    margin: 15px 0;
}

audio {
    width: 100%;
}

/* Recording Indicator */
.recording-indicator {
    text-align: center;
    margin-top: 10px;
    color: #ff0000;
    font-weight: bold;
}

.pulse {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #ff0000;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Decoded Text Display */
.decoded-text {
    background: #ffffff;
    padding: 15px;
    border: 2px solid #000000;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    min-height: 100px;
    word-wrap: break-word;
    margin-bottom: 10px;
}

/* Divider */
.divider {
    text-align: center;
    margin: 20px 0 15px 0;
    position: relative;
    height: 20px;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 2px;
    background: #000000;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    color: #000000;
    background: #f5f5f5;
    padding: 0 10px;
    font-size: 14px;
    font-weight: bold;
}

/* Upload Section */
.upload-section {
    text-align: center;
    margin-top: 10px;
}

.upload-label {
    display: block;
    margin-bottom: 5px;
    color: #333333;
    font-size: 12px;
}

.upload-filename {
    margin-top: 5px;
    color: #000000;
    font-size: 12px;
    min-height: 20px;
    font-weight: bold;
}

/* Error Messages */
.error-message {
    color: #cc0000;
    padding: 10px;
    margin-top: 10px;
    border: 2px solid #cc0000;
    background: #ffcccc;
    display: none;
    font-weight: bold;
}

.error-message.show {
    display: block;
}

/* Instructions */
.instruction {
    color: #333333;
    text-align: center;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #000000;
    color: #666666;
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 18px;
    }
    
    .button-container {
        display: block;
    }
    
    .mode-button {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .mode-button:first-child {
        border-right: 3px solid #000000;
    }
    
    .back-button {
        position: static;
        display: inline-block;
        margin-bottom: 10px;
    }
}

/* Action Button Container */
.action-buttons {
    margin-top: 10px;
}

.recording-controls {
    margin-top: 10px;
}
