/* Główne style */
body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: #f4f4f9; color: #333; }
.container { max-width: 800px; margin: 30px auto; padding: 25px; background-color: #fff; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
h1 { color: #0056b3; text-align: center; margin-bottom: 25px; }
h2 { text-align: center; color: #333; margin-top: 10px; }
h3 { color: #333; margin-top: 25px; }
hr { border: none; border-top: 1px solid #eee; margin: 40px 0; }

/* === STYLE NAGŁÓWKA Z LOGO === */
.site-header { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 25px; }
.logo-link { flex-shrink: 0; }
.logo-image { height: 60px; width: auto; display: block; }
.site-title-wrapper h1 { margin: 0; font-size: 2.5em; color: #0056b3; line-height: 1; font-weight: bold; }
h1:not(.site-title-wrapper h1) { color: #0056b3; text-align: center; margin-bottom: 25px; }

/* === STYLE MENU (WERSJA DESKTOP) === */
.main-nav { background-color: #333; padding: 0; margin-bottom: 25px; width: 100%; border-radius: 4px; position: relative; }
.main-nav .menu-toggle { display: none; }
.main-nav ul { display: flex; justify-content: center; list-style-type: none; margin: 0; padding: 0; }
.main-nav ul li { position: relative; }
.main-nav ul li a { color: white; text-decoration: none; padding: 15px 20px; display: block; transition: background-color 0.2s; white-space: nowrap; }
.main-nav ul li a:hover { background-color: #555; }
.main-nav ul li a.active { background-color: #007bff; font-weight: bold; }
.main-nav ul li.dropdown > a { padding-right: 35px; }
.main-nav ul li.dropdown > a::after { content: '▾'; font-size: 16px; position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: #aaa; transition: color 0.2s; }
.main-nav ul li a:hover::after { color: white; }
.main-nav .submenu { display: none; position: absolute; left: 0; top: 100%; background-color: #333; padding: 0; margin: 0; list-style: none; min-width: 250px; box-shadow: 0 8px 16px rgba(0,0,0,0.2); z-index: 1000; border-radius: 0 0 8px 8px; }
.main-nav .submenu li { width: 100%; }
.main-nav .submenu li a { padding: 12px 20px; border-bottom: 1px solid #444; }
.main-nav .submenu li:last-child a { border-bottom: none; border-radius: 0 0 8px 8px; }
.main-nav li:hover > .submenu { display: block; }

/* === STYLE MENU NA MOBILE (RESPONSYWNOŚĆ) === */
@media screen and (max-width: 850px) {
    .main-nav { padding: 5px; }
    
    /* Ukrywa główny kontener menu domyślnie */
    .main-nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    
    /* Pokazuje menu po kliknięciu w hamburger (gdy JS doda klasę .active) */
    .main-nav ul.active {
        display: flex;
    }
    
    /* Pokazuje przycisk hamburgera */
    .main-nav .menu-toggle {
        display: block;
        color: white;
        font-size: 24px;
        padding: 5px 15px;
        border: none;
        background: none;
        cursor: pointer;
        text-align: left;
    }
    
    .main-nav ul li { width: 100%; text-align: left; }
    .main-nav ul li a, .main-nav ul li.dropdown > a { padding: 15px; }

    /* --- KLUCZOWA ZMIANA NR 1 --- */
    /* Domyślnie UKRYJ podmenu w widoku mobilnym */
    .main-nav .submenu {
        display: none;  /* Zamiast 'display: block' */
        position: static;
        box-shadow: none;
        border-radius: 0;
        background-color: #444; /* Delikatnie inne tło dla odróżnienia */
        width: 100%;
    }
    
    /* Styl dla linków w podmenu, aby były wcięte */
    .main-nav .submenu a { padding-left: 40px; }

    /* --- KLUCZOWA ZMIANA NR 2 --- */
    /* Nowa reguła, która pokaże podmenu, gdy jego rodzic otrzyma klasę .open */
    .main-nav li.dropdown.open > .submenu {
        display: block;
    }
} /* <--- POPRAWKA: Nawias zamykający @media jest teraz tutaj */

/* === Pod-zakładki === */
.sub-tabs { display: flex; gap: 10px; margin-bottom: 25px; border-radius: 8px; background-color: #f0f0f0; padding: 5px; }
.sub-tab-link { flex: 1; padding: 8px 10px; text-align: center; border: none; background-color: transparent; border-radius: 6px; cursor: pointer; font-size: 15px; transition: background-color 0.2s, color 0.2s; }
.sub-tab-link.active { background-color: #fff; color: #0056b3; font-weight: bold; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.sub-tab-content { display: none; }
.sub-tab-content.active { display: block; }

/* === Główna zawartość i opisy === */
.converter-section, .article-section, .homepage-section { padding: 10px; }
.tool-content { padding-top: 10px; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-weight: bold; }
.seo-description { font-size: 15px; line-height: 1.6; color: #555; margin: 0 auto 25px auto; text-align: center; max-width: 90%; }
.unit-description { margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; overflow: auto; clear: both; }
.unit-description p { font-size: 15px; line-height: 1.7; color: #444; margin-top: 0; text-align: justify; }

/* === Formularze i przyciski === */
#local-tz-info { font-weight: normal; color: #007bff; font-size: 0.9em; margin-left: 5px; }
input, select { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 16px; }
input:focus, select:focus { border-color: #007bff; outline: none; box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); }
button { cursor: pointer; }
button.action-btn { width: 100%; padding: 12px 15px; background-color: #0056b3; color: #FFFFFF; font-size: 16px; border: none; border-radius: 4px; transition: background-color 0.2s; }
button.action-btn:hover { background-color: #0056b3; }
button.action-btn:disabled { background-color: #a0a0a0; cursor: not-allowed; }

.status-message { margin-top: 15px; color: #555; text-align: center; min-height: 20px; font-size: 0.9em; }
.rate-display { text-align: center; font-size: 1em; color: #555; margin-top: -10px; height: 20px; }
.fields-group { display: flex; gap: 10px; flex-wrap: wrap; }
.two-way-converter { display: flex; align-items: flex-end; gap: 15px; flex-wrap: wrap; }
.converter-pane { flex: 1; min-width: 240px; }
#weightOutput, #distanceOutput, #currencyOutput, #pressureOutput, #timeUnitOutput, #eurToPlnOutput, #plnToEurOutput, #tryToPlnOutput, #plnToTryOutput, #eurToTryOutput { background-color: #f0f0f0; font-weight: bold; }
.swap-button-wrapper { margin-bottom: 20px; }
#swapWeightBtn, #swapDistanceBtn, #swapCurrencyBtn, #swapPressureBtn, #swapTimeUnitBtn { padding: 10px; font-size: 20px; line-height: 1; border: 1px solid #ccc; background-color: #f9f9f9; border-radius: 4px; height: 43.5px; box-sizing: border-box; }

/* === WYSZUKIWARKA NA STRONIE GŁÓWNEJ === */
#structuredSearchForm .search-fields { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-end; }
#structuredSearchForm .search-pane { display: flex; flex-direction: column; }
#structuredSearchForm .value-pane { flex: 1 1 120px; }
#structuredSearchForm .unit-pane { flex: 2 1 200px; }
#structuredSearchForm .button-pane { flex: 1 1 150px; }
#searchError { color: #d93025; text-align: center; min-height: 20px; }

/* === NAJPOPULARNIEJSZE PRZELICZENIA === */
.popular-conversions { margin-top: 40px; text-align: center; }
#popular-links-container { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 15px; }
a.popular-link { display: inline-block; background-color: #e9ecef; color: #495057; padding: 8px 15px; border-radius: 20px; text-decoration: none; font-size: 14px; transition: background-color 0.2s, color 0.2s; }
a.popular-link:hover { background-color: #007bff; color: white; }

/* === KALKULATOR NAUKOWY === */
.calculator-grid { max-width: 500px; margin: 20px auto; border: 1px solid #ccc; border-radius: 10px; padding: 20px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); background: #fdfdfd; }
.calculator-display { background: #222; color: white; padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; text-align: right; }
.calculator-input-history { font-size: 1em; color: #a0a0a0; min-height: 20px; word-wrap: break-word; }
.calculator-output { font-size: 2.5em; font-weight: bold; min-height: 50px; }
.calculator-keys { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.calculator-keys .key { padding: 20px 0; font-size: 1.2em; border: none; border-radius: 8px; background: #f0f0f0; cursor: pointer; transition: background-color 0.2s; color: #333; }
.calculator-keys .key:hover { background-color: #ddd; }
.key-op { background-color: #f9a825; color: white; }
.key-op:hover { background-color: #f59f00; }
.key-func { background-color: #e0e0e0; }
.key-func:hover { background-color: #d0d0d0; }
.key-equals { background-color: #007bff; color: white; grid-column: span 2; }
.key-equals:hover { background-color: #0056b3; }
.key-clear { background-color: #d32f2f; color: white; }
.key-clear:hover { background-color: #b71c1c; }

/* === OSTATECZNA POPRAWKA: STYL DLA AKTYWNYCH PRZYCISKÓW RAD/DEG/INV === */
.calculator-keys .key.active-func {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

/* === Pozostałe === */
.results { margin-top: 20px; padding-top: 15px; border-top: 1px solid #eee; }
#pdfToJpgResults { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; }
.thumbnail { border: 1px solid #ccc; padding: 5px; text-align: center; }
.thumbnail img { max-width: 100px; max-height: 140px; display: block; margin-bottom: 5px; }
.thumbnail a { font-size: 12px; }
.ad-banner-placeholder { width: 100%; min-height: 90px; margin-top: 25px; background-color: #f0f0f0; border: 2px dashed #ccc; display: flex; align-items: center; justify-content: center; text-align: center; color: #888; font-size: 14px; box-sizing: border-box; }
footer { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; }
.footer-content p { font-size: 14px; color: #777; line-height: 1.6; }
.footer-content a { color: #007bff; text-decoration: none; font-weight: bold; }
.footer-content a:hover { text-decoration: underline; }
p.copyright { font-size: 12px; color: #555555; margin-top: 20px; }

a {
    color: #0056b3; /* Ciemniejszy, bardziej czytelny odcień niebieskiego */
    text-decoration: underline; /* Podkreślenie pomaga odróżnić link od zwykłego tekstu */
}

a:hover {
    color: #003d82; /* Jeszcze ciemniejszy odcień po najechaniu myszką */
}

footer a {
    color: #0056b3; /* Ciemny, czytelny odcień niebieskiego */
    text-decoration: underline;
}

footer a:hover {
    color: #003d82; /* Ciemniejszy odcień po najechaniu myszką */
}
/* --- Style dla zaawansowanego generatora słów --- */
.generator-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
}

#results-container h3 {
    text-align: center;
    margin-bottom: 10px;
}

.generated-words-box {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    font-size: 1.1em;
    line-height: 1.8;
    text-align: center;
    word-wrap: break-word;
    min-height: 50px;
}

/* Dostosowanie inputów tekstowych dla generatora */
#first-letter, #last-letter {
    text-transform: lowercase;
}

/* Styl dla całego wiersza z etykietą i polami */
#percentage-calculator-container .input-group label {
    font-size: 1.1em; /* Lekko powiększa tekst i pola dla lepszej czytelności */
    color: #333;
    display: block;
    padding: 15px 0; /* Dodaje więcej przestrzeni pionowej */
    line-height: 2; /* Poprawia wyrównanie tekstu w pionie */
}

/* Styl dla samych pól do wpisywania wewnątrz tekstu */
#percentage-calculator-container .input-group input {
    display: inline-block;
    width: 140px; /* Nieco szersze dla wygody */
    margin: 0 8px;
    text-align: center;
    vertical-align: middle; /* <<< KLUCZOWA ZMIANA: Wyrównuje pole idealnie z tekstem */
    font-size: 0.95em; /* Lekkie dopasowanie rozmiaru czcionki pola */
    padding: 10px; /* Zachowuje spójny padding z innymi polami */
    box-sizing: border-box; /* Zapewnia, że padding nie psuje szerokości */
}

/* Styl dla pola z wynikiem w drugim kalkulatorze */
#calc2 .input-group span {
    font-weight: bold;
    color: #0056b3;
    margin: 0 5px;
}

/* Pozostałe style pudełka na wynik (bez zmian) */
.percentage-result-box {
    background-color: #f0f0f0;
    border-radius: 8px;
    padding: 10px 20px;
    margin-top: 15px;
    text-align: center;
}
.percentage-result-box h4 {
    margin: 0 0 5px 0;
    font-size: 1em;
    color: #555;
    font-weight: normal;
}
.percentage-result-box p {
    margin: 0;
    font-size: 1.8em;
    font-weight: bold;
    color: #0056b3;
}