/* Layout & Basis-Styles */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-panel: rgba(22, 27, 34, 0.92);
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-blue: #58a6ff;
    --accent-orange: #d29922;
    --accent-green: #3fb950;
    --accent-red: #f85149;
    --accent-red-dark: #8b1a10;
}

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    background-image: url('../assets/images/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 17, 23, 0.85);
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    flex-shrink: 0;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-title {
    font-size: 1.3em;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-blue);
    white-space: nowrap;
}

.header-callsign {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.header-callsign label {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.header-callsign input {
    width: 120px;
    padding: 4px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.95em;
    font-weight: 600;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    white-space: nowrap;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-connected { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.status-disconnected { background: var(--accent-red); }
.status-connecting { background: var(--accent-orange); animation: pulse 1s infinite; }

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

#status-text {
    font-size: 0.85em;
    color: var(--text-secondary);
}

#clock {
    font-size: 0.85em;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.platzinfo-row {
    margin-top: 6px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.platzinfo-row span:first-child {
    color: var(--accent-orange);
    font-weight: 600;
}

#platzinfo {
    color: var(--text-primary);
}

/* Control Bar */
.control-bar {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 6px 20px;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-bar-left {
    display: flex;
    gap: 8px;
}

.control-bar-right {
    display: flex;
    gap: 8px;
}

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

.column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.column:first-child {
    border-right: 1px solid var(--border);
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.column-header-title {
    flex: 1;
}

.pattern-toggle-btn {
    padding: 4px 8px;
    margin-left: 8px;
    font-size: 0.75em;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-bottom: 2px solid rgba(0, 0, 0, 0.4);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.1s ease;
    white-space: nowrap;
    opacity: 0.6;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
    transform: translateY(0);
}

.pattern-toggle-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.08);
    opacity: 0.85;
}

.pattern-toggle-btn.active {
    opacity: 1;
    color: #FFD700;
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.5);
    border-bottom-width: 1px;
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.4);
    transform: translateY(1px);
}

.pattern-toggle-btn.active:hover {
    background: rgba(255, 215, 0, 0.12);
}

.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
    background: var(--bg-panel);
}

/* Single-window layout */
.main-content-single {
    flex: 1;
    display: none;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.main-content-single.active {
    display: flex;
}

/* Input area */
.input-area {
    display: flex;
    border-top: 1px solid var(--border);
    background: var(--bg-panel);
    flex-shrink: 0;
}

.input-section {
    flex: 1;
    padding: 12px 16px;
}

.input-section:first-child {
    border-right: 1px solid var(--border);
}
