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

@keyframes pulse {
    0%, 100% {
        transform: rotate(45deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: rotate(45deg) scale(1.2);
        opacity: 0.8;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1em;
    opacity: 0.9;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.95em;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin: 0 5px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.status-bar {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.status-bar.loading {
    background: rgba(33, 150, 243, 0.3);
}

.status-bar.error {
    background: rgba(244, 67, 54, 0.3);
}

.status-bar.success {
    background: rgba(76, 175, 80, 0.3);
}

/* Search Section */
.search-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.search-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.search-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

.search-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-group.full-width {
    grid-column: 1 / -1;
}

.search-label {
    font-weight: bold;
    font-size: 0.95em;
    opacity: 0.9;
}

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

.search-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 1em;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(59, 130, 246, 0.8);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.freq-unit {
    font-weight: bold;
    font-size: 0.9em;
    opacity: 0.8;
    min-width: 40px;
}

.search-hint {
    font-size: 0.75em;
    opacity: 0.7;
    font-style: italic;
}

.search-btn {
    padding: 10px 24px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.search-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

/* Quick Frequency Buttons */
.quick-freq-section {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.quick-freq-label {
    font-weight: bold;
    margin-bottom: 12px;
    opacity: 0.9;
}

.quick-freq-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-freq-btn {
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.6);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.8);
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-freq-btn:hover {
    background: rgba(59, 130, 246, 0.8);
    transform: translateY(-1px);
}

/* Slider Styles */
.freq-slider, .bw-slider, .snr-slider, .dist-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.dist-slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.freq-slider::-webkit-slider-thumb,
.bw-slider::-webkit-slider-thumb,
.snr-slider::-webkit-slider-thumb,
.dist-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.freq-slider::-webkit-slider-thumb:hover,
.bw-slider::-webkit-slider-thumb:hover,
.snr-slider::-webkit-slider-thumb:hover {
    background: #059669;
    transform: scale(1.1);
}

.freq-slider::-moz-range-thumb,
.bw-slider::-moz-range-thumb,
.snr-slider::-moz-range-thumb,
.dist-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.freq-slider::-moz-range-thumb:hover,
.bw-slider::-moz-range-thumb:hover,
.snr-slider::-moz-range-thumb:hover {
    background: #059669;
    transform: scale(1.1);
}

.freq-markers, .slider-markers {
    position: relative;
    font-size: 0.75em;
    opacity: 0.7;
    margin-top: 5px;
    height: 20px;
}

.freq-markers span, .slider-markers span {
    position: absolute;
    transform: translateX(-50%);
}

/* Frequency markers (7 markers: 0, 5, 10, 15, 20, 25, 30) */
.freq-markers span:nth-child(1) {
    left: 0%;
}

.freq-markers span:nth-child(2) {
    left: 16.67%;
}

.freq-markers span:nth-child(3) {
    left: 33.33%;
}

.freq-markers span:nth-child(4) {
    left: 50%;
}

.freq-markers span:nth-child(5) {
    left: 66.67%;
}

.freq-markers span:nth-child(6) {
    left: 83.33%;
}

.freq-markers span:nth-child(7) {
    left: 100%;
}

/* Bandwidth slider markers (5 markers: -12, -6, 0, +6, +12) */
.bw-markers span:nth-child(1) {
    left: 0%;
}

.bw-markers span:nth-child(2) {
    left: 25%;
}

.bw-markers span:nth-child(3) {
    left: 50%;
}

.bw-markers span:nth-child(4) {
    left: 75%;
}

.bw-markers span:nth-child(5) {
    left: 100%;
}

/* SNR slider markers (6 markers: 0, 10, 20, 30, 40, 50) */
.snr-markers span:nth-child(1) {
    left: 0%;
}

.snr-markers span:nth-child(2) {
    left: 20%;
}

.snr-markers span:nth-child(3) {
    left: 40%;
}

.snr-markers span:nth-child(4) {
    left: 60%;
}

.snr-markers span:nth-child(5) {
    left: 80%;
}

.snr-markers span:nth-child(6) {
    left: 100%;
}

/* Distance slider markers (7 markers: 50, 100, 250, 1k, 2.5k, 5k, 10k) */
.dist-markers span:nth-child(1) {
    left: 0%;
}

.dist-markers span:nth-child(2) {
    left: 16.67%;
}

.dist-markers span:nth-child(3) {
    left: 33.33%;
}

.dist-markers span:nth-child(4) {
    left: 50%;
}

.dist-markers span:nth-child(5) {
    left: 66.67%;
}

.dist-markers span:nth-child(6) {
    left: 83.33%;
}

.dist-markers span:nth-child(7) {
    left: 100%;
}

/* Map Container */
.map-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.map-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#map {
    height: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Instance Cards */
.instances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.instance-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: transform 0.2s, box-shadow 0.2s;
}

.instance-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.instance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.instance-callsign {
    font-size: 1.5em;
    font-weight: bold;
}

.instance-name {
    font-size: 0.95em;
    opacity: 0.9;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.instance-status {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.online {
    background: #22c55e;
    color: white;
}

.status-badge.feature {
    background: #3b82f6;
    color: white;
}

.snr-badge {
    padding: 6px 14px;
    border-radius: 16px;
    font-weight: bold;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
}

.snr-badge.excellent {
    background: #22c55e;
    color: white;
}

.snr-badge.good {
    background: #fbbf24;
    color: white;
}

.snr-badge.fair {
    background: #ff9800;
    color: white;
}

.snr-badge.poor {
    background: #ef4444;
    color: white;
}

.preview-btn {
    padding: 6px 14px;
    background: rgba(139, 92, 246, 0.8);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.preview-btn:hover {
    background: #8b5cf6;
    transform: translateY(-1px);
}

.instance-info {
    margin-bottom: 15px;
    font-size: 0.9em;
    line-height: 1.6;
}

.instance-info-row {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.instance-info-label {
    opacity: 0.7;
    min-width: 100px;
}

.instance-info-value {
    font-weight: 500;
}

.instance-link {
    display: inline-block;
    padding: 10px 20px;
    background: #3b82f6;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.2s;
    margin-top: 10px;
}

.instance-link:hover {
    background: #2563eb;
}

.spectrum-container {
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.no-instances {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2em;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin: 20px 0;
}

.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9em;
    opacity: 0.8;
}

.site-footer a {
    color: #4CAF50;
    text-decoration: none;
    transition: color 0.3s;
}

.site-footer a:hover {
    color: #45a049;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .instances-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.8em;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }

    .quick-freq-buttons {
        justify-content: center;
    }
}
