/* ============================================================
   ZÁKLADNÍ RESET A TYPOGRAFIE
============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* ------------------------------------------------------------
   KONTEJNER
------------------------------------------------------------- */
.container {
    max-width: 1366px;
    margin: 0 auto;
    padding: 1rem;
}

/* ============================================================
   HLAVNÍ NADPIS
============================================================ */
.main-title {
    text-align: center;
    font-size: 2rem;
    margin: 2rem 0 1rem;
    color: #2c3e50;
    font-weight: 600;
}

/* ============================================================
   TOC (TABLE OF CONTENTS) – STICKY MENU
------------------------------------------------------------- */
.toc {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0 2rem;
    flex-wrap: wrap;
    background-color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #ddd;
    position: sticky;
    top: 1rem;
    z-index: 50;
}
.toc a {
    background-color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
    color: #2c3e50;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
}
.toc a:hover {
    background-color: #e67e22;
    color: #fff;
}

/* ============================================================
   DISCLAIMER / PODMÍNKY
------------------------------------------------------------- */
.disclaimer {
    background-color: #fffaf5; /* jemně krémová */
    border: 1px solid #ffe5cc;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #5a3e1b;
}
.disclaimer ul {
    margin-left: 1rem;
    list-style-type: disc;
}
.disclaimer li {
    margin-bottom: 0.4rem;
}

/* ============================================================
   LOADER S PROGRES BAREM
------------------------------------------------------------- */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.progress-container {
    background-color: #ffffff;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
}
.progress-bar-outer {
    width: 100%;
    background-color: #e0e0e0;
    height: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    overflow: hidden;
}
.progress-bar-inner {
    width: 0%;
    height: 100%;
    background-color: #e67e22;
    transition: width 0.2s ease;
    border-radius: 6px;
}

/* ============================================================
   FORMULÁŘ JAKO KARTA
------------------------------------------------------------- */
.form {
    background-color: #ffffff;
    padding: 2rem 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
}

/* ------------------------------------------------------------
   ŘÁDEK PRO URL + TLAČÍTKO (url-row)
------------------------------------------------------------- */
.url-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 0.5rem !important;
}
.url-input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.url-input-wrap input.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(27,31,35,0.05);
    outline: none;
    transition: border-color 0.2s ease;
}
.url-input-wrap input.form-control:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230,126,34,0.2);
}
.btn.btn-primary.btn-analyze {
    background-color: #e67e22;
    color: #fff;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}
.btn.btn-primary.btn-analyze:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    color: #fff;
}
.btn.btn-primary.btn-analyze:not(:disabled):hover {
    background-color: #cf6f17;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ------------------------------------------------------------
   Chybová hláška pod URL (urlError)
------------------------------------------------------------- */
#error-url,
#urlError {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    text-align: left;
}

/* ------------------------------------------------------------
   Souhlas s podmínkami (form-inline, tos)
------------------------------------------------------------- */
.form-inline {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    margin-left: auto;
    margin-right: auto;
}
.form-inline input[type="checkbox"] {
    transform: scale(1.1);
}
.form-inline label.tos {
    font-size: 0.95rem;
    color: #555;
    margin: 0 !important;
}

/* ------------------------------------------------------------
   Oddělovací čára (separator)
------------------------------------------------------------- */
.separator {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid #e1e1e1;
}

/* ============================================================
   POKROČILÉ POLE (grid-2)
------------------------------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
}

/* ------------------------------------------------------------
   Form-control pro čísla, text, select, textarea
------------------------------------------------------------- */
.form-control {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}

/* ------------------------------------------------------------
   Labely a popisky
------------------------------------------------------------- */
label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 400;
    color: #2c3e50;
    font-size: 0.95rem;
}

/* ------------------------------------------------------------
   Pomocné tooltippy (help + tooltip-text)
------------------------------------------------------------- */
.help {
    position: relative;
    cursor: pointer;
    font-weight: bold;
    margin-left: 0.3rem;
    color: #999;
    font-size: 1rem;
}
.help .tooltip-text {
    visibility: hidden;
    width: max-content;
    max-width: 200px;
    background-color: #333;
    color: #fff;
    text-align: left;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s;
}
.help:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ------------------------------------------------------------
   RADIO-GROUP A CHECKBOX (link-robots-row)
------------------------------------------------------------- */
.radio-group {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.5rem;
}
.radio-group label {
    font-size: 0.93rem;
    color: #555;
}
.radio-group input {
    margin-right: 0.3rem;
}
.link-robots-row .form-inline {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ============================================================
   VÝSLEDKY (RESULTS) – ZÁKLADNÍ KONTEJNERY
------------------------------------------------------------ */
.results {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* ------------------------------------------------------------
   Souhrn metrik (summary-metrics)
------------------------------------------------------------- */
.summary-metrics {
    background-color: #ffffff;
}

.section-title {
    margin-top: 4rem;
}

.section-intro {
    margin-bottom: 1rem;
}

/* ------------------------------------------------------------
   Karty s metrikami (metrics-cards)
------------------------------------------------------------- */
.metrics-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.metric-card {
    flex: 1 1 calc(25% - 1rem);
    background-color: #fafafc;
    border: 1px solid #e1e1e6;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #2c3e50;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}
.ok-card {
    border-left: 4px solid #2ecc71;
}
.bad-card {
    border-left: 4px solid #e74c3c;
}

/* ------------------------------------------------------------
   Skóre (score-summary)
------------------------------------------------------------- */
.score-summary {
    background-color: #f0f8ff;
    border: 1px solid #bbdefb;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: #1f3c88;
}

/* ------------------------------------------------------------
   Tabulka se souhrnem (summary-metrics table)
------------------------------------------------------------- */
.summary-metrics table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.summary-metrics th,
.summary-metrics td {
    border: 1px solid #e1e1e6;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.9rem;
    color: #2c3e50;
}
.summary-metrics th {
    background-color: #f4f6f8;
    font-weight: 600;
}
.summary-metrics tr.critical {
    background-color: #fdecea;
}

/* ------------------------------------------------------------
   Debug sekce (debug-section)
------------------------------------------------------------- */
.debug-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e1e6;
}
.debug-section h3 {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: #2c3e50;
}
.debug-html-box {
    width: 100%;
    height: 200px;
    background-color: #f7f7f7;
    border: 1px solid #ccc;
    font-family: monospace;
    font-size: 0.85rem;
    padding: 0.6rem;
    border-radius: 4px;
    resize: vertical;
    color: #333;
}

/* ============================================================
   PANELY (Accordion) – sekce 1–4
------------------------------------------------------------- */
.panels .panel {
    background-color: #ffffff;
    border: 1px solid #e1e1e6;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.panels .panel h3 {
    background-color: #f4f6f8;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #2c3e50;
    user-select: none;
}
.panels .panel.collapsed .panel-content {
    display: none;
}
.panels .panel-content {
    padding: 1rem;
    border-top: 1px solid #e1e1e6;
    font-size: 0.9rem;
    color: #444;
}
.panels .panel-content ul {
    margin-top: 0.5rem;
    padding-left: 1.2rem;
}
.panels .panel-content li {
    margin-bottom: 0.3rem;
    color: #2c3e50;
}

/* ------------------------------------------------------------
   Grafy (Chart.js)
------------------------------------------------------------- */
.chart-container {
    width: 100%;
    height: 260px;
    margin-top: 1.25rem;
}

/* ============================================================
   SNACKBAR
------------------------------------------------------------- */
.snackbar {
    visibility: hidden;
    min-width: 300px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    position: fixed;
    z-index: 1000;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
}
.snackbar.show {
    visibility: visible;
    animation: fadein 0.3s, fadeout 0.3s 2.7s;
}
@keyframes fadein {
    from { bottom: 0; opacity: 0; }
    to   { bottom: 2.5rem; opacity: 1; }
}
@keyframes fadeout {
    from { bottom: 2.5rem; opacity: 1; }
    to   { bottom: 0; opacity: 0; }
}

/* ============================================================
   RESPONSIVITA
------------------------------------------------------------- */
@media (max-width: 992px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .metrics-cards .metric-card {
        flex: 1 1 calc(50% - 1rem);
    }
}

@media (max-width: 600px) {
    .url-row {
        flex-direction: column;
        align-items: stretch;
    }
    .btn.btn-primary.btn-analyze {
        width: 100%;
        margin-top: 0.5rem;
    }
    .radio-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .metrics-cards .metric-card {
        flex: 1 1 100%;
    }
    .toc {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ============================================================
   ÚPRAVY PRO „Pokročilé možnosti“
------------------------------------------------------------- */
.advanced-options summary {
    font-weight: 600;
}
.advanced-options summary:after {
    content: none;
}
.advanced-options {
    max-height: 48px; /* výška summary + malá rezerva */
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.advanced-options[open] {
    max-height: 800px; /* nebo více, podle obsahu */
}

/* ============================================================
   KLÍČOVÉ METRIKY GRID
------------------------------------------------------------- */
.key-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 1rem;
    margin-bottom: 2rem;
}
.key-metric-card {
    background: #f7f9fa;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.key-metric-card h3 {
    margin: 0.5rem 0 0.2rem;
    font-size: 1.1rem;
    color: #2c3e50;
}
.key-metric-card p {
    margin: 0;
    font-size: 1rem;
    color: #34495e;
}

/* ============================================================
   CHECKS GRID (OK/CHYBA karty)
------------------------------------------------------------- */
.checks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.check-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: default;
}
.check-card.ok {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}
.check-card.bad {
    background: #ffebee;
    border: 1px solid #ffcdd2;
}
.check-label {
    flex: 1;
    margin-right: 0.5rem;
}
.check-icon {
    font-weight: bold;
    margin-left: 0.25rem;
}
.tooltip-icon {
    margin-left: 0.25rem;
    color: #888;
    cursor: help;
}

/* ------------------------------------------------------------
   S následujícími CSS selektory můžete ještě upravit odkazy,
   tabulky a další drobnosti, ale pro moderní vzhled jsou
   výše uvedené třídy dostačující.
------------------------------------------------------------- */

.ignore-robots {
    margin-bottom: 0 !important;
}

.advanced-content {
    margin-top: 1rem;
}
