* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

h1 {
    font-size: 24px;
    font-weight: 500;
    flex-grow: 1;
}

h2 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #fff;
}

h3 {
    font-size: 16px;
    font-weight: 500;
    margin: 20px 0 10px 0;
    color: #ccc;
}

.box {
    background: #242424;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    margin-bottom: 15px;
    color: #fbbf24;
    font-size: 13px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #444;
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    color: #e0e0e0;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.repeat-status {
    font-size: 10px;
    margin-top: 3px;
    opacity: 0.8;
}

.btn-repeat-disabled {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.btn-repeat-disabled:hover {
    background: #b91c1c;
}

.btn-repeat-enabled {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.btn-repeat-enabled:hover {
    background: #059669;
}

.btn, .btn-primary {
    padding: 10px 20px;
    background: #333;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.btn:disabled, .btn-primary:disabled, .btn-danger:disabled, .btn-repeat-disabled:disabled, .btn-repeat-enabled:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #222;
    border-color: #333;
    color: #666;
}

.btn:hover {
    background: #3a3a3a;
    border-color: #555;
}

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-reconnect {
    background: #f59e0b;
    border-color: #f59e0b;
    color: white;
}

.btn-reconnect:hover {
    background: #d97706;
}

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.status-disconnected {
    color: #dc2626;
    font-size: 14px;
}

.status-connected {
    color: #10b981;
    font-size: 14px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: #aaa;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
}

.form-group input:disabled,
.form-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #0f0f0f;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
}

.form-row .btn {
    margin-bottom: 15px;
}

.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.password-input {
    display: flex;
    gap: 5px;
}

.password-input input {
    flex: 1;
}

.btn-eye {
    padding: 8px 12px;
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-eye:hover {
    background: #3a3a3a;
}

.key-display {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
}

.key-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.key-item:last-child {
    margin-bottom: 0;
}

.key-item span {
    min-width: 60px;
    font-size: 12px;
    color: #888;
}

.key-item input {
    flex: 1;
}

.compliance-status {
    margin-top: 10px;
    padding: 8px 12px;
    background: #1a5a1a;
    border: 1px solid #4ade80;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.compliance-icon {
    color: #4ade80;
    font-weight: bold;
    font-size: 14px;
}

.compliance-text {
    color: #e0e0e0;
    flex: 1;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.acl-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.acl-container input {
    flex: 2;
}

.acl-container select {
    flex: 1;
}

.map-container {
    margin-top: 15px;
}

#map {
    width: 100%;
    height: 400px;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #1a1a1a;
    position: relative;
    z-index: 1;
}

.monospace {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #242424;
    border: 1px solid #333;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
}

.modal-body {
    padding: 20px;
}

.btn-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.btn-close:hover {
    color: #e0e0e0;
}

.hex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 5px;
}

.hex-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    cursor: pointer;
    transition: all 0.2s;
}

.hex-cell.unoccupied {
    background: #1a5a1a;
    color: #4ade80;
}

.hex-cell.occupied {
    background: #3a3a1a;
    color: #fbbf24;
}

.hex-cell.current {
    background: #1a3a5a;
    color: #4ade80;
}

.hex-cell.current-colliding {
    background: #1a3a5a;
    color: #f87171;
}

.hex-cell.colliding {
    background: #5a1a1a;
    color: #f87171;
}

.hex-cell:hover {
    transform: scale(1.1);
    z-index: 10;
}

.collision-spinner {
    display: inline-block;
    font-size: 18px;
    animation: spin 1s linear infinite;
    color: #fbbf24;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.console-container {
    background: #000;
    border: 1px solid #333;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.console-header h3 {
    margin: 0;
    font-size: 14px;
    color: #888;
}

.console {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

.console-input {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    background: #1a1a1a;
    border-top: 1px solid #333;
}

.console-input input {
    flex: 1;
    padding: 8px 12px;
    background: #000;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
}

.console-input input:focus {
    outline: none;
    border-color: #2563eb;
}

.console-line {
    margin: 2px 0;
}

.console-tx {
    color: #4ade80;
}

.console-rx {
    color: #60a5fa;
}

.console-error {
    color: #f87171;
}

.console-info {
    color: #fbbf24;
}

@media (max-width: 600px) {
    .button-grid {
        grid-template-columns: 1fr;
    }
    
    .radio-grid {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-wrap: wrap;
    }
    
    h1 {
        width: 100%;
        margin-bottom: 10px;
    }
}

