:root {
    --bg-main: #121212;
    --bg-surface: #1e1e1e;
    --bg-input: #2d2d2d;

    --text-primary: #f9f9f9;
    --text-secondary: #d1d5db;

    --accent-color: #4ade80; 
    --accent-text: #052e16; 

    --border-color: #4b5563;
    --focus-ring: #4ade80;
}

html {
    overflow-y: scroll;
}

body { 
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    margin: 0; 
    background-color: var(--bg-main); 
    color: var(--text-primary); 
    line-height: 1.5;
}

.page-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
header { background-color: var(--bg-surface); padding: 20px 15px; border-bottom: 1px solid var(--border-color); text-align: center; }
h1, h2, h3 { color: var(--text-primary); margin-top: 0; }
a { color: var(--accent-color); text-decoration: underline; text-underline-offset: 4px; }
a:hover { text-decoration: none; }

/* Flikar */
.tabs { display: flex; justify-content: center; margin-top: 15px; gap: 6px; flex-wrap: wrap; }
.tabs button { 
    background-color: var(--bg-input); 
    color: var(--text-primary); 
    border: 1px solid var(--border-color); 
    border-bottom: none;
    padding: 12px 18px; 
    cursor: pointer; 
    border-radius: 6px 6px 0 0; 
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.tabs button:hover { background-color: #3f3f46; }
.tabs button.active { 
    background-color: var(--accent-color); 
    color: var(--accent-text); 
    font-weight: 700; 
    border-color: var(--accent-color);
}
.tab-content { display: none; padding: 24px 15px; }
.active-tab { display: block; }

.layout { max-width: 800px; margin: 0 auto; width: 100%; box-sizing: border-box; }
#map { height: 350px; border-radius: 8px; margin-bottom: 24px; border: 1px solid var(--border-color); }

/* Formulär */
.form-container { background-color: var(--bg-surface); padding: 24px; border-radius: 8px; border: 1px solid var(--border-color); }
.form-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.form-addqso-group { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
label { font-size: 0.95rem; color: var(--text-primary); margin-bottom: 6px; font-weight: 500; }

input, select { 
    background-color: var(--bg-input); 
    color: var(--text-primary); 
    border: 1px solid var(--border-color); 
    padding: 12px; 
    border-radius: 6px; 
    font-size: 1rem;
    font-family: inherit;
}

input:focus, select:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
    border-color: transparent;
}

input:read-only { background-color: #27272a; color: #a1a1aa; cursor: not-allowed; }

/* Knappar */
.button { 
    background-color: var(--accent-color); 
    color: var(--accent-text); 
    border: none; 
    padding: 14px 20px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 1rem; 
    font-weight: 700; 
    width: 100%; 
    box-sizing: border-box;
    transition: opacity 0.2s ease;
}
.button:hover { opacity: 0.9; }
.button:focus-visible { outline: 3px solid var(--text-primary); outline-offset: 2px; }
.button:disabled { background-color: #52525b; color: #a1a1aa; cursor: not-allowed; }

/* Tabell */
.table-responsive { overflow-x: auto; }
.qso-table { width: 100%; border-collapse: collapse; background-color: var(--bg-surface); border-radius: 8px; overflow: hidden; }
.qso-table th, .qso-table td { padding: 14px; text-align: left; border-bottom: 1px solid var(--border-color); }
.qso-table th { background-color: var(--bg-input); color: var(--text-primary); font-weight: 600; }
.qso-table tr:last-child td { border-bottom: none; }

/* Specifika texter */
.highlight-call { font-weight: bold; color: var(--accent-color); }

.three-column-layout {
    display: grid;
    grid-template-columns: 300px 600px 450px; 
    gap: 20px;
    align-items: start;
    justify-content: center;
}

@media (max-width: 1200px) {
    .three-column-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}

/* Footer */
footer {
    margin-top: auto;
    background-color: var(--bg-surface);
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer p {
    margin: 0;
}