/* ==========================================================================
   SAILOR 6222 VHF DSC Class A Simulator - Design System & Styling
   ========================================================================== */

/* Global resets & variables */
:root {
    --bg-dark: #0f1115;
    --bg-card: #181d24;
    --bg-bezel: #2d333e;
    --border-color: #384252;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    
    --neon-green: #10b981;
    --neon-red: #ef4444;
    --neon-orange: #f97316;
    --neon-blue: #3b82f6;

    /* Day LCD Theme */
    --lcd-bg-day: #dfebd4;
    --lcd-text-day: #1f2937;
    --lcd-border-day: #b4c7a5;
    --lcd-tint-day: rgba(0, 0, 0, 0.05);

    /* Night LCD Theme */
    --lcd-bg-night: #060000;
    --lcd-text-night: #ff2222;
    --lcd-border-night: #440000;
    --lcd-tint-night: rgba(255, 0, 0, 0.1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.brand svg {
    color: var(--neon-blue);
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.version-label {
    font-size: 0.7rem;
    background-color: var(--border-color);
    color: var(--text-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

.brand > span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-left: 1px solid var(--border-color);
    padding-left: 0.8rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-ctrl {
    background-color: #242b35;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-ctrl:hover {
    background-color: #2d3643;
    border-color: #4b5563;
}

.btn-ctrl.btn-accent {
    background-color: var(--neon-blue);
    border-color: var(--neon-blue);
}

.btn-ctrl.btn-accent:hover {
    background-color: #2563eb;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar styling */
.sidebar {
    width: 320px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sidebar-box {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
}

.sidebar-box h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.3rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.indicator-led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #4b5563;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    display: inline-block;
}

.indicator-led.online {
    background-color: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
}

.indicator-led.offline {
    background-color: var(--neon-red);
    box-shadow: 0 0 8px var(--neon-red);
}

/* Form elements */
.form-group {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input, 
.form-group textarea {
    background-color: #0f1115;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.45rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-group textarea {
    height: 60px;
    resize: none;
    font-size: 0.8rem;
}

.btn-apply {
    width: 100%;
    background-color: #242b35;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.25rem;
}

.btn-apply:hover {
    background-color: #2d3643;
    border-color: #4b5563;
}

.tool-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.tts-status-label {
    font-size: 0.75rem;
    color: var(--neon-orange);
    font-weight: 600;
    margin-top: 0.5rem;
    text-align: center;
}

/* Active stations table */
.stations-scroll {
    max-height: 200px;
    overflow-y: auto;
}

.stations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    text-align: left;
}

.stations-table th, 
.stations-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stations-table th {
    color: var(--text-secondary);
    font-weight: 600;
}

.no-stations {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.5rem !important;
}

/* Radio Workspace Area */
.radio-workspace {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
    background: radial-gradient(circle at center, #1e2530 0%, #0f1115 100%);
}

/* Radio Bezel Enclosure */
.radio-bezel-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 980px;
    position: relative;
}

.radio-panel {
    background: linear-gradient(135deg, #373f4c 0%, #1f242c 100%);
    border: 6px solid #14171c;
    border-radius: 12px;
    padding: 1.2rem;
    display: grid;
    grid-template-columns: 180px 1fr 240px;
    gap: 1.2rem;
    width: 100%;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-bottom: 10px solid #0d0f12;
}

/* Left Column: Speaker, ACC connector, Distress Cover & Button */
.panel-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 2px solid rgba(0, 0, 0, 0.25);
    padding-right: 1.2rem;
}

.speaker-grill {
    background-color: #1a1e24;
    height: 100px;
    border-radius: 6px;
    border: 2px solid #121519;
    box-shadow: inset 0 3px 5px rgba(0,0,0,0.5);
    padding: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grill-bars {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 8px,
        #29303a 8px,
        #29303a 12px
    );
}

.left-controls {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 1rem;
}

/* ACC connector */
.handset-connector {
    width: 44px;
    height: 44px;
    background: radial-gradient(circle, #29303a 40%, #161a20 90%);
    border: 3px solid #121519;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.8),
        0 1px 2px rgba(255,255,255,0.1);
}

.connector-pinhole {
    width: 14px;
    height: 14px;
    background-color: #0d0f12;
    border-radius: 50%;
    position: relative;
    border: 1px solid #384252;
}

.handset-connector .label {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    font-family: monospace;
}

/* Distress button system */
.distress-group {
    position: relative;
    width: 60px;
    height: 60px;
}

.distress-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(153, 27, 27, 0.95) 100%);
    border: 2px solid #ef4444;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 
        0 6px 10px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    z-index: 10;
    transform-origin: top;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
}

.distress-cover.opened {
    transform: rotateX(115deg) translateY(-5px);
    box-shadow: 0 -5px 15px rgba(239, 68, 68, 0.3);
}

.cover-text {
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.distress-btn {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #dc2626 40%, #991b1b 95%);
    border: 3px solid #7f1d1d;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.distress-btn .btn-text {
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}

.distress-btn:active {
    background: radial-gradient(circle, #b91c1c 40%, #7f1d1d 95%);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.6);
}

/* Center Section: Screen & Softkeys & Knobs */
.panel-center {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.screen-and-softkeys {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.8rem;
    background-color: #161a20;
    padding: 0.8rem;
    border-radius: 8px;
    border: 3px solid #0f1115;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
}

/* 4 Softkeys Column */
.softkeys-column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 180px;
    padding: 0.4rem 0;
}

.softkey-btn {
    width: 22px;
    height: 32px;
    background: linear-gradient(180deg, #4b5563 0%, #1f2937 100%);
    border: 2px solid #111827;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

.softkey-btn:active {
    background: #1f2937;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

/* LCD Bezel */
.screen-bezel {
    border: 3px solid #232a35;
    border-radius: 6px;
    overflow: hidden;
    height: 180px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* LCD screen core themes */
.lcd-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.5rem 0.6rem;
    position: relative;
    user-select: none;
    transition: all 0.3s ease;
}

/* Day vs Night styles */
.lcd-screen.theme-day {
    background-color: var(--lcd-bg-day);
    color: var(--lcd-text-day);
    box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.1);
}

.lcd-screen.theme-day .lcd-header, 
.lcd-screen.theme-day .lcd-footer {
    border-color: var(--lcd-border-day);
    color: #4b5563;
}

.lcd-screen.theme-day .softkey-label {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: var(--lcd-border-day);
}

.lcd-screen.theme-day .rxtx-badge {
    background-color: rgba(0, 0, 0, 0.08);
    border: 1px solid var(--lcd-border-day);
}

.lcd-screen.theme-night {
    background-color: var(--lcd-bg-night);
    color: var(--lcd-text-night);
    box-shadow: inset 0 10px 20px rgba(255, 0, 0, 0.05);
}

.lcd-screen.theme-night .lcd-header, 
.lcd-screen.theme-night .lcd-footer {
    border-color: var(--lcd-border-night);
    color: #880000;
}

.lcd-screen.theme-night .softkey-label {
    background-color: rgba(255, 0, 0, 0.05);
    border-color: var(--lcd-border-night);
}

.lcd-screen.theme-night .rxtx-badge {
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid var(--lcd-border-night);
    color: var(--lcd-text-night);
}

/* LCD Header & Footer */
.lcd-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    font-weight: 700;
    border-bottom: 1px solid;
    padding-bottom: 0.25rem;
}

.lcd-header-left {
    display: flex;
    gap: 0.5rem;
}

.mode-indicator {
    font-weight: 800;
}

.lcd-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid;
    padding-top: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
}

.rxtx-badge {
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    font-weight: 800;
    font-size: 0.6rem;
}

.rxtx-badge.active-tx {
    background-color: var(--neon-red) !important;
    color: white !important;
    border-color: var(--neon-red) !important;
    box-shadow: 0 0 5px var(--neon-red);
}

.rxtx-badge.active-rx {
    background-color: var(--neon-green) !important;
    color: white !important;
    border-color: var(--neon-green) !important;
    box-shadow: 0 0 5px var(--neon-green);
}

/* LCD Body layout */
.lcd-body {
    flex: 1;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 0.5rem;
    padding: 0.3rem 0;
    overflow: hidden;
}

/* Softkey menu tags */
.softkey-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.softkey-label {
    font-size: 0.55rem;
    font-weight: 800;
    padding: 0.2rem 0.3rem;
    border: 1px solid;
    border-left: none;
    border-radius: 0 4px 4px 0;
    text-transform: uppercase;
    text-align: center;
    line-height: 1;
}

.screen-content-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.standby-view {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding-left: 0.3rem;
}

.channel-number-large {
    font-family: 'Share Tech Mono', monospace;
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1;
    margin-top: -0.2rem;
}

.channel-description {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin-top: -0.1rem;
}

.dsc-info-panel {
    display: flex;
    flex-direction: column;
    margin-top: auto;
    font-size: 0.6rem;
    font-weight: 700;
    gap: 0.05rem;
}

.gps-coordinates {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: -0.02em;
}

/* Screen overlay for alarms */
.lcd-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.8rem;
    text-align: center;
    animation: blinkRed 1s infinite alternate;
    color: white;
}

.lcd-screen.theme-day .lcd-overlay {
    box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
}

.overlay-header {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.overlay-body {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0.5rem 0;
    line-height: 1.2;
}

.overlay-footer {
    font-size: 0.6rem;
    font-weight: 600;
}

/* Generic scroll list for menus */
.menu-list-view {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    height: 100%;
    overflow-y: auto;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
}

.menu-item {
    padding: 0.1rem 0.25rem;
    border-radius: 2px;
    line-height: 1.25;
}

/* LCD list selection: inverted bar (dark bg, light text) */
.lcd-screen.theme-day .menu-item {
    color: var(--lcd-text-day);
}

.lcd-screen.theme-day .menu-item.selected {
    background-color: var(--lcd-text-day);
    color: var(--lcd-bg-day) !important;
    font-weight: 800;
}

.lcd-screen.theme-night .menu-item {
    color: var(--lcd-text-night);
}

.lcd-screen.theme-night .menu-item.selected {
    background-color: var(--lcd-text-night);
    color: var(--lcd-bg-night) !important;
    font-weight: 800;
}

/* Distress Active resend loop view */
.distress-active-view {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.55rem;
    font-weight: 700;
    padding-top: 0.2rem;
}

.distress-active-view h4 {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
}

/* Setup menu config form views */
.setup-form-view {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0;
}

.setup-form-title {
    font-size: 0.7rem;
    border-bottom: 1px solid;
    padding-bottom: 0.1rem;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.setup-row {
    display: flex;
    justify-content: space-between;
}

.lcd-screen.theme-day .setup-row.selected {
    background-color: var(--lcd-text-day);
    color: var(--lcd-bg-day) !important;
    font-weight: 800;
    padding: 0 0.2rem;
    border-radius: 2px;
}

.lcd-screen.theme-night .setup-row.selected {
    background-color: var(--lcd-text-night);
    color: var(--lcd-bg-night) !important;
    font-weight: 800;
    padding: 0 0.2rem;
    border-radius: 2px;
}

/* Rotary Knobs styling */
.knobs-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #1b2029;
    border: 2px solid #11141a;
    border-radius: 6px;
    padding: 0.8rem 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.knob-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.knob-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.knob-potentiometer {
    width: 46px;
    height: 46px;
    background: radial-gradient(circle, #4b5563 30%, #1f2937 90%);
    border: 3px solid #111827;
    border-radius: 50%;
    position: relative;
    cursor: ns-resize; /* Drag up/down to rotate */
    box-shadow: 
        0 4px 6px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.15);
    transition: transform 0.1s ease;
}

.active-power {
    border-color: var(--neon-blue);
    box-shadow: 
        0 4px 6px rgba(0,0,0,0.4),
        0 0 4px rgba(59, 130, 246, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.knob-pointer {
    width: 4px;
    height: 14px;
    background-color: #f3f4f6;
    border-radius: 2px;
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
}

.knob-value-indicator {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--neon-green);
    background-color: #0f1115;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Right Column: Keypad grid */
.panel-right {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    border-left: 2px solid rgba(0, 0, 0, 0.25);
    padding-left: 1.2rem;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.keypad-btn {
    background: linear-gradient(180deg, #374151 0%, #111827 100%);
    border: 2px solid #0b0f15;
    color: var(--text-primary);
    border-radius: 8px;
    height: 42px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    box-shadow: 
        0 3px 5px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.15s ease;
}

.keypad-btn small {
    font-size: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
}

.keypad-btn:active {
    background: #111827;
    transform: translateY(1px);
    box-shadow: 
        0 1px 2px rgba(0,0,0,0.4),
        inset 0 1px 3px rgba(0,0,0,0.6);
}

/* calling key orange accent */
.keypad-btn.key-16c {
    background: linear-gradient(180deg, #ea580c 0%, #9a3412 100%);
    border-color: #7c2d12;
}

.keypad-btn.key-16c:active {
    background: #9a3412;
}

.keypad-btn.key-dw {
    background: linear-gradient(180deg, #4b5563 0%, #1f2937 100%);
}

/* Standalone utility buttons */
.special-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0.6rem;
}

.special-btn {
    height: 34px;
    background: linear-gradient(180deg, #4b5563 0%, #1f2937 100%);
    border: 2px solid #111827;
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    box-shadow: 
        0 3px 4px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

.special-btn svg {
    color: var(--text-secondary);
}

.special-btn:active {
    background: #1f2937;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

/* Handset Representation */
.handset-cradle {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-top: 1.5rem;
}

.handset-body {
    width: 54px;
    height: 240px;
    background: linear-gradient(90deg, #1b2028 0%, #0d0f13 100%);
    border: 3px solid #161a21;
    border-radius: 20px;
    box-shadow: 
        10px 15px 30px rgba(0,0,0,0.5),
        inset 0 2px 4px rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    z-index: 30;
    position: relative;
}

.handset-earpiece {
    width: 32px;
    height: 32px;
    background-color: #0c0e12;
    border-radius: 50%;
    border: 2px solid #232a35;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.handset-microphone {
    width: 32px;
    height: 32px;
    background-color: #0c0e12;
    border-radius: 50%;
    border: 2px solid #232a35;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
    background-image: radial-gradient(#374151 1px, transparent 1px);
    background-size: 4px 4px;
}

.handset-ptt-btn {
    width: 14px;
    height: 60px;
    background: linear-gradient(90deg, #ef4444 0%, #991b1b 100%);
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 3px 0 6px rgba(0, 0, 0, 0.4);
    position: absolute;
    left: -12px;
    top: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 0.5rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    border: 1px solid #7f1d1d;
    transition: transform 0.1s ease;
}

.handset-ptt-btn:active {
    transform: translateX(3px);
    background: #991b1b;
}

.handset-cable {
    width: 12px;
    height: 120px;
    background: transparent;
    border-left: 8px dashed #1a202c;
    border-radius: 50% 0 0 50%;
    position: absolute;
    bottom: -60px;
    left: 20px;
    z-index: 10;
}

/* Audio activate overlay banner */
.audio-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    font-size: 0.85rem;
    font-weight: 600;
}

.audio-banner button {
    background-color: #3b82f6;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.audio-banner button:hover {
    background-color: #2563eb;
}

/* Footer info */
footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

footer .badge {
    background-color: var(--border-color);
    color: var(--text-primary);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
}

/* Animation keyframes */
@keyframes blinkRed {
    0% { background-color: rgba(239, 68, 68, 0.85); }
    100% { background-color: rgba(127, 29, 29, 0.95); }
}

@keyframes staticNoiseAnim {
    0% { opacity: 0.1; }
    100% { opacity: 0.15; }
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0f1115;
}
::-webkit-scrollbar-thumb {
    background: #2b3341;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3e4b5f;
}

/* ==========================================================================
   Mobile / Responsive Layout (Slide-out menu & scaled bezel)
   ========================================================================== */

/* Toggle menu button (hidden on desktop) */
.btn-toggle-menu {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.2rem;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
}

.btn-toggle-menu:hover {
    color: var(--neon-blue);
}

/* Sidebar header for mobile (hidden on desktop) */
.sidebar-mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.sidebar-mobile-header h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
}

.btn-close-sidebar {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.btn-close-sidebar:hover {
    color: var(--neon-red);
}

/* Overlay for backdrop blur */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 17, 21, 0.6);
    backdrop-filter: blur(5px);
    z-index: 998;
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.sidebar-overlay.open {
    display: block;
    opacity: 1;
}

/* Media query for tablets/cellphones */
@media (max-width: 768px) {
    /* Show hamburger toggle */
    .btn-toggle-menu {
        display: flex;
    }

    /* Convert sidebar to slide-out drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: -330px; /* Hide offscreen */
        width: 320px;
        height: 100vh;
        z-index: 999;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.open {
        left: 0;
    }

    /* Show mobile close button */
    .sidebar-mobile-header {
        display: flex;
    }

    /* Stack handset below radio bezel to save width */
    .radio-bezel-container {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        width: 100%;
        max-width: 700px;
    }

    .handset-cradle {
        transform: rotate(90deg); /* Rotate handset to fit horizontally */
        margin-top: 3rem;
        margin-bottom: 3rem;
    }
    
    .radio-workspace {
        padding: 1rem 0.5rem;
    }

    /* COMPRESSING LEFT AND RIGHT BEZEL PANELS ON CELLPHONE SCREEN */
    .radio-panel {
        grid-template-columns: 80px 1fr 140px !important; /* Compress left & right columns, let screen occupy 1fr */
        gap: 0.6rem !important;
        padding: 0.6rem !important;
    }

    .speaker-grill {
        height: 30px !important; /* Extremely compressed loudspeaker */
        padding: 0.2rem !important;
    }

    .panel-left {
        padding-right: 0.6rem !important;
    }

    .panel-right {
        padding-left: 0.6rem !important;
        gap: 0.4rem !important;
    }

    .keypad-grid {
        gap: 0.35rem !important;
    }

    .keypad-btn {
        height: 30px !important; /* Compress keypad keys */
        font-size: 0.85rem !important;
        border-radius: 4px !important;
    }

    .keypad-btn small {
        display: none !important; /* Hide letter guides to prevent clutter */
    }

    .special-buttons-row {
        gap: 0.35rem !important;
    }

    .special-btn {
        height: 28px !important;
        font-size: 0.65rem !important;
    }

    .left-controls {
        margin-top: 0.4rem !important;
    }

    .handset-connector {
        width: 28px !important;
        height: 28px !important;
    }

    .connector-pinhole {
        width: 8px !important;
        height: 8px !important;
    }

    .distress-group {
        width: 40px !important;
        height: 40px !important;
    }

    .cover-text {
        font-size: 0.45rem !important;
    }

    .distress-btn .btn-text {
        font-size: 0.5rem !important;
    }

    .knobs-row {
        padding: 0.4rem 0 !important;
        gap: 0.3rem !important;
    }

    .knob-potentiometer {
        width: 32px !important;
        height: 32px !important;
    }

    .knob-pointer {
        height: 10px !important;
        top: 2px !important;
    }

    .knob-value-indicator {
        font-size: 0.55rem !important;
        padding: 0.05rem 0.25rem !important;
    }

    .knob-label {
        font-size: 0.55rem !important;
    }

    .screen-and-softkeys {
        padding: 0.4rem !important;
        border-width: 2px !important;
    }
}

/* Additional scaling helpers for small devices */
@media (max-width: 480px) {
    header {
        padding: 0.6rem 0.8rem;
    }
    
    .brand h1 {
        font-size: 1rem;
    }
    
    .brand span {
        display: none; /* hide sub-brand */
    }
    
    .btn-ctrl {
        padding: 0.4rem;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Fullscreen LCD screen styles
   ========================================================================== */

.fullscreen-btn {
    margin-left: 0.6rem;
    cursor: pointer;
    font-weight: 900;
    color: var(--neon-blue);
    display: inline-block;
    transition: transform 0.2s ease;
}

.lcd-screen.theme-night .fullscreen-btn {
    color: var(--lcd-text-night);
}

.fullscreen-btn:hover {
    transform: scale(1.3);
}

/* Overlay focus mode for screen and softkeys */
.screen-and-softkeys.fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2000 !important;
    background-color: #161a20 !important;
    padding: 1rem !important;
    border-radius: 0 !important;
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    border: none !important;
    gap: 1rem !important;
}

.screen-and-softkeys.fullscreen-active .softkeys-column {
    height: 94vh !important;
}

.screen-and-softkeys.fullscreen-active .softkey-btn {
    height: 16vh !important;
    width: 8vw !important;
    max-width: 50px;
    border-width: 3px !important;
}

.screen-and-softkeys.fullscreen-active .screen-bezel {
    height: 94vh !important;
    border-width: 4px !important;
}

/* Fullscreen text size scaling */
.screen-and-softkeys.fullscreen-active .channel-number-large {
    font-size: 8rem !important;
    margin-top: -0.8rem !important;
}

.screen-and-softkeys.fullscreen-active .channel-description {
    font-size: 1.5rem !important;
    margin-top: 0.6rem !important;
}

.screen-and-softkeys.fullscreen-active .dsc-info-panel {
    font-size: 1.1rem !important;
    gap: 0.5rem !important;
}

.screen-and-softkeys.fullscreen-active .gps-coordinates {
    font-size: 1.25rem !important;
}

.screen-and-softkeys.fullscreen-active .softkey-label {
    font-size: 1.1rem !important;
    padding: 0.8rem 1rem !important;
}

.screen-and-softkeys.fullscreen-active .lcd-header {
    font-size: 1.1rem !important;
    padding-bottom: 0.6rem !important;
}

.screen-and-softkeys.fullscreen-active .lcd-footer {
    font-size: 1.1rem !important;
    padding-top: 0.6rem !important;
}

.screen-and-softkeys.fullscreen-active .rxtx-badge {
    font-size: 1.1rem !important;
    padding: 0.2rem 0.8rem !important;
}

.screen-and-softkeys.fullscreen-active .fullscreen-btn {
    font-size: 1.5rem !important;
}

.screen-and-softkeys.fullscreen-active .menu-list-view {
    font-size: 1rem !important;
    gap: 0.3rem !important;
}

.screen-and-softkeys.fullscreen-active .menu-item.selected {
    padding: 0.15rem 0.35rem !important;
}

.screen-and-softkeys.fullscreen-active .menu-list-view div:first-child {
    font-size: 1.15rem !important;
    margin-bottom: 0.5rem !important;
}

.screen-and-softkeys.fullscreen-active .distress-active-view {
    font-size: 0.9rem !important;
    gap: 0.35rem !important;
}

.screen-and-softkeys.fullscreen-active .distress-active-view h4 {
    font-size: 1.2rem !important;
    margin-bottom: 0.4rem !important;
}

.screen-and-softkeys.fullscreen-active .setup-form-view {
    font-size: 1.1rem !important;
    gap: 0.35rem !important;
}

.screen-and-softkeys.fullscreen-active .setup-form-title {
    font-size: 1.25rem !important;
    margin-bottom: 0.4rem !important;
}

/* Disable body scroll in fullscreen mode */
body.lcd-fullscreen-mode {
    overflow: hidden !important;
}

/* Mobile PTT button styling - default hidden on desktop */
.mobile-ptt-btn {
    display: none;
}

/* Recordings UI Styling */
.recordings-scroll {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 0.25rem;
}

.recordings-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.recording-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    font-size: 0.75rem;
    text-align: left;
}

.recording-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.recording-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.65rem;
}

.recording-info {
    font-weight: 600;
    color: var(--text-primary);
}

.recording-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.2rem;
}

.recording-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    transition: background-color 0.15s, border-color 0.15s;
    text-decoration: none;
}

.recording-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.recording-btn.delete-btn {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
    background-color: rgba(239, 68, 68, 0.05);
    margin-left: auto;
}

.recording-btn.delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.no-recordings {
    text-align: center;
    color: var(--text-secondary);
    padding: 1rem;
    font-style: italic;
    font-size: 0.75rem;
}

.recordings-toolbar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.rec-select-all {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.rec-checkbox {
    margin-right: 0.4rem;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.recording-item { position: relative; }

.recording-item-row {
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
}

.recording-item-content { flex: 1; min-width: 0; }

.recording-btn:disabled {
    opacity: 0.35;
    pointer-events: none;
}

@media (max-width: 768px) {
    .mobile-ptt-btn {
        display: flex !important;
        width: 100%;
        height: 42px;
        margin-top: 0.6rem;
        background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
        color: #ffffff;
        border: 1px solid #7f1d1d;
        border-radius: 6px;
        font-size: 0.85rem;
        font-weight: 700;
        cursor: pointer;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 4px rgba(0, 0, 0, 0.4);
        align-items: center;
        justify-content: center;
        transition: background 0.1s, transform 0.05s;
        user-select: none;
        -webkit-user-select: none;
    }
    .mobile-ptt-btn:active {
        background: #b91c1c;
        transform: scale(0.97);
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    }
}

