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

body {
    font-family: 'Courier New', Courier, monospace;
    background: #0a0a0a;
    color: #ffb400;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
    background: #1a1a1a;
    border: 3px solid #ffb400;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(255, 180, 0, 0.3);
}

.board-header {
    background: #0d0d0d;
    padding: 20px;
    border-bottom: 2px solid #ffb400;
}

.header-controls {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
    margin-bottom: 15px;
}

.mode-label {
    color: #ffb400;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}

.mode-options {
    display: flex;
    gap: 8px;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.mode-option input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ffb400;
    border-radius: 50%;
    background: #0d0d0d;
    cursor: pointer;
    position: relative;
}

.mode-option input[type="radio"]:checked {
    background: #ffb400;
}

.mode-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #0d0d0d;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mode-option span {
    color: #ffb400;
    font-size: 12px;
    text-transform: uppercase;
}

#airline-controls {
    flex-direction: column;
    align-items: stretch;
}

#airline-controls .mode-toggle {
    width: 100%;
    justify-content: center;
}

.pids-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.pids-label {
    color: #ffb400;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}

#pids-textarea {
    background: #0d0d0d;
    border: 2px solid #ffb400;
    color: #ffb400;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    padding: 10px;
    width: 100%;
    min-width: 300px;
    min-height: 150px;
    max-height: 300px;
    border-radius: 5px;
    outline: none;
    resize: vertical;
}

#pids-textarea:focus {
    box-shadow: 0 0 10px rgba(255, 180, 0, 0.5);
}

.pids-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: #0d0d0d;
    border: 2px solid #ffb400;
    color: #ffb400;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    padding: 8px 15px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #ffb400;
    color: #0d0d0d;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group label {
    color: #ffb400;
    font-weight: bold;
    text-transform: uppercase;
}

.input-group input {
    background: #0d0d0d;
    border: 2px solid #ffb400;
    color: #ffb400;
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    padding: 8px 12px;
    text-transform: uppercase;
    width: 120px;
    border-radius: 5px;
    outline: none;
}

.input-group input[type="number"] {
    width: 70px;
    text-transform: none;
}

.input-group input:focus {
    box-shadow: 0 0 10px rgba(255, 180, 0, 0.5);
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-label {
    color: #ffb400;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-label {
    color: #ffb400;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}

.sort-select {
    background: #0d0d0d;
    border: 2px solid #ffb400;
    color: #ffb400;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.sort-select:focus {
    box-shadow: 0 0 10px rgba(255, 180, 0, 0.5);
}

.sort-select option {
    background: #1a1a1a;
    color: #ffb400;
}

.time-columns-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-toggle-label {
    color: #ffb400;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}

.time-toggle-options {
    display: flex;
    gap: 8px;
}

.time-toggle-option {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.time-toggle-option input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ffb400;
    border-radius: 50%;
    background: #0d0d0d;
    cursor: pointer;
    position: relative;
}

.time-toggle-option input[type="radio"]:checked {
    background: #ffb400;
}

.time-toggle-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #0d0d0a;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.time-toggle-option span {
    color: #ffb400;
    font-size: 12px;
    text-transform: uppercase;
}

.sort-direction-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-direction-label {
    color: #ffb400;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}

.sort-direction-options {
    display: flex;
    gap: 8px;
}

.sort-direction-option {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.sort-direction-option input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ffb400;
    border-radius: 50%;
    background: #0d0d0d;
    cursor: pointer;
    position: relative;
}

.sort-direction-option input[type="radio"]:checked {
    background: #ffb400;
}

.sort-direction-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #0d0d0a;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.sort-direction-option span {
    color: #ffb400;
    font-size: 12px;
    text-transform: uppercase;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0d0d0d;
    border: 2px solid #ffb400;
    border-radius: 30px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 2px;
    background: #ffb400;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.refresh-btn {
    background: #0d0d0d;
    border: 2px solid #ffb400;
    color: #ffb400;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    padding: 8px 20px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
}

.refresh-btn:hover {
    background: #ffb400;
    color: #0d0d0d;
}

.hide-gui-btn {
    background: #0d0d0d;
    border: 2px solid #ffb400;
    color: #ffb400;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
    min-width: 40px;
}

.hide-gui-btn:hover {
    background: #ffb400;
    color: #0d0d0a;
}

.board-header.collapsed .header-controls {
    display: none;
}

.board-header.collapsed {
    animation: flipHeader 0.5s ease-in-out;
    padding: 15px 20px;
}

.minimal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 2px solid #ffb400;
    background: #0d0d0d;
}

.minimal-header span {
    color: #ffb400;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
}

@keyframes flipHeader {
    0% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

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

.board-header.collapsed .header-controls {
    display: none;
}

.board-header.collapsed {
    animation: flipHeader 0.5s ease-in-out;
    padding: 15px 20px;
}

.minimal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 2px solid #ffb400;
    background: #0d0d0d;
    animation: fadeIn 0.3s ease-in-out;
}

.minimal-header span {
    color: #ffb400;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
}

@keyframes flipHeader {
    0% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

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

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    animation: pulse 1.5s infinite;
}

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

.error {
    background: #3d0000;
    color: #ff4444;
    padding: 20px;
    text-align: center;
    border: 2px solid #ff4444;
    margin: 20px;
    border-radius: 5px;
}

.hidden {
    display: none;
}

.loading {
    display: none;
}

.board-container {
    padding: 20px;
    overflow-x: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.flight-board {
    width: 100%;
    border-collapse: collapse;
}

.flight-board thead {
    background: #0d0d0d;
}

.flight-board th {
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid #ffb400;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 14px;
}

.flight-board tbody tr {
    border-bottom: 1px solid #333;
    transition: background 0.3s;
}

.flight-board tbody tr:hover {
    background: #0d0d0d;
}

@media (max-width: 768px) {
    .flight-board tbody tr:hover {
        background: transparent;
    }
}

.flight-board td {
    padding: 15px;
    font-size: 16px;
}

.flip-cell {
    display: inline-block;
    position: relative;
    min-width: 60px;
}

.flip-cell.flight-number {
    min-width: 80px;
}

.flip-cell.airport {
    min-width: 60px;
}

.flip-cell.time {
    min-width: 70px;
}

.flip-cell.est-arrival {
    min-width: 70px;
}

.flip-cell.status {
    min-width: 120px;
}

.flip-cell.aircraft {
    min-width: 70px;
}

.flip-cell.pid {
    min-width: 150px;
}

.flip-char {
    display: inline-block;
    transition: transform 0.2s;
    padding: 2px 4px;
    border-radius: 3px;
    width: 1.2ch;
    text-align: center;
    will-change: transform;
}

@media (max-width: 768px) {
    .flip-char {
        transition: transform 0.15s;
        padding: 1px 2px;
    }
}

.hide-scheduled .flight-board th:nth-child(3),
.hide-scheduled .flight-board td:nth-child(3) {
    display: none;
}

.hide-estimated .flight-board th:nth-child(4),
.hide-estimated .flight-board td:nth-child(4) {
    display: none;
}

.hide-pid .flight-board th:nth-child(2),
.hide-pid .flight-board td:nth-child(2) {
    display: none;
}

.flip-char.flipping {
    animation: flipDown 0.2s ease-in-out;
}

@keyframes flipDown {
    0% {
        transform: rotateX(0deg);
        background: transparent;
        color: #ffb400;
    }
    50% {
        transform: rotateX(-90deg);
        background: #ffb400;
        color: #0a0a0a;
    }
    100% {
        transform: rotateX(0deg);
        background: transparent;
        color: #ffb400;
    }
}

@media (max-width: 768px) {
    .flip-char.flipping {
        animation: flipDownMobile 0.15s ease-in-out;
    }

    @keyframes flipDownMobile {
        0% {
            transform: rotateX(0deg);
            background: transparent;
            color: #ffb400;
        }
        50% {
            transform: rotateX(-90deg);
            background: #ffb400;
            color: #0a0a0a;
        }
        100% {
            transform: rotateX(0deg);
            background: transparent;
            color: #ffb400;
        }
    }
}

.status-scheduled {
    color: #ffd700;
}

.status-airborne {
    color: #00ff00;
}

.status-enroute {
    color: #87ceeb;
}

.status-approaching {
    color: #ff6b6b;
}

.status-offline {
    color: #888888;
}

.status-atc {
    color: #ff8c00;
}

.status-endless-flight {
    color: #9b59b6;
}

@keyframes flickerDim {
    0% { opacity: 1; }
    10% { opacity: 0.3; }
    20% { opacity: 0.2; }
    30% { opacity: 0.5; }
    40% { opacity: 0.15; }
    50% { opacity: 0.4; }
    60% { opacity: 0.25; }
    70% { opacity: 0.6; }
    80% { opacity: 0.2; }
    90% { opacity: 0.8; }
    100% { opacity: 1; }
}

.flight-board tbody tr.flickering {
    animation: flickerDim 1s ease-in-out;
}

.flight-board tbody tr.flickering .flip-cell {
    text-shadow: 0 0 5px rgba(255, 180, 0, 0.3);
}

.flight-board tbody tr.flickering .flip-cell.status {
    text-shadow: 0 0 8px currentColor;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
}

.board-footer {
    background: #0d0d0d;
    padding: 15px 20px;
    border-top: 2px solid #ffb400;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    gap: 20px;
}

.load-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333;
    border: 1px solid #555;
    transition: all 0.3s;
}

.load-indicator.loading {
    background: #ff0000;
    border-color: #ff0000;
    box-shadow: 0 0 10px #ff0000;
    animation: pulse 1s infinite;
}

.load-indicator.success {
    background: #00ff00;
    border-color: #00ff00;
    box-shadow: 0 0 8px #00ff00;
}

.load-indicator.error {
    background: #ff6b6b;
    border-color: #ff6b6b;
    box-shadow: 0 0 8px #ff6b6b;
}

@media (max-width: 768px) {
    .header-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .toggle-group {
        justify-content: center;
    }

    .sort-group,
    .time-columns-toggle,
    .sort-direction-toggle {
        justify-content: center;
    }

    .time-toggle-options,
    .sort-direction-options {
        flex-wrap: wrap;
        justify-content: center;
    }

    .flight-board {
        font-size: 14px;
    }

    .flight-board th,
    .flight-board td {
        padding: 8px 4px;
    }

    .flip-cell {
        min-width: auto;
    }

    .flip-cell.flight-number {
        min-width: 60px;
    }

    .flip-cell.pid {
        min-width: 100px;
    }

    .flip-cell.airport {
        min-width: 50px;
    }

    .flip-cell.time {
        min-width: 50px;
    }

    .flip-cell.est-arrival {
        min-width: 50px;
    }

    .flip-cell.status {
        min-width: 70px;
    }

    .flip-cell.aircraft {
        min-width: 50px;
    }

    .board-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    body {
        padding: 10px;
    }

    .container {
        border-width: 2px;
    }
}

.tribute-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: 2px solid #ffb400;
    background: #0a0a0a;
    color: #ffb400;
    font-size: 28px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1;
    box-shadow: 0 0 15px rgba(255, 180, 0, 0.2);
}

.tribute-btn:hover {
    background: #ffb400;
    color: #0a0a0a;
    box-shadow: 0 0 25px rgba(255, 180, 0, 0.5);
    transform: scale(1.1);
}

.tribute-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeInModal 0.3s ease-in-out;
    pointer-events: auto;
}

.tribute-modal.hidden {
    pointer-events: none;
    display: none !important;
}

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

.tribute-content {
    background: #1a1a1a;
    border: 3px solid #ffb400;
    border-radius: 10px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 0 50px rgba(255, 180, 0, 0.3);
    animation: slideIn 0.4s ease-out;
    position: relative;
    pointer-events: auto;
}

@keyframes slideIn {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tribute-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #ffb400;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s;
    font-family: 'Courier New', Courier, monospace;
    z-index: 2001;
    pointer-events: auto;
}

.tribute-close:hover {
    color: #ffd700;
    transform: rotate(90deg);
}

.tribute-title {
    color: #ffb400;
    font-size: 32px;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #ffb400;
    padding-bottom: 15px;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
}

.tribute-text {
    color: #ffb400;
    font-size: 18px;
    line-height: 2;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
}

.tribute-text p {
    margin: 15px 0;
}

.tribute-spacer {
    margin: 30px 0 !important;
    font-size: 20px;
}

.tribute-signature {
    margin-top: 30px !important;
    margin-bottom: 20px !important;
    font-size: 16px;
    font-style: italic;
    color: #ffd700;
}

.tribute-logo {
    margin-top: 20px;
    text-align: center;
}

.tribute-logo img {
    max-width: 150px;
    height: auto;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.tribute-logo img:hover {
    opacity: 1;
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px rgba(255, 180, 0, 0.3));
}

@media (max-width: 768px) {
    .tribute-btn {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
        font-size: 22px;
    }

    .tribute-content {
        padding: 25px;
        max-width: 90%;
    }

    .tribute-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .tribute-text {
        font-size: 16px;
    }

    .tribute-spacer {
        font-size: 18px;
    }

    .tribute-logo img {
        max-width: 120px;
    }
}
