/* ========================================
   SEARCH MODAL - BEM METODIKA
   MOBILE FIRST
   ======================================== */

/* ========================================
   MODAL KONTEJNER - MOBIL
   Na mobilu zabírá celou obrazovku
   ======================================== */

.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
}

.search-modal--open {
    visibility: visible;
    opacity: 1;
}

/* ========================================
   OVERLAY - Tmavé pozadí
   ======================================== */

.search-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ========================================
   KONTEJNER OBSAHU - MOBIL
   Na mobilu fullscreen
   ======================================== */

.search-modal__container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 transparent;
}

/* Moderní scrollbar pro Webkit prohlížeče (Chrome, Safari, Edge) */
.search-modal__container::-webkit-scrollbar {
    width: 8px;
}

.search-modal__container::-webkit-scrollbar-track {
    background: transparent;
    margin: 8px 0;
}

.search-modal__container::-webkit-scrollbar-thumb {
    background-color: #d0d0d0;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.search-modal__container::-webkit-scrollbar-thumb:hover {
    background-color: #b0b0b0;
}

.search-modal--open .search-modal__container {
    transform: translateY(0);
}

/* ========================================
   HLAVIČKA MODALU - MOBIL
   ======================================== */

.search-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background-color: #ffffff;
    z-index: 10;
}

.search-modal__title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.search-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-modal__close:hover,
.search-modal__close:active {
    background-color: #e0e0e0;
}

.search-modal__close svg {
    width: 20px;
    height: 20px;
    color: #2c3e50;
}

/* ========================================
   FORMULÁŘ - MOBIL
   ======================================== */

.search-modal__form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ========================================
   SEKCE FORMULÁŘE - MOBIL
   ======================================== */

.search-modal__section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-modal__label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
}

.search-modal__label-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: #f0f3ff;
    border-radius: 8px;
    flex-shrink: 0;
}

.search-modal__label-icon svg {
    width: 16px;
    height: 16px;
    color: #667eea;
}

.search-modal__label-optional {
    font-weight: 400;
    color: #95a5a6;
    font-size: 13px;
}

/* ========================================
   ZÁLOŽKY (TABS) - Způsob výběru
   ======================================== */

.search-modal__tabs {
    display: flex;
    gap: 6px;
    background-color: #f0f0f0;
    padding: 4px;
    border-radius: 12px;
}

.search-modal__tab {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #7f8c8d;
    background-color: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.search-modal__tab:hover:not(.search-modal__tab--active):not(.search-modal__tab--locked) {
    color: #2c3e50;
    background-color: rgba(255, 255, 255, 0.5);
}

.search-modal__tab--active {
    color: #667eea;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-modal__tab--locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.search-modal__tabs--locked .search-modal__tab:not(.search-modal__tab--active) {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Obsah záložek */
.search-modal__tab-content {
    margin-top: 12px;
}

.search-modal__tab-panel {
    display: none;
}

.search-modal__tab-panel--active {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

/* Nápověda pod obsahem */
.search-modal__hint {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #95a5a6;
}

/* ========================================
   POHLAVÍ
   ======================================== */

.search-modal__gender {
    display: flex;
    gap: 8px;
}

.search-modal__gender-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #2c3e50;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-modal__gender-btn svg {
    width: 18px;
    height: 18px;
}

.search-modal__gender-btn:hover {
    background-color: #f0f3ff;
    border-color: #d5dcff;
}

.search-modal__gender-btn--active {
    background-color: #f0f3ff;
    border-color: #667eea;
    color: #667eea;
}

/* Specifické barvy pro pes/fena když aktivní - stejné jako na homepage */
.search-modal__gender-btn--male.search-modal__gender-btn--active {
    background-color: #e3f2fd;
    border-color: #64b5f6;
    color: #64b5f6;
}

.search-modal__gender-btn--female.search-modal__gender-btn--active {
    background-color: #fce4ec;
    border-color: #f48fb1;
    color: #f48fb1;
}

/* ========================================
   CHIPS (ČIPY) - Velikost a Kategorie
   ======================================== */

.search-modal__chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.search-modal__chips::-webkit-scrollbar {
    display: none;
}

.search-modal__chips--wrap {
    flex-wrap: wrap;
}

.search-modal__chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #2c3e50;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-modal__chip:hover {
    background-color: #f0f3ff;
    border-color: #d5dcff;
}

.search-modal__chip--active {
    background-color: #f0f3ff;
    border-color: #667eea;
    color: #667eea;
}

.search-modal__chip-info {
    font-size: 11px;
    font-weight: 400;
    color: #95a5a6;
}

.search-modal__chip--active .search-modal__chip-info {
    color: #667eea;
}

/* Grid layout pro velikosti */
.search-modal__chips--grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.search-modal__chip--large {
    padding: 16px;
    text-align: center;
}

.search-modal__chip-title {
    font-size: 15px;
    font-weight: 600;
}

/* ========================================
   TAGS (ŠTÍTKY) - Vybraná plemena
   ======================================== */

.search-modal__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
    margin-bottom: 10px;
}

.search-modal__tags:empty {
    display: none;
    margin-bottom: 0;
}

.search-modal__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #667eea;
    background-color: #f0f3ff;
    border: 1px solid #d5dcff;
    border-radius: 20px;
    animation: tagAppear 0.2s ease;
}

@keyframes tagAppear {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.search-modal__tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: #667eea;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.search-modal__tag-remove:hover {
    background-color: #5568d3;
    transform: scale(1.1);
}

.search-modal__tag-remove svg {
    width: 10px;
    height: 10px;
    color: #ffffff;
}

/* ========================================
   INPUT POLE - MOBIL
   ======================================== */

.search-modal__input-wrapper {
    position: relative;
}

.search-modal__input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    color: #2c3e50;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
}

.search-modal__input::placeholder {
    color: #95a5a6;
}

.search-modal__input:focus {
    border-color: #667eea;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* ========================================
   NAŠEPTÁVAČ (SUGGESTIONS) - MOBIL
   ======================================== */

.search-modal__suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
    z-index: 100;
    display: none;
}

.search-modal__suggestions--visible {
    display: block;
}

.search-modal__suggestion {
    padding: 12px 16px;
    font-size: 15px;
    color: #2c3e50;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.search-modal__suggestion:hover,
.search-modal__suggestion--active {
    background-color: #f0f3ff;
}

.search-modal__suggestion:first-child {
    border-radius: 12px 12px 0 0;
}

.search-modal__suggestion:last-child {
    border-radius: 0 0 12px 12px;
}

.search-modal__suggestion:only-child {
    border-radius: 12px;
}

/* ========================================
   FILTRY (CHECKBOXY) - MOBIL
   ======================================== */

.search-modal__section--filters {
    padding-top: 8px;
    border-top: 1px solid #e8e8e8;
}

.search-modal__filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Vlastní checkbox */
.search-modal__checkbox {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background-color: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-modal__checkbox:hover {
    background-color: #f0f3ff;
    border-color: #d5dcff;
}

/* Skrytý nativní checkbox */
.search-modal__checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Vlastní značka checkboxu */
.search-modal__checkbox-mark {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background-color: #ffffff;
    border: 2px solid #d0d0d0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* Fajfka v checkboxu */
.search-modal__checkbox-mark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s ease;
    margin-top: -2px;
}

/* Aktivní stav checkboxu */
.search-modal__checkbox input[type="checkbox"]:checked + .search-modal__checkbox-mark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.search-modal__checkbox input[type="checkbox"]:checked + .search-modal__checkbox-mark::after {
    transform: rotate(45deg) scale(1);
}

/* Aktivní stav celého řádku */
.search-modal__checkbox:has(input[type="checkbox"]:checked) {
    background-color: #f0f3ff;
    border-color: #667eea;
}

/* Text checkboxu */
.search-modal__checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-modal__checkbox-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
}

.search-modal__checkbox-desc {
    font-size: 13px;
    color: #7f8c8d;
    line-height: 1.4;
}

/* ========================================
   AKČNÍ TLAČÍTKA - MOBIL
   ======================================== */

.search-modal__actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, #ffffff 85%, transparent);
    padding-bottom: 20px;
}

.search-modal__clear {
    flex: 1;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #2c3e50;
    background-color: #f5f5f5;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-modal__clear:hover,
.search-modal__clear:active {
    background-color: #e0e0e0;
}

.search-modal__submit {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.search-modal__submit:hover,
.search-modal__submit:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.search-modal__submit svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   RESPONZIVITA - TABLET (768px+)
   ======================================== */

@media (min-width: 768px) {
    .search-modal {
        align-items: center;
        padding: 40px 20px;
    }

    .search-modal__container {
        width: 100%;
        max-width: 560px;
        height: auto;
        max-height: 90vh;
        border-radius: 24px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }

    .search-modal__header {
        padding: 20px 28px;
        border-radius: 24px 24px 0 0;
    }

    .search-modal__title {
        font-size: 22px;
    }

    .search-modal__close {
        width: 44px;
        height: 44px;
    }

    .search-modal__close svg {
        width: 22px;
        height: 22px;
    }

    .search-modal__form {
        padding: 28px;
        gap: 28px;
    }

    .search-modal__label {
        font-size: 16px;
    }

    .search-modal__label-icon {
        width: 32px;
        height: 32px;
    }

    .search-modal__label-icon svg {
        width: 18px;
        height: 18px;
    }

    .search-modal__input {
        padding: 16px 18px;
        font-size: 16px;
    }

    .search-modal__chips {
        overflow-x: visible;
        flex-wrap: wrap;
    }

    .search-modal__chip {
        padding: 14px 20px;
        font-size: 15px;
    }

    .search-modal__tag {
        padding: 10px 14px;
        font-size: 15px;
    }

    .search-modal__tabs {
        gap: 8px;
        padding: 5px;
    }

    .search-modal__tab {
        padding: 12px 16px;
        font-size: 15px;
    }

    .search-modal__gender-btn {
        padding: 16px;
        font-size: 15px;
    }

    .search-modal__gender-btn svg {
        width: 20px;
        height: 20px;
    }

    .search-modal__chips--grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .search-modal__filters {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .search-modal__checkbox {
        padding: 16px;
    }

    .search-modal__actions {
        padding-top: 20px;
        position: relative;
        background: none;
        padding-bottom: 0;
    }

    .search-modal__clear {
        flex: none;
        padding: 16px 28px;
    }

    .search-modal__submit {
        flex: 1;
        padding: 16px 32px;
        font-size: 17px;
    }
}

/* ========================================
   RESPONZIVITA - DESKTOP (1024px+)
   ======================================== */

@media (min-width: 1024px) {
    .search-modal__container {
        max-width: 640px;
    }

    .search-modal__header {
        padding: 24px 32px;
    }

    .search-modal__title {
        font-size: 24px;
    }

    .search-modal__form {
        padding: 32px;
    }

    .search-modal__suggestions {
        max-height: 240px;
    }
}

/* ========================================
   ANIMACE OTEVŘENÍ/ZAVŘENÍ
   ======================================== */

@keyframes modalSlideIn {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes modalSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(30px);
        opacity: 0;
    }
}

/* Body scroll lock při otevřeném modalu */
body.search-modal-open {
    overflow: hidden;
}
