/* ============================
   BMI Kalkulačka – Ideální BMI
   Mobile-first responsive CSS
   ============================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    line-height: 1.6;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}

a {
    color: #5d7912;
    text-decoration: none;
}

a:hover {
    color: #7d9321;
    text-decoration: underline;
}

/* ---------- Container ---------- */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Header ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1.15rem;
}

.logo img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
}

/* Hamburger */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 110;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #1a1a1a;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Nav */
.nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    flex-direction: column;
    padding: 8px 0;
}

.nav.open {
    display: flex;
}

.nav-link {
    padding: 12px 20px;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.2s;
}

.nav-link:hover {
    background: #f9faf5;
    color: #5d7912;
    text-decoration: none;
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, #f9faf5 0%, #e0e2aa33 100%);
    padding: 40px 0 50px;
}

.hero h1 {
    font-size: 1.75rem;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 12px;
}

.hero-subtitle {
    color: #666;
    font-size: 1rem;
    margin-bottom: 30px;
    max-width: 640px;
}

/* ---------- Calculator Card ---------- */
.calc-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Tabs */
.calc-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
}

.calc-tab {
    flex: 1;
    padding: 14px 8px;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.calc-tab:hover {
    color: #7d9321;
}

.calc-tab.active {
    color: #9ead2f;
    border-bottom-color: #9ead2f;
}

/* Panels */
.calc-panel {
    display: none;
    padding: 24px 20px;
}

.calc-panel.active {
    display: block;
}

/* Form */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.form-group .optional {
    font-weight: 400;
    color: #999;
    font-size: 0.8rem;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #9ead2f;
    box-shadow: 0 0 0 3px rgba(158, 173, 47, 0.15);
}

.form-group input.invalid {
    border-color: #e74c3c;
}

.form-error {
    font-size: 0.8rem;
    color: #e74c3c;
    margin-top: 4px;
    min-height: 1.2em;
}

/* CTA Button */
.btn-calculate {
    display: block;
    width: 100%;
    padding: 14px;
    background: #9ead2f;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 8px;
}

.btn-calculate:hover {
    background: #7d9321;
}

.btn-calculate:active {
    transform: scale(0.98);
}

/* ---------- Result ---------- */
.calc-result {
    padding: 24px 20px;
    border-top: 1px solid #eee;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    text-align: center;
    margin-bottom: 20px;
}

.result-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.result-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.1;
}

.result-category {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Category colors */
.result-category.cat-severe-underweight { background: #dbeafe; color: #1e40af; }
.result-category.cat-underweight { background: #e0f2fe; color: #0369a1; }
.result-category.cat-mild-underweight { background: #e0f7fa; color: #00838f; }
.result-category.cat-normal { background: #e8f5e9; color: #2e7d32; }
.result-category.cat-overweight { background: #fff8e1; color: #f57f17; }
.result-category.cat-obese1 { background: #fff3e0; color: #e65100; }
.result-category.cat-obese2 { background: #fbe9e7; color: #bf360c; }
.result-category.cat-obese3 { background: #ffebee; color: #b71c1c; }

/* Children category colors */
.result-category.cat-child-underweight { background: #dbeafe; color: #1e40af; }
.result-category.cat-child-normal { background: #e8f5e9; color: #2e7d32; }
.result-category.cat-child-overweight { background: #fff8e1; color: #f57f17; }
.result-category.cat-child-obese { background: #ffebee; color: #b71c1c; }

/* ---------- BMI Gauge ---------- */
.bmi-gauge {
    margin: 20px 0;
}

.gauge-bar {
    position: relative;
    height: 22px;
    border-radius: 11px;
    background: linear-gradient(to right,
        #2196f3 0%,        /* severe underweight */
        #03a9f4 8%,        /* underweight */
        #00bcd4 14%,       /* mild underweight */
        #4caf50 20%,       /* normal start */
        #8bc34a 35%,       /* normal mid */
        #4caf50 42%,       /* normal end */
        #ffeb3b 52%,       /* overweight start */
        #ffc107 58%,       /* overweight end */
        #ff9800 67%,       /* obese 1 */
        #ff5722 78%,       /* obese 2 */
        #f44336 90%,       /* obese 3 */
        #d32f2f 100%
    );
    overflow: visible;
}

.gauge-marker {
    position: absolute;
    top: -6px;
    width: 4px;
    height: 34px;
    background: #1a1a1a;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gauge-marker-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.7rem;
    color: #999;
    padding: 0 2px;
}

/* ---------- Result Details ---------- */
.result-details {
    margin-top: 16px;
}

.result-details .detail-item {
    padding: 10px 14px;
    background: #f9faf5;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    border-left: 3px solid #9ead2f;
}

.result-details .detail-item.warning {
    border-left-color: #ff9800;
    background: #fff8e1;
}

.result-details .detail-item.danger {
    border-left-color: #f44336;
    background: #ffebee;
}

.result-details .detail-item strong {
    color: #1a1a1a;
}

/* ---------- Sections ---------- */
.section {
    padding: 50px 0;
}

.section-alt {
    background: #f9faf5;
}

.section h2 {
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 16px;
    line-height: 1.3;
}

.section h3 {
    font-size: 1.15rem;
    color: #1a1a1a;
    margin-top: 28px;
    margin-bottom: 10px;
}

.section p {
    margin-bottom: 14px;
    color: #333;
}

.section ol,
.section ul {
    margin-bottom: 14px;
    padding-left: 24px;
}

.section li {
    margin-bottom: 6px;
}

/* ---------- Section with Image ---------- */
.section-with-image {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-image img {
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    height: auto;
    margin: 0 auto;
}

/* ---------- Banner Ad ---------- */
.banner-ad {
    text-align: center;
    padding: 24px 20px;
}

.banner-ad a {
    display: inline-block;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.banner-ad a:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.banner-ad img {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

@media (min-width: 700px) {
    .section-with-image {
        flex-direction: row;
        align-items: flex-start;
        gap: 32px;
    }

    .section-text {
        flex: 1;
    }

    .section-image {
        flex-shrink: 0;
        width: 280px;
    }

    .section-image img {
        max-width: 100%;
    }
}

/* ---------- Section with Ad (sidebar) ---------- */
.section-with-ad {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-ad {
    width: 100%;
}

.section-ad-content {
    min-width: 0;
}

@media (min-width: 800px) {
    .section-with-ad {
        flex-direction: row;
        align-items: flex-start;
        gap: 28px;
    }

    .section-ad {
        flex-shrink: 0;
        width: 300px;
        position: sticky;
        top: 80px;
    }

    .section-ad-content {
        flex: 1;
    }
}

@media (min-width: 900px) {
    .section-image {
        width: 340px;
    }
}

/* ---------- Formula Box ---------- */
.formula-box {
    background: #f9faf5;
    border: 2px solid #bfc76c;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.formula {
    font-size: 1.2rem;
    font-weight: 700;
    color: #5d7912;
    margin-bottom: 0;
}

/* ---------- Tables ---------- */
.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
    -webkit-overflow-scrolling: touch;
}

.bmi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.bmi-table th,
.bmi-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.bmi-table thead th {
    background: #5d7912;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bmi-table thead th:first-child {
    border-radius: 8px 0 0 0;
}

.bmi-table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.bmi-table tbody tr:hover {
    background: #f9faf5;
}

/* BMI table row accents */
.bmi-cat-severe-underweight td:first-child { border-left: 4px solid #2196f3; }
.bmi-cat-underweight td:first-child { border-left: 4px solid #03a9f4; }
.bmi-cat-mild-underweight td:first-child { border-left: 4px solid #00bcd4; }
.bmi-cat-normal td:first-child { border-left: 4px solid #4caf50; }
.bmi-cat-overweight td:first-child { border-left: 4px solid #ffc107; }
.bmi-cat-obese1 td:first-child { border-left: 4px solid #ff9800; }
.bmi-cat-obese2 td:first-child { border-left: 4px solid #ff5722; }
.bmi-cat-obese3 td:first-child { border-left: 4px solid #f44336; }

/* Children table accents */
.child-cat-underweight td:first-child { border-left: 4px solid #2196f3; }
.child-cat-normal td:first-child { border-left: 4px solid #4caf50; }
.child-cat-overweight td:first-child { border-left: 4px solid #ffc107; }
.child-cat-obese td:first-child { border-left: 4px solid #f44336; }

/* Waist table accents */
.waist-ok td:first-child { border-left: 4px solid #4caf50; }
.waist-elevated td:first-child { border-left: 4px solid #ffc107; }
.waist-high td:first-child { border-left: 4px solid #f44336; }

/* Risk badges */
.risk-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.risk-minimal { background: #e8f5e9; color: #2e7d32; }
.risk-low { background: #e0f7fa; color: #00838f; }
.risk-medium { background: #e0f2fe; color: #0369a1; }
.risk-elevated { background: #fff8e1; color: #f57f17; }
.risk-high { background: #fff3e0; color: #e65100; }
.risk-very-high { background: #fbe9e7; color: #bf360c; }
.risk-extreme { background: #ffebee; color: #b71c1c; }

/* ---------- Info Box ---------- */
.info-box {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 16px 18px;
    margin-top: 20px;
}

.info-box p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #333;
}

/* ---------- FAQ ---------- */
.faq-list {
    max-width: 800px;
}

.faq-item {
    border-bottom: 1px solid #e0e0e0;
}

.faq-item:first-child {
    border-top: 1px solid #e0e0e0;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    gap: 12px;
}

.faq-question:hover {
    color: #5d7912;
}

.faq-icon {
    flex-shrink: 0;
    transition: transform 0.3s;
    color: #999;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
    color: #9ead2f;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.faq-answer p {
    padding-bottom: 16px;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ---------- Footer ---------- */
.footer {
    background: #1a1a1a;
    color: #aaa;
    padding: 30px 0;
    text-align: center;
    font-size: 0.85rem;
}

.disclaimer {
    margin-bottom: 12px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    color: #999;
}

.footer-operator {
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: #999;
}

.footer-copy {
    color: #666;
}

.footer-copy a {
    color: #bfc76c;
}

.footer-copy a:hover {
    color: #e0e2aa;
}

/* ---------- Support Section ---------- */
.support-section {
    text-align: center;
}

.support-button-wrapper {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

/* =============================
   Responsive Breakpoints
   ============================= */

/* Tablet (600px+) */
@media (min-width: 600px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .section h2 {
        font-size: 1.75rem;
    }

    .calc-panel {
        padding: 28px 28px;
    }

    .calc-result {
        padding: 28px;
    }
}

/* Desktop (800px+) */
@media (min-width: 800px) {
    .hamburger {
        display: none;
    }

    .nav {
        display: flex !important;
        position: static;
        background: none;
        border: none;
        box-shadow: none;
        flex-direction: row;
        padding: 0;
        gap: 4px;
    }

    .nav-link {
        padding: 8px 14px;
        border-radius: 6px;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero {
        padding: 60px 0 70px;
    }

    .section {
        padding: 60px 0;
    }

    .calc-panel {
        padding: 32px;
    }

    .calc-result {
        padding: 32px;
    }

    .calc-tab {
        font-size: 1rem;
        padding: 16px 12px;
    }
}

/* ============================
   Cookie Consent Banner
   ============================ */

/* ---------- Banner ---------- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.35s ease;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cookie-text {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.5;
    margin: 0;
}

.cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.cookie-btn:active {
    transform: scale(0.97);
}

.cookie-btn-accept {
    background: #9ead2f;
    color: #fff;
    padding: 12px 28px;
    font-size: 0.95rem;
}

.cookie-btn-accept:hover {
    background: #7d9321;
}

.cookie-btn-settings {
    background: transparent;
    color: #5d7912;
    border: 1.5px solid #5d7912;
}

.cookie-btn-settings:hover {
    background: #f9faf5;
}

.cookie-btn-reject {
    background: transparent;
    color: #999;
    font-weight: 400;
    font-size: 0.82rem;
    padding: 8px 12px;
}

.cookie-btn-reject:hover {
    color: #555;
}

/* ---------- Settings Overlay ---------- */
.cookie-settings-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px;
}

.cookie-settings-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.cookie-settings-panel {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.cookie-settings-overlay.visible .cookie-settings-panel {
    transform: translateY(0);
}

.cookie-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #eee;
}

.cookie-settings-header h3 {
    font-size: 1.1rem;
    color: #1a1a1a;
    margin: 0;
}

.cookie-settings-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.cookie-settings-close:hover {
    color: #333;
}

.cookie-settings-body {
    padding: 8px 0;
}

.cookie-setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    gap: 16px;
}

.cookie-setting-item + .cookie-setting-item {
    border-top: 1px solid #f0f0f0;
}

.cookie-setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cookie-setting-info strong {
    font-size: 0.95rem;
    color: #1a1a1a;
}

.cookie-setting-info span {
    font-size: 0.82rem;
    color: #888;
}

/* ---------- Toggle Switch ---------- */
.cookie-toggle-wrapper {
    flex-shrink: 0;
    position: relative;
    width: 46px;
    height: 26px;
}

.cookie-toggle {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle-label {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #ccc;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.25s;
}

.cookie-toggle-label::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cookie-toggle:checked + .cookie-toggle-label {
    background: #9ead2f;
}

.cookie-toggle:checked + .cookie-toggle-label::after {
    transform: translateX(20px);
}

.cookie-toggle:disabled + .cookie-toggle-label {
    background: #9ead2f;
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------- Settings Footer ---------- */
.cookie-settings-footer {
    padding: 14px 22px;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.cookie-btn-save {
    background: #9ead2f;
    color: #fff;
}

/* ---------- Cookie Banner Responsive ---------- */
@media (min-width: 600px) {
    .cookie-banner-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .cookie-text {
        flex: 1;
        margin-right: 16px;
    }

    .cookie-buttons {
        flex-shrink: 0;
    }
}
