:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333333;
}

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

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

/* Language Switcher */
.lang-switch {
    /* position: absolute;  Removed absolute positioning */
    /* top: 0; */
    /* right: 0; */
    display: flex;
    justify-content: flex-end; /* Align to right */
    gap: 5px;
    margin-bottom: 20px; /* Add space below */
}

.lang-btn {
    background: none;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.lang-btn.active {
    background-color: var(--accent-color);
    color: white;
}

header {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 0; /* Removed margin-top since lang-switch is now in flow */
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2em; /* Default size */
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

button#searchBtn {
    padding: 12px 24px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

button#searchBtn:hover {
    background-color: #2980b9;
}

.hidden {
    display: none;
}

#loading, #error {
    text-align: center;
    margin: 10px 0;
    padding: 10px;
    border-radius: 4px;
}

#error {
    background-color: #fee;
    color: #c0392b;
    border: 1px solid #fab;
    word-wrap: break-word; /* Prevent long URLs from breaking layout */
}

#loading {
    color: #7f8c8d;
}

.info-card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.info-item {
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.label {
    font-weight: bold;
    min-width: 140px; /* Increased to accommodate "AAT Setting" */
    color: #555;
    flex-shrink: 0;
}

.highlight {
    font-size: 1.2em;
    color: var(--primary-color);
}

#resultDeclination {
    font-weight: bold;
    color: #e74c3c;
}

.note {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1; /* Ensure map stays below other potential overlays */
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .lang-switch {
        /* Already relative/flex by default now, just ensure alignment */
        justify-content: flex-end;
        margin-bottom: 10px;
    }

    header {
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .search-box {
        flex-direction: column;
    }

    button#searchBtn {
        width: 100%;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .label {
        margin-bottom: 4px;
    }
    
    #map {
        height: 300px;
    }
}