/* ATC Simulation Stylesheet - Clean, functional interface */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Login & Mode Selection */
.login-container,
.mode-container {
    max-width: 300px;
    margin: 100px auto;
    padding: 30px;
    background: #252540;
    border-radius: 8px;
    text-align: center;
}

.login-container h1,
.mode-container h1 {
    margin: 0 0 20px;
    color: #7ec8e3;
}

.login-container input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #404060;
    border-radius: 4px;
    background: #1a1a2e;
    color: #e0e0e0;
}

.login-container button,
.mode-container button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background: #4a4a8a;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.login-container button:hover,
.mode-container button:hover {
    background: #5a5a9a;
}

.mode-buttons {
    display: flex;
    gap: 10px;
}

.mode-btn {
    flex: 1;
    padding: 20px !important;
    font-size: 16px !important;
}

.error {
    color: #ff6b6b;
    margin: 10px 0;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #252540;
    border-bottom: 1px solid #404060;
}

header h1 {
    margin: 0;
    font-size: 18px;
    color: #7ec8e3;
}

header nav a {
    color: #a0a0c0;
    text-decoration: none;
    margin-left: 20px;
}

header nav a:hover {
    color: #7ec8e3;
}

header nav a.danger-link {
    color: #aa6a6a;
}

header nav a.danger-link:hover {
    color: #ff6b6b;
}

.new-link {
    font-size: 14px;
    font-weight: normal;
    color: #7ec8e3;
    text-decoration: none;
    margin-left: 10px;
}

.new-link:hover {
    color: #9ed8f3;
}

td.actions {
    white-space: nowrap;
}

.refresh-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 3px;
    margin-right: 15px;
}

.refresh-status.active {
    color: #6aaa6a;
    background: rgba(106, 170, 106, 0.2);
}

.refresh-status.paused {
    color: #aa8a6a;
    background: rgba(170, 138, 106, 0.2);
}

/* Main Content */
main {
    padding: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Message Notification */
.message {
    background: #2d5a4a;
    color: #7ec8e3;
    padding: 10px 20px;
    text-align: center;
    margin-bottom: 15px;
    border-radius: 4px;
}

/* Panels */
.panel {
    background: #252540;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.panel h2 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #7ec8e3;
    border-bottom: 1px solid #404060;
    padding-bottom: 8px;
}

.panel h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #a0a0c0;
}

/* Forms */
input, button, select {
    font-family: inherit;
    font-size: 13px;
}

input[type="text"],
input[type="number"],
input[type="password"] {
    padding: 6px 8px;
    border: 1px solid #404060;
    border-radius: 3px;
    background: #1a1a2e;
    color: #e0e0e0;
}

input:focus {
    outline: none;
    border-color: #7ec8e3;
}

button {
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    background: #4a4a8a;
    color: white;
    cursor: pointer;
}

button:hover {
    background: #5a5a9a;
}

label {
    margin-right: 15px;
    color: #a0a0c0;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.form-row:last-child {
    margin-bottom: 0;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #353555;
}

.data-table th {
    background: #1a1a2e;
    color: #7ec8e3;
    font-weight: 600;
}

.data-table tr:hover {
    background: #2a2a4a;
}

.data-table td a {
    color: #7ec8e3;
    text-decoration: none;
    margin-right: 8px;
}

.inline-delete {
    display: inline;
}

.inline-delete button {
    padding: 3px 8px;
    font-size: 12px;
    background: #6a3a3a;
}

.inline-delete button:hover {
    background: #8a4a4a;
}

/* Airport Info Table (ATC view) */
.airport-info {
    width: auto;
    margin-top: 15px;
}

.airport-info th {
    text-align: right;
    padding: 6px 15px 6px 0;
    color: #a0a0c0;
    font-weight: normal;
    width: 120px;
}

.airport-info td {
    padding: 6px 0;
    color: #e0e0e0;
}

/* Messaging */
.message-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.msg-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.msg-form label {
    min-width: 80px;
}

.message-list {
    max-height: 200px;
    overflow-y: auto;
    background: #1a1a2e;
    border-radius: 4px;
    padding: 10px;
}

.msg {
    padding: 4px 0;
    border-bottom: 1px solid #252540;
}

.msg:last-child {
    border-bottom: none;
}

.msg .time {
    color: #606080;
    font-size: 12px;
    margin-right: 8px;
}

.msg .from {
    color: #7ec8e3;
    font-weight: 600;
    margin-right: 8px;
}

.msg .dir {
    color: #7ec8e3;
    margin-right: 5px;
}

.msg.sent .dir {
    color: #6aaa6a;
}

.msg.received .dir {
    color: #aa8a6a;
}

.msg .text {
    color: #e0e0e0;
}

.msg.mil .from { color: #6aaa6a; }
.msg.civ .from { color: #aa8a6a; }
.msg.atc .from { color: #7ec8e3; }

/* ATC View Message Panels */
.message-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.msg-panel .message-list {
    max-height: 300px;
}

/* ATC View Airport Panels */
.airport-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.airport-panel {
    min-height: 200px;
}

.airport-panel .lookup-form {
    margin-bottom: 10px;
}

.no-data {
    color: #606080;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Save/Restore */
.save-controls {
    margin-bottom: 15px;
}

.save-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.save-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.save-column li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #353555;
}

.save-column li strong {
    flex: 1;
    color: #e0e0e0;
}

.save-column li small {
    color: #606080;
    font-size: 12px;
}

.save-column li form {
    display: inline-flex;
    gap: 5px;
}

.save-column li button {
    padding: 3px 8px;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 800px) {
    .message-panels,
    .save-lists,
    .airport-panels {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-row label {
        margin-bottom: 5px;
    }
}

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

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #404060;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #505070;
}
