/* Common styles for all pages */
body {
    margin: 0;
    padding: 0;
    font-family: 'Figtree', sans-serif;
}

.navbar {
    background-color: #FDF312;
    overflow: hidden;
    padding: 0;
    z-index: 1000;
    position: relative;
    display: flex;
    align-items: stretch;
    height: 58px;
}

.navbar a {
    color: #333;
    text-align: center;
    padding: 0 16px;
    text-decoration: none;
    font-size: 17px;
    font-family: 'Figtree', sans-serif;
    font-weight: 600;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.navbar a:hover {
    background-color: #e6dc10;
    color: black;
}

.navbar a.active {
    background-color: #e6dc10;
    color: black;
}

.navbar-logo {
    margin-left: auto;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 15px;
}

.navbar-logo img {
    height: 30px;
    display: block;
}

.navbar-logo a {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    text-decoration: none;
}

/* Specific styles for map page - applied when #map exists */
.map-layout {
    height: calc(100vh - 58px); /* Subtract navbar height */
    display: flex;
    flex-direction: column;
}

#map {
    flex: 1;
    width: 100%;
    min-height: 0;
}

.legend {
    line-height: 18px;
    color: #555;
    background: white;
    padding: 10px;
    border-radius: 5px;
}

.legend i {
    width: 18px;
    height: 18px;
    float: left;
    margin-right: 8px;
    opacity: 0.7;
}

/* Loading indicator on map page */
.map-layout .loading-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
}

.popup-chart-container {
    width: 300px;
    height: 200px;
    margin-top: 15px;
}

/* Specific styles for charts page */
.charts-layout {
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

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

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    height: 500px;
}

/* Loading indicator on charts page */
.charts-layout .loading-indicator {
    text-align: center;
    padding: 50px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-message {
    text-align: center;
    padding: 50px;
    background: #ffebee;
    border-radius: 10px;
    color: #c62828;
    display: none;
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    text-align: center;
}

.controls label {
    margin-right: 10px;
    font-weight: 500;
}

.controls .metric-label {
    margin-left: 20px;
}

.refresh-button.secondary {
    background: #e9ecef;
    color: #333;
    margin-left: 8px;
}

.controls select {
    padding: 8px 12px;
    margin-right: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Figtree', sans-serif;
}

.sensor-controls {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.sensor-controls h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.sensor-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    text-align: left;
}

.sensor-checkbox {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.sensor-checkbox:hover {
    background-color: #f8f9fa;
}

.sensor-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

.sensor-checkbox label {
    margin: 0;
    cursor: pointer;
    font-weight: 400;
    flex: 1;
}

.sensor-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-left: 10px;
}

.refresh-button {
    padding: 10px 20px;
    background-color: #FDF312;
    color: #333;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.refresh-button:hover {
    background-color: #e6dc10;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #a18ffa;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-weight: 500;
}

/* Specific styles for about page */
.about-layout {
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    flex-grow: 1;
    text-align: center;
}

.about-layout h1 {
    color: #000000;
    margin-bottom: 30px;
}

.about-layout p {
    margin-bottom: 20px;
    font-size: 1.1em;
    text-align: justify;
}

.about-layout .goals-list {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.about-layout a.external-link {
    color: #a18ffa;
    font-weight: 600;
}

.highlight {
    font-weight: bold;
    color: #a18ffa;
}

.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 10px;
    margin-top: auto;
}

/* Wiki styles for Hałas pages */
.wiki-content {
    max-width: 900px;
    text-align: left;
}

.wiki-content h1 {
    text-align: center;
}

.wiki-content h2 {
    color: #333;
    margin-top: 35px;
    padding-bottom: 8px;
    border-bottom: 2px solid #FDF312;
}

.wiki-content h3 {
    color: #555;
    margin-top: 25px;
}

.wiki-content ul {
    max-width: 100%;
    margin: 0 0 20px 0;
}

.wiki-content p {
    text-align: left;
}

.wiki-breadcrumb {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 5px;
}

.wiki-breadcrumb a {
    color: #a18ffa;
    text-decoration: none;
}

.wiki-breadcrumb a:hover {
    text-decoration: underline;
}

.wiki-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.wiki-card {
    display: block;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.wiki-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #FDF312;
}

.wiki-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.2em;
}

.wiki-card p {
    margin: 0;
    color: #666;
    font-size: 0.95em;
    line-height: 1.5;
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0 25px 0;
    font-size: 0.95em;
}

.wiki-table th, .wiki-table td {
    border: 1px solid #ddd;
    padding: 10px 14px;
    text-align: left;
}

.wiki-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.wiki-table-highlight {
    background-color: #fff3cd;
}

.wiki-nav {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    text-align: center;
    font-size: 0.95em;
}

.wiki-nav a {
    color: #a18ffa;
    text-decoration: none;
    font-weight: 500;
}

.wiki-nav a:hover {
    text-decoration: underline;
}

.wiki-nav-sep {
    color: #ccc;
    margin: 0 10px;
}

.wiki-links ul {
    list-style: none;
    padding: 0;
}

.wiki-links li {
    margin-bottom: 8px;
}

.wiki-links a {
    color: #a18ffa;
    text-decoration: none;
    font-weight: 500;
}

.wiki-links a:hover {
    text-decoration: underline;
}
