/* Globální styly */
body {
    font-family: 'Source Sans Pro', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #99CC33;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

/* --- Styly pro vlastní zprávové okno --- */
.custom-message-box {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    min-width: 250px;
    text-align: center;
}
.custom-message-box.show { opacity: 1; visibility: visible; }
.custom-message-box.success { background-color: #4CAF50; }
.custom-message-box.error { background-color: #f44336; }
.custom-message-box.info { background-color: #2196F3; }

/* --- Styly pro přihlašovací stránku --- */
.login-page-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow: hidden;
}
.login-box {
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
    background-color: #fff;
}
.login-logo-container {
    padding: 30px 20px 20px;
    text-align: center;
    background-color: #fff;
    border-radius: 12px 12px 0 0;
}
.login-logo { height: 60px; width: auto; margin-bottom: 10px; }
.login-subtitle { font-size: 1.5em; color: #99CC33; font-weight: 600; margin: 0; }
.card { background-color: #fff; border: none; border-radius: 0 0 12px 12px; }
.login-card-body { padding: 30px; }
.input-group {
    display: flex;
    margin-bottom: 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    overflow: hidden;
    background-color: #f8f9fa;
}
.input-group .form-control { flex: 1; border: none; box-shadow: none; padding: 10px 15px; font-size: 1em; background-color: transparent; }
.input-group .form-control::placeholder { color: #6c757d; }
.input-group-append { display: flex; }
.input-group-text { background-color: #e9ecef; border: none; padding: 0 12px; display: flex; align-items: center; justify-content: center; color: #495057; }
.input-group-text .fas { font-size: 1.2em; }
.input-group-text .input-icon { width: 20px; height: 20px; color: #495057; }
.icheck-primary { display: flex; align-items: center; margin-bottom: 15px; }
.icheck-primary input[type="checkbox"] { width: 18px; height: 18px; margin-right: 8px; accent-color: #99CC33; }
.icheck-primary label { margin-bottom: 0; font-weight: 400; color: #555; }
.btn { display: block; width: 100%; padding: 10px 15px; border: none; border-radius: 5px; font-size: 1.1em; font-weight: 600; cursor: pointer; transition: background-color: 0.3s ease, transform: 0.2s ease, box-shadow: 0.3s ease; text-align: center; }
.btn-primary { background-color: #99CC33; color: white; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); }
.btn-primary:hover { background-color: #8BC34A; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); }
.btn-info { background-color: #6c757d; color: white; margin-top: 10px; }
.btn-info:hover { background-color: #5a6268; transform: translateY(-1px); }
p.message { margin-top: 15px; padding: 10px; border-radius: 5px; font-weight: bold; font-size: 0.9em; }

/* --- Styly pro aplikaci po přihlášení --- */
.logged-in-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
    align-items: stretch;
    background-color: #f0f2f5;
    padding: 0;
}
#app-container {
    max-width: 900px;
    width: 100%;
    margin: 20px auto 30px auto;
    background-color: #ffffff;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}
header {
    background-color: #99CC33;
    color: white;
    padding: 15px 25px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    flex-shrink: 0;
}
/* PŘIDÁNO: Nový styl pro obalení menu a nadpisu */
.header-main {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
}
/* UPRAVENO: Odstraněno centrování a roztahování nadpisu */
.header-title { 
    margin: 0; 
    font-size: 1.5em; 
    font-weight: 600; 
}
.header-controls { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.checkbox-group { display: flex; align-items: center; }
.checkbox-group input[type="checkbox"] { margin-right: 5px; accent-color: #8BC34A; }
.logged-in-body main {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#search-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    justify-content: flex-start;
}
.logged-in-body .form-group { margin-bottom: 10px; position: relative; }
.logged-in-body label, .label-link { margin-bottom: 6px; font-weight: 600; color: #555; font-size: 0.95em; }
.logged-in-body input[type="text"],
.logged-in-body input[type="password"],
.logged-in-body textarea { width: 100%; padding: 12px 15px; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 1em; box-sizing: border-box; transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.logged-in-body input[type="text"]:focus,
.logged-in-body input[type="password"]:focus,
.logged-in-body textarea:focus { border-color: #8BC34A; box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2); outline: none; }

#searchQuery {
    width: 350px;
    padding-right: 35px;
}

.logged-in-body button { background-color: #4CAF50; color: white; padding: 12px 25px; border: none; border-radius: 8px; cursor: pointer; font-size: 1em; font-weight: 600; margin-right: 10px; transition: background-color 0.3s ease, transform: 0.2s ease, box-shadow: 0.3s ease; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); }
.logged-in-body button:hover { background-color: #45a049; transform: translateY(-1px); }
.logged-in-body button:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }

.logged-in-body .autocomplete-list { list-style: none; padding: 0; margin: 0; border-left: 1px solid #e0e0e0; border-right: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; border-radius: 0 0 8px 8px; max-height: 250px; overflow-y: auto; background-color: #fff; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); z-index: 100; position: absolute; width: 100%; top: 100%; left: 0; }
.logged-in-body .autocomplete-list li { padding: 12px 15px; cursor: pointer; border-bottom: 1px solid #f0f0f0; transition: background-color 0.2s ease; }
.logged-in-body .autocomplete-list li:last-child { border-bottom: none; }
.logged-in-body .autocomplete-list li:hover { background-color: #f5f5f5; }
.logged-in-body .autocomplete-list li.error-message, .logged-in-body .autocomplete-list li.no-results, .logged-in-body .autocomplete-list li.info-message { padding: 12px 15px; border-bottom: none; cursor: default; font-weight: normal; }
.logged-in-body .autocomplete-list li.error-message { color: #c62828; background-color: #ffebee; }
.logged-in-body .autocomplete-list li.no-results { color: #1565c0; background-color: #e3f2fd; }
.logged-in-body .autocomplete-list li.info-message { color: #f9a825; background-color: #fff3cd; }

.logged-in-body .form-row { 
    display: flex; 
    gap: 20px; 
    margin-bottom: 18px; 
    flex-wrap: wrap; 
}
.logged-in-body .form-row > * {
    flex: 1 1 0;
    min-width: 250px;
}
.logged-in-body .form-row .form-group {
    display: flex;
    align-items: center;
}
.logged-in-body #dynamicContent .form-group:not(.form-row .form-group):not(.form-group-full) { 
    display: flex; 
    align-items: center; 
    margin-bottom: 18px; 
    flex: 1; 
    min-width: 280px; 
}
.logged-in-body .form-row .form-group label, 
.logged-in-body .form-row .form-group .label-wrapper { 
    flex-shrink: 0; 
    width: 100px; 
    margin-bottom: 0; 
    text-align: right; 
    padding-right: 10px; 
}
.logged-in-body .form-row .form-group .input-wrapper-constrained { 
    flex-grow: 1; 
    width: auto; 
}

.form-group-full {
    max-width: 100% !important;
    width: 100%;
}

.page-navigation {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px 0;
}
.nav-icon {
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
    opacity: 0.7;
    display: none;
}
.nav-icon:hover { transform: scale(1.1); opacity: 1; }
.nav-icon[src*="-a-"] { opacity: 1; border: 2px solid #99CC33; border-radius: 10px; padding: 2px; }
.content-page.hidden-page, .info-message.hidden-page, .connection-status-message.hidden-page, .hidden-page { display: none !important; }

#dynamicContent {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
}

.modal { display: none; position: fixed; z-index: 1050; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4); justify-content: center; align-items: center; }
.modal.show-modal { display: flex; }
.modal-content { background-color: #fefefe; margin: auto; padding: 30px; border: 1px solid #888; width: 90%; max-width: 500px; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); position: relative; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.modal-content h2 { margin-top: 0; color: #333; font-size: 1.8em; margin-bottom: 20px; text-align: center; }
.modal-content .form-group { margin-bottom: 15px; }
.modal-content label { font-weight: 600; color: #555; margin-bottom: 5px; }
.modal-content input[type="text"], .modal-content textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 1em; box-sizing: border-box; }
.modal-content textarea { resize: vertical; }
.char-counter { text-align: right; font-size: 0.85em; color: #777; margin-top: 5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-actions .btn { width: auto; padding: 10px 20px; font-size: 1em; margin-right: 0; }
.modal-actions .btn-secondary { background-color: #6c757d; color: white; }
.modal-actions .btn-secondary:hover { background-color: #5a6268; }
.close-button { color: #aaa; float: right; font-size: 28px; font-weight: bold; position: absolute; top: 10px; right: 15px; }
.close-button:hover, .close-button:focus { color: #000; text-decoration: none; cursor: pointer; }
#callModal .modal-actions {
    flex-direction: column;
    gap: 10px;
}
#callModal .modal-actions .btn {
    width: 100%;
}
.connection-status-message {
    font-weight: bold;
    text-align: center;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid;
    border-radius: 8px;
}

.form-group-full {
    display: flex;
    align-items: flex-start;
}
.form-group-full label {
    flex-shrink: 0;
    width: 100px;
    text-align: right;
    padding-right: 10px;
    padding-top: 12px;
    margin-bottom: 0;
}
.form-group-full textarea {
    flex-grow: 1;
    width: auto;
}

/* === STYLY PRO TABULKU HOVORŮ === */
.table-container {
    overflow-x: auto;
}
.call-list-table {
    border-collapse: collapse;
    margin-top: 10px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.call-list-table th, .call-list-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}
.call-list-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}
.call-list-table tbody tr:last-child td {
    border-bottom: none;
}
.call-list-table .call-missed {
    background-color: #fffbe6;
}
.call-list-table .call-missed td:last-child {
    color: #f44336;
    font-weight: bold;
}
.call-list-table .call-answered td:last-child {
    color: #4CAF50;
}

/* === STYLY PRO DIAGNOSTICKÝ ODKAZ === */
.diagnostics-link {
    font-size: 0.7em;
    font-weight: normal;
    text-decoration: none;
    color: #007bff;
    vertical-align: middle;
    margin-left: 10px;
}
.diagnostics-link:hover {
    text-decoration: underline;
}

/* Responzivní úpravy */
@media (max-width: 768px) {
    .logged-in-body #dynamicContent .form-row .form-group,
    .logged-in-body #dynamicContent .form-group:not(.form-row .form-group) { max-width: 100%; }
    .modal-content { width: 95%; padding: 20px; }
    #smsModal .modal-actions { flex-direction: column; gap: 10px; }
    #smsModal .modal-actions .btn { width: 100%; }
}
/* UPRAVENO: Pravidlo pro mobilní zobrazení hlavičky */
@media (max-width: 600px) {
    .login-page-body { padding: 0; }
    .login-box { border-radius: 0; box-shadow: none; }
    .logged-in-body header { 
        padding: 10px 15px; 
        /* Již se nemění na sloupec, ale nechá se zalamovat */
    }
    .logged-in-body .header-controls { 
        width: 100%; 
        justify-content: flex-start; 
        margin-top: 10px; 
    }
    .logged-in-body .form-row { flex-direction: column; gap: 0; }
    .logged-in-body .form-row > * { min-width: 100%; }
}

/* Styly pro GPON */
.gpon-view-active main { display: flex; flex-direction: column; flex-grow: 1; }
.gpon-view-active #search-section { display: flex; flex-direction: column; flex-grow: 1; align-items: stretch; }
.gpon-view-active #dynamicContent { flex-grow: 1; display: flex; flex-direction: column; width: 100%; }
.gpon-view-active h3 { display: none; }
.gpon-view-active #gponContent { flex-grow: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; }
.gpon-view-active #gponFrame { width: 100%; flex-grow: 1; border: none; }
.gpon-view-active .gpon-refresh-button-container { align-self: flex-end; margin-top: 15px; flex-shrink: 0; }

/* Ikony v input polích */
.input-wrapper { 
    position: relative; 
    display: flex; 
    align-items: center; 
    flex-grow: 1;
}
.input-wrapper input { 
    width: 100%;
    padding-right: 45px !important; 
}
#togglePassword { 
    position: absolute; right: 0; top: 0; height: 100%; width: 40px; 
    display: flex; align-items: center; justify-content: center; 
    cursor: pointer; user-select: none; 
}

/* === STYLY PRO SVG IKONY V SEZNAMU HOVORŮ === */
.call-list-table .status-cell .icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}
.call-list-table .status-cell .icon-ok {
    fill: #4CAF50;
}
.call-list-table .status-cell .icon-fail {
    fill: #f44336;
}
.call-list-call-icon {
    width: 18px;
    height: 18px;
    fill: #6c757d;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 8px;
    transition: fill 0.2s ease;
}
.call-list-call-icon:hover {
    fill: #333;
}

/* === SJEDNOCENÉ STYLY PRO FORMULÁŘ === */
.input-wrapper-constrained {
    display: flex;
    align-items: center;
    flex-grow: 1;
    max-width: 300px; 
}
.label-link {
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px dotted currentColor;
    transition: color 0.2s ease;
    display: inline-block;
}
.label-link:hover {
    color: #007bff;
}
.flex-item-half {
    flex-grow: 0;
    flex-basis: calc(50% - 10px);
}
.call-list-customer-name {
    font-size: 0.9em;
    color: #555;
    padding-top: 4px;
}

@media (min-width: 768px) {
    .call-list-table {
        width: 100%;
    }
}

/* === STYLY PRO KŘÍŽEK VE VYHLEDÁVÁNÍ === */
.search-wrapper {
    position: relative;
    width: 350px;
}
.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    color: #f44336;
    line-height: 1;
    display: none;
}

/* === STYLY PRO PANEL PŘESMĚROVÁNÍ === */
.forwarding-panel {
    border-top: 1px solid #e0e0e0;
    margin-top: 25px;
    padding-top: 15px;
}
.forwarding-panel h3, .forwarding-panel h4 {
    margin-top: 0;
    margin-bottom: 10px;
}
.forwarding-panel h4 {
    font-size: 1em;
    color: #555;
}
.forwarding-options {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}
.forwarding-options .technicians, .forwarding-options .types {
    display: flex;
    flex-direction: column;
}
.forwarding-options label {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal !important;
}
.forwarding-options input[type="radio"] {
    margin-right: 8px;
    accent-color: #99CC33;
}

#redirectTechnicianSelect {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    background-color: white;
    min-width: 200px;
    cursor: pointer;
}
#redirectTechnicianSelect:focus {
    border-color: #8BC34A;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
    outline: none;
}

/* === OPRAVA A SJEDNOCENÍ STYLŮ PRO ZOBRAZENÍ ÚKOLU === */
#taskContainer .task-info-row,
#taskContainer .form-group-full {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 20px;
}

#taskContainer .task-label,
#taskContainer .form-group-full label {
    font-weight: 600;
    color: #555;
    font-size: 1em;
    margin-bottom: 5px;
    width: auto;
    text-align: left;
    padding: 0;
}

#taskContainer .task-value,
#taskContainer .task-note {
    font-size: 1.1em;
    width: 100%;
    box-sizing: border-box;
}

#taskContainer textarea {
    width: 100%;
    box-sizing: border-box;
}

#taskContainer a.task-customer-link {
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}
#taskContainer a.task-customer-link:hover {
    text-decoration: underline;
}
#taskContainer .task-note {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}
#taskContainer .form-group {
    width: 100%;
}
#taskContainer .btn {
    width: auto;
}

/* === STYLY PRO TLAČÍTKO NOTIFIKACÍ === */
.push-controls-container {
    text-align: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}
.push-controls-container .btn-secondary {
    background-color: #6c757d;
    color: white;
    width: auto;
    padding: 8px 16px;
    font-size: 0.9em;
}
.push-controls-container .btn-secondary:hover {
    background-color: #5a6268;
}

/* === STYLY PRO ZÁLOŽKY ÚKOLŮ === */
.tabs-nav {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #ddd;
    margin-bottom: 15px;
}
.tabs-nav a {
    padding: 10px 15px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -2px;
    background-color: #f1f1f1;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
    font-size: 0.9em;
}
.tabs-nav a:hover {
    background-color: #ddd;
}
.tabs-nav a.active {
    background-color: #fff;
    border-color: #ddd;
    border-bottom: 2px solid #fff;
    font-weight: bold;
}
.task-content-pane {
    display: none;
}
.task-content-pane.active {
    display: block;
}

/* === FINÁLNÍ STYLY PRO IKONU ODHLÁŠENÍ (BEZ EFEKTŮ) === */
#logoutBtn {
    background: none;
    border: none;
    padding: 5px;
    margin: 0;
    margin-left: auto; /* Klíčové pro zarovnání vpravo */
    cursor: pointer;
    line-height: 0;
    box-shadow: none;
    transition: none;
    transform: none;
}
#logoutBtn:hover {
    background: transparent;
    transform: none;
}
.logout-text {
    display: none; /* Text je nyní skrytý vždy */
}

/* === STYLY PRO DROPDOWN MENU === */
.hamburger-container {
    position: relative; /* Nutné pro pozicování menu */
}

.hamburger-icon {
    width: 30px;
    height: 22px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px; /* Zvětšení klikací plochy */
    box-sizing: content-box;
}
.hamburger-icon span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
}

.header-dropdown-menu {
    display: block;
    position: absolute;
    top: calc(100% + 10px); /* Pod ikonou s 10px mezerou */
    left: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 2000;
    border-radius: 8px;
    padding: 5px 0;
    /* Animace */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.header-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.header-dropdown-menu .menu-item {
    padding: 12px 20px;
    text-decoration: none;
    font-size: 1em;
    color: #333;
    display: block;
    transition: 0.2s;
}
.header-dropdown-menu .menu-item:hover {
    background-color: #f1f1f1;
}

.menu-overlay {
    display: none; /* Standardně skryto */
    position: fixed;
    z-index: 1999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}
.menu-overlay.active {
    display: block; /* Zobrazí se, když je aktivní menu */
}

/* PŘIDÁNO: Zrušení vizuálního efektu "focus" na tlačítkách */
.logged-in-body button:focus {
    outline: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Zachová původní stín pro konzistenci */
}

/* PŘIDÁNO: Styly pro nové input pole s heslem, aby vypadalo jako původní div */
#devpassResult {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1.2em;
    word-break: break-all;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    text-align: left;
}
