/**
 * Školní adresář - styly
 */

/* Wrapper */
.skolni-adresar-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Vyhledávací box */
.adresar-search-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.adresar-search-box h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

.adresar-search-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 15px;
    align-items: end;
}

.search-field {
    display: flex;
    flex-direction: column;
}

.search-field label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.kontakt-input,
.oddeleni-filter {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.15s ease-in-out;
}

.kontakt-input:focus,
.oddeleni-filter:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-button,
.reset-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    height: fit-content;
}

.search-button {
    background-color: #007bff;
    color: white;
}

.search-button:hover {
    background-color: #0056b3;
}

.reset-button {
    background-color: #6c757d;
    color: white;
}

.reset-button:hover {
    background-color: #5a6268;
}

.search-loader {
    margin-top: 15px;
    text-align: center;
    color: #007bff;
    font-weight: 600;
}

/* Grid kontaktů */
.kontakty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

/* Kontaktní karta */
.kontakt-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kontakt-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.kontakt-photo {
    text-align: center;
    margin-bottom: 15px;
}

.kontakt-photo img {
    border-radius: 50%;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 3px solid #f8f9fa;
	margin:auto;
}

.kontakt-info {
    text-align: center;
}

.kontakt-name {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
}

.kontakt-pozice {
    margin: 0 0 10px 0;
    color: #007bff;
    font-size: 16px;
}

.kontakt-oddeleni {
    margin: 0 0 15px 0;
    padding: 5px 10px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    display: inline-block;
}

.kontakt-oddeleni .label {
    font-weight: 600;
}

.kontakt-details {
    text-align: left;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.kontakt-details p {
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.kontakt-details .dashicons {
    color: #007bff;
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.kontakt-details .label {
    font-weight: 600;
    color: #495057;
}

.kontakt-details a {
    color: #007bff;
    text-decoration: none;
}

.kontakt-details a:hover {
    text-decoration: underline;
}

.kontakt-konzultace {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.kontakt-konzultace .label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kontakt-konzultace .hodiny {
    margin: 5px 0 0 0;
    font-size: 14px;
    line-height: 1.6;
}

.kontakt-konzultace .konzultace-den {
    margin: 3px 0;
    padding: 3px 0;
}

.kontakt-popis {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 18px;
}

/* Responzivní design */
@media (max-width: 768px) {
    .adresar-search-form {
        grid-template-columns: 1fr;
    }

    .kontakty-grid {
        grid-template-columns: 1fr;
    }

    .kontakt-card {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .adresar-search-box {
        padding: 15px;
    }

    .skolni-adresar-wrapper {
        padding: 10px;
    }
}

/* Animace načítání */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kontakt-card {
    animation: fadeIn 0.3s ease-in-out;
}

/* ABC Navigace */
.abc-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    padding: 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.abc-letter {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.abc-letter:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.abc-letter.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.abc-letter:first-child {
    min-width: 50px;
}

/* Seznamové zobrazení */
.kontakty-seznam {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.adresar-table-wrapper {
    overflow-x: auto;
}

.adresar-table {
    width: 100%;
    border-collapse: collapse;
}

.adresar-table thead {
    background: #f8f9fa;
}

.adresar-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
}

.adresar-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.adresar-table tbody tr:hover {
    background-color: #f8f9fa;
}

.adresar-table tbody tr:last-child {
    border-bottom: none;
}

.adresar-table td {
    padding: 12px;
    font-size: 14px;
    color: #333;
}

.adresar-table .col-jmeno {
    width: 25%;
}

.adresar-table .col-pozice {
    width: 25%;
}

.adresar-table .col-oddeleni {
    width: 20%;
}

.adresar-table .col-telefon {
    width: 15%;
}

.adresar-table .col-email {
    width: 15%;
}

.adresar-table a {
    color: #007bff;
    text-decoration: none;
}

.adresar-table a:hover {
    text-decoration: underline;
}

/* Modal */
.kontakt-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeInModal 0.3s ease;
}

.modal-content {
    position: relative;
    max-width: 600px;
    max-height: 90vh;
    margin: 5vh auto;
    background: white;
    border-radius: 8px;
    overflow-y: auto;
    animation: slideInModal 0.3s ease;
    z-index: 10000;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10001;
    color: #495057;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e9ecef;
    color: #000;
}

#modal-body {
    padding: 20px;
}

#modal-body .kontakt-card {
    border: none;
    box-shadow: none;
    padding: 0;
}

#modal-body .kontakt-card:hover {
    transform: none;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Autocomplete suggestions */
.autocomplete-suggestions {
    position: absolute;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
}

.autocomplete-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background: #f8f9fa;
}

.autocomplete-suggestion strong {
    color: #007bff;
}

/* Responzivní úpravy pro nové prvky */
@media (max-width: 768px) {
    .abc-navigation {
        gap: 5px;
        padding: 10px;
    }

    .abc-letter {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 32px;
    }

    .abc-letter:first-child {
        min-width: 45px;
    }

    .adresar-table th,
    .adresar-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .adresar-table .col-pozice,
    .adresar-table .col-oddeleni {
        display: none;
    }

    .adresar-table .col-jmeno {
        width: 40%;
    }

    .adresar-table .col-telefon,
    .adresar-table .col-email {
        width: 30%;
    }

    .modal-content {
        max-width: 95%;
        margin: 2vh auto;
        max-height: 96vh;
    }
}

@media (max-width: 480px) {
    .abc-navigation {
        gap: 4px;
    }

    .abc-letter {
        padding: 5px 6px;
        font-size: 11px;
        min-width: 28px;
    }
}

/* Skrytí WordPress admin bar autocomplete na stránkách s adresářem */
.skolni-adresar-wrapper ~ * #wp-admin-bar-search,
.page .entry-content .skolni-adresar-wrapper ~ * #wp-admin-bar-search,
body.single-kontakt #wp-admin-bar-search,
body.post-type-archive-kontakt #wp-admin-bar-search {
    display: none !important;
}

/* Stránkování */
.adresar-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.page-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.page-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-info {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

/* Tlačítko pro kontaktní formulář */
.contact-form-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.contact-form-btn:hover {
    background: #0056b3;
}

/* Kontaktní formulář v modalu */
#contact-modal .modal-content {
    max-width: 600px;
}

#contact-modal h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.contact-recipient {
    margin: 0 0 20px 0;
    padding: 10px;
    background: #e9ecef;
    border-radius: 4px;
    font-weight: 600;
    color: #495057;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.form-field .regular-text,
.form-field .large-text {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
}

.form-field .large-text {
    resize: vertical;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-actions .button-primary {
    background: #007bff;
    color: white;
}

.form-actions .button-primary:hover {
    background: #0056b3;
}

.form-actions .button {
    background: #6c757d;
    color: white;
}

.form-actions .button:hover {
    background: #5a6268;
}

.form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-weight: 600;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responzivní úpravy */
@media (max-width: 768px) {
    .adresar-pagination {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .button {
        width: 100%;
    }
}
