:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --background-color: #f5f6fa;
    --text-color: #2c3e50;
    --grid-color: #dcdde1;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-y: auto;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
}

/* Base styles for fixed header */
.container > h1 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    margin-top: 0.5rem;
    background-color: var(--background-color);
    z-index: 1000;
    text-align: center;
    padding: 0 1rem;
}

.time-control {
    position: fixed;
    top: 3rem;
    left: 0;
    right: 0;
    width: calc(100% - 2rem);
    margin: 0.5rem auto;
    background: white;
    padding: 0.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    max-width: 1600px;
    left: 50%;
    transform: translateX(-50%);
}

.propagation-grid {
    margin-top: 8rem;
    width: 100%;
    background: white;
    border-radius: 10px;
    padding: 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: grid;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

/* Remove duplicate fixed positioning styles */
.header-container,
.header-container .container {
    display: none;
}

/* Remove any layout-specific positioning overrides */
.grid-2x4-active h1,
.grid-3x3-active h1 {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
}

.grid-2x4-active .time-control,
.grid-3x3-active .time-control {
    position: fixed;
    width: calc(100% - 2rem);
    max-width: 1600px;
    left: 50%;
    transform: translateX(-50%);
}

.grid-2x4-active .propagation-grid,
.grid-3x3-active .propagation-grid,
.grid-4x2 .propagation-grid {
    margin-top: 8rem;
    width: 100%;
}

h1 {
    text-align: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    padding: 0.5rem 0;
    margin: 0;
    background: transparent;
}

.layout-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    border-left: 1px solid var(--grid-color);
    padding-left: 1rem;
}

#layoutSelect {
    padding: 0.25rem;
    border: 1px solid var(--grid-color);
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
}

.time-slider-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

#timeSlider {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: #dfe6e9;
    border-radius: 5px;
    outline: none;
    position: relative;
    z-index: 2;
}

#timeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--secondary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    z-index: 2;
}

#timeSlider::-webkit-slider-thumb:hover {
    background: #2980b9;
}

.current-time-indicator {
    position: absolute;
    padding: 1px 4px;
    background: var(--primary-color);
    border-radius: 8px;
    transform: translateX(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    top: -22px;
    border: 1px solid white;
    box-shadow: 0 0 4px rgba(0,0,0,0.2);
    color: white;
    font-size: 0.35rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    z-index: 1;
}

.current-time-indicator::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 3px solid var(--primary-color);
}

/* Remove the old SVG styles since we're not using them anymore */
.current-time-indicator svg {
    display: none;
}

/* Remove the separate clock icon since it's now part of the slider thumb */
.clock-icon {
    display: none;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#currentTime {
    font-family: monospace;
    font-size: 0.9rem;
    margin-left: 0.5rem;
    font-weight: normal;
}

.grid-4x2 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-4x2 .propagation-image {
    height: 160px;
}

.grid-4x2 .propagation-map {
    width: 462px;
    height: 218px;
}

.grid-2x4 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-2x4 .propagation-image {
    height: 340px;
}

.grid-2x4 .propagation-map {
    width: 924px;  /* Double the original width */
    height: 436px; /* Double the original height */
}

.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-3x3 .propagation-image {
    height: 250px;
}

.grid-3x3 .propagation-map {
    width: 616px;  /* Adjusted for 3x3 layout */
    height: 290px; /* Adjusted for 3x3 layout */
}

.band-row {
    padding: 0;
    border: 1px solid var(--grid-color);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.band-row:last-child {
    border: 1px solid var(--grid-color);
}

.band-label {
    display: block;
    text-align: center;
    font-weight: bold;
    font-size: 1.125rem;
    color: var(--primary-color);
    padding: 0.4rem;
    background: white;
    border-bottom: 1px solid var(--grid-color);
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-4x2 .band-label {
    font-size: 1.125rem;
}

.grid-2x4 .band-label {
    font-size: 1.125rem;
}

.grid-3x3 .band-label {
    font-size: 1.125rem;
}

.propagation-image {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.propagation-map {
    object-fit: contain;
}

.footer {
    margin-top: 0.5rem;
    padding: 0.25rem 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    font-size: 0.7rem;
    color: #666;
    position: relative;
    z-index: 90;
    gap: 1rem;
}

.copyright-left {
    font-style: italic;
    text-align: left;
}

.copyright-right {
    font-style: italic;
    text-align: right;
}

.version {
    font-family: monospace;
    text-align: center;
}

/* Fixed positioning for 2x4 layout */
.grid-2x4-active h1 {
    position: sticky;
}

.grid-2x4-active .time-control {
    position: sticky;
}

.grid-2x4-active .propagation-grid {
    margin-top: 0.5rem;
}

/* Fixed positioning for 3x3 layout */
.grid-3x3-active h1 {
    position: sticky;
}

.grid-3x3-active .time-control {
    position: sticky;
}

.grid-3x3-active .propagation-grid {
    margin-top: 0.5rem;
}

.grid-2x4-active .propagation-grid {
    margin-top: 9rem;
}

/* Remove the grid-specific container styles */
.grid-2x4-active h1,
.grid-3x3-active h1,
.grid-2x4-active .time-control,
.grid-3x3-active .time-control,
.grid-2x4-active .propagation-grid,
.grid-3x3-active .propagation-grid {
    position: static;
    margin-top: 0;
}

/* Remove old sticky positioning */
.grid-2x4-active h1,
.grid-3x3-active h1,
.grid-2x4-active .time-control,
.grid-3x3-active .time-control {
    position: static;
}

/* Keep the grid layout styles */
.grid-2x4 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4x2 {
    grid-template-columns: repeat(4, 1fr);
}

/* Layout styles */
.grid-4x2 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-2x4 {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 0.5rem;
}

.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 0.5rem;
}

/* Override container styles for 2x4 and 3x3 */
.grid-2x4-active .container > h1,
.grid-3x3-active .container > h1,
.grid-2x4-active .time-control,
.grid-3x3-active .time-control {
    position: static;
    transform: none;
    width: 100%;
    margin: 0.5rem 0;
    left: 0;
}

.grid-2x4-active .propagation-grid,
.grid-3x3-active .propagation-grid {
    margin-top: 0.5rem;
}

.dr2w-link {
    text-decoration: none;
    color: inherit;
}

.dr2w-link:hover {
    color: inherit;
}

.qth-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-right: 1px solid var(--grid-color);
    padding-right: 1rem;
    margin-right: 1rem;
}

#qthSelect {
    padding: 0.25rem;
    border: 1px solid var(--grid-color);
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    min-width: 130px;
    cursor: pointer;
}

#qthSelect:hover {
    border-color: var(--secondary-color);
}

#qthSelect:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--grid-color);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preload-status {
    position: absolute;
    top: -25px;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
} 