/* CW Practice Platform - Styles */

:root {
    --primary-color: #2c5f2d;
    --primary-hover: #1e4620;
    --secondary-color: #555;
    --bg-color: #f5f5f5;
    --bg-dark: #2b2b2b;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --panel-bg: #fff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

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

/* Header */
header {
    background: var(--primary-color);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-icon, .btn-control {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}

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

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

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

.btn-secondary:hover {
    background: #666;
}

.btn-icon {
    padding: 0.5rem;
    font-size: 1.2rem;
    background: transparent;
    border: 1px solid var(--border-color);
}

.btn-icon:hover {
    background: var(--bg-color);
}

/* Sections */
section {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--panel-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* Quick Join */
.quick-join {
    background: linear-gradient(135deg, #2c5f2d 0%, #1e4620 100%);
    color: white;
}

.quick-join h2 {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.room-form {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.room-form input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
}

.room-form input:focus {
    outline: none;
    border-color: white;
}

.hint {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Schedule */
.sked-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.sked-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.sked-card .day {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.sked-card .time {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.sked-card .speed {
    font-weight: bold;
    margin: 0.5rem 0;
}

.sked-card .detail {
    color: var(--text-light);
    font-size: 0.9rem;
}

.current-time {
    text-align: center;
    margin-top: 1.5rem;
    font-weight: bold;
    font-size: 1.1rem;
}

/* How It Works */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.step {
    text-align: center;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.step h3 {
    margin-bottom: 0.5rem;
}

/* Features */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature {
    text-align: center;
    padding: 1.5rem;
}

.feature .icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.feature h3 {
    margin-bottom: 0.5rem;
}

/* Technical Specs */
.tech-specs {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.spec {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.spec:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.spec h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.spec p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.spec strong {
    color: var(--text-color);
    font-weight: bold;
}

/* Code Block */
.code-block {
    background: var(--bg-dark);
    color: #f0f0f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.code-block code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Active Rooms */
.rooms-list {
    display: grid;
    gap: 1rem;
}

.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 4px;
    border-left: 3px solid var(--success-color);
}

.room-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.operator-count {
    color: var(--success-color);
}

/* FAQ */
details {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 4px;
}

summary {
    cursor: pointer;
    font-weight: bold;
    padding: 0.5rem;
}

summary:hover {
    color: var(--primary-color);
}

details[open] summary {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

footer a {
    color: white;
    text-decoration: none;
    margin: 0 0.5rem;
}

footer a:hover {
    text-decoration: underline;
}

.footer-73 {
    font-size: 1.2rem;
    margin-top: 1rem;
}

/* Room Page */
.room-page {
    background: var(--bg-dark);
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

.room-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.room-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.room-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.connection-status {
    font-size: 0.9rem;
}

.status-connected { color: #4caf50; }
.status-connecting { color: #ff9800; }
.status-disconnected { color: #f44336; }

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.callsign {
    font-weight: bold;
    font-size: 1.2rem;
}

/* Room Layout */
.room-layout {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 1rem;
    padding: 1rem;
    flex: 1;
    overflow: hidden;
}

.operators-panel, .settings-panel {
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-y: auto;
    color: var(--text-color);
}

.operators-panel h2, .settings-panel h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.operators-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.operator-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 4px;
}

.operator-callsign {
    font-weight: bold;
}

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

.status-connecting { color: var(--warning-color); }
.status-connected { color: var(--success-color); }

.panel-divider {
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.stats-panel h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bg-color);
}

/* Main Panel */
.main-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.decoded-text-container {
    flex: 1;
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.decoded-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.decoded-header h2 {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.decoded-text {
    flex: 1;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 4px;
}

.decoded-line {
    margin-bottom: 0.5rem;
}

.timestamp {
    color: var(--text-light);
    font-size: 0.85rem;
}

.callsign-label {
    color: var(--primary-color);
    font-weight: bold;
}

.decoded-content {
    color: var(--text-color);
}

.system-message {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    margin: 1rem 0;
}

/* Audio Controls */
.audio-controls {
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    color: var(--text-color);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
}

.btn-control.active {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.btn-control .icon {
    font-size: 1.2rem;
}

input[type="range"] {
    width: 120px;
}

/* Settings Panel */
.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group h3 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.setting-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.setting-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    font-style: italic;
}

.setting-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
}

.connection-info {
    font-size: 0.9rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bg-color);
}

.status-indicator {
    font-weight: bold;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--text-color);
}

.shortcuts-table {
    width: 100%;
    margin: 1rem 0;
}

.shortcuts-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

kbd {
    background: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    font-family: monospace;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .room-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .operators-panel, .settings-panel {
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .room-form {
        flex-direction: column;
    }
    
    .sked-grid, .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .audio-controls {
        flex-direction: column;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
