/* Modern Flat Slate design written in pure CSS */
body {
    background-color: #0f172a;
    color: #f8fafc;
    font-family: sans-serif;
    padding: 20px;
}
.container {
    max-width: 800px;
    margin: 8px auto;
    padding: 0 10px;
}
.card {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}
.hidden {
    display: none !important;
}
.flex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
@media (max-width: 600px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}
input {
    background-color: #0f172a;
    border: 1px solid #334155;
    color: white;
    padding: 12px;
    border-radius: 8px;
    width: 100%;
    margin-top: 5px;
    margin-bottom: 15px;
    box-sizing: border-box;
}
input:focus {
    border-color: #0ea5e9;
    outline: none;
}
select {
    background-color: #0f172a;
    border: 1px solid #334155;
    color: white;
    padding: 12px;
    border-radius: 8px;
    width: 100%;
    margin-top: 5px;
    margin-bottom: 15px;
    box-sizing: border-box;
}
select:focus {
    border-color: #0ea5e9;
    outline: none;
}
div.disabled {
    pointer-events: none;
    opacity: 0.2;
}
button.nav-btn {
    flex: 1;
    padding: 12px;
    background: #0ea5e9;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}
button.nav-btn:hover {
    background: #0284c7;
}

button.btn-cmd {
    padding: 10px 14px;
    background: #475569;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
}
button.btn-cmd:hover {
    background: #0284c7;
}
button.btn-color:hover {
    background: #0284c7;
}
button.lang-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
}
button.lang-btn.font-bold {
    color: #38bdf8;
    font-weight: bold;
}
label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: bold;
    text-transform: uppercase;
}
.btn-primary {
    background: #0ea5e9;
    color: white;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
.btn-primary:hover {
    background: #0284c7;
}
.btn-secondary {
    background: #334155;
    color: white;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
.btn-secondary:hover {
    background: #475569;
}
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}
/* Sidebar sub-tab architecture */
.config-layout {
    display: flex;
    gap: 20px;
    margin-top: 12px;
}
.config-sidebar {
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    shrink: 0;
}
.config-panels {
    flex-grow: 1;
    min-width: 0;
}
.sub-btn {
    background: #334155;
    border: none;
    color: #f8fafc;
    padding: 10px 14px;
    text-align: left;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
}
.sub-btn:hover {
    background: #0284c7;
}
.sub-btn.active {
    background: #0ea5e9;
}
.sub-btn.active:hover {
    background: #0284c7;
}

/* Dynamic List & Dynamic Rows Layouts */
.row-entry {
    background: #0f172a;
    padding: 16px;
    border: 1px solid #334155;
    border-radius: 8px;
    margin-bottom: 12px;
    position: relative;
}
.remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 11px;
    float: right;
}
.add-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
    margin-top: 5px;
}
.add-btn:hover {
    background: #059669;
}

/* Grid systems for fields */
.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}
@media (max-width: 650px) {
    .config-layout {
        flex-direction: column;
    }
    .config-sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .form-grid-3,
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}
button,
.sub-btn,
.nav-btn {
    cursor: pointer !important;
}
.weekday-checkbox {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-right: 6px;
    font-size: 11px;
    color: #94a3b8;
}
.weekday-checkbox input {
    width: auto !important;
    margin: 4px 0 0 0 !important;
}

/* Modal window background (overlay) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8); /* Tmavé průhledné pozadí */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* The modal window box itself */
.modal-box {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 28px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-box {
    transform: scale(1);
}

/* Appearance of the success icon */
.modal-icon-success {
    width: 48px;
    height: 48px;
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 16px auto;
    font-size: 24px;
    font-weight: bold;
}
/* Appearance of the warning icon */
.modal-icon-warning {
    width: 48px;
    height: 48px;
    background-color: rgba(16, 185, 129, 0.1);
    color: #b9b910;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 16px auto;
    font-size: 24px;
    font-weight: bold;
}
/* Appearance of the error icon */
.modal-icon-error {
    width: 48px;
    height: 48px;
    background-color: rgba(16, 185, 129, 0.1);
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 16px auto;
    font-size: 24px;
    font-weight: bold;
}
button.nav-btn {
    flex: 1;
    padding: 12px;
    background: #334155;
    color: #94a3b8;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition:
        background 0.2s,
        color 0.2s;
}
/* Color for the active tab (blue) */
button.nav-btn.active {
    background: #0284c7 !important;
    color: white !important;
}
/* Help container */
.tooltip-container {
    position: relative;
    display: inline-block;
    margin-left: 6px;
    cursor: help;
}
.tooltip-trigger {
    background: #475569;
    color: #f8fafc;
    font-size: 11px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}
/* The pop-up tooltip itself */
.tooltip-content {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    background-color: #1e293b;
    border: 1px solid #0ea5e9;
    color: #f8fafc;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: normal;
    text-transform: none;
    text-align: left;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 500;
}
/* Arrow below the tooltip */
.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #0ea5e9 transparent transparent transparent;
}
/* Links within the help */
.tooltip-content a {
    color: #38bdf8;
    text-decoration: underline;
    font-weight: bold;
}
.tooltip-content a:hover {
    color: #0ea5e9;
}

/* Mouseover display */
.tooltip-container:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.serial-monitor {
    height: 280px;
    overflow-y: auto; /* Zobrazí svislý posuvník, když přeteče výška */
    white-space: pre-wrap; /* Zalamuje dlouhé řádky, aby nevznikl vodorovný posuvník */
    color: #d4d4d4;
    padding: 10px;
    text-align: left;
    background: #0f172a;
    border: 1px dashed #334155;
    border-radius: 8px;
    margin-bottom: 12px;
}

/* Azurový nadpis sekce jako "Global System Settings" */
.led-section-heading {
    color: #38bdf8; /* azurová ze screenshotu */
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 14px 0;
}

/* Mřížka 2 sloupce jako u NTP */
.led-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Popisek nad polem (kapitálky jako HOSTNAME / NTP SERVER) */
.led-field-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 8px;
}

/* Input / Select ve stylu vašich tmavých polí */
.led-dark-control {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid #2d3748;
    background-color: #161e2e;
    color: #e2e8f0;
    font-size: 14px;
    box-sizing: border-box;
}

/* Tlačítko ve stylu "Read from File" */
.led-action-btn {
    width: 100%;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
    border: 1px solid #3b475e;
    background-color: #263145;
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition:
        background-color 0.15s,
        border-color 0.15s;
}
.led-action-btn:hover {
    background-color: #0284c7; /* vaše aktivní azurová */
    border-color: #38bdf8;
    color: #ffffff;
}

/* Primární tlačítko v modálním okně */
.led-btn-save {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    background-color: #0284c7;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.led-btn-save:hover {
    background-color: #0ea5e9;
}
