/* ============================================
   UNIVERZÁLNÍ KOMPONENTY - CSS
   Zkopírováno z modul/aktivity/styles.php
   ============================================ */

/* ===== GLOBÁLNÍ CSS PROMĚNNÉ ===== */
:root {
    --color-white:  #FFFFFF;
    --color-black:  #000000;
    --color-text:   #2C2A3F;
    --color-akcent: #EC6839;
}

/* ===== FILTRY ===== */
.filter-panel {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-text);
}
.filter-header {
    background: var(--color-text);
    color: #FFFFFF;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
}
.filter-header:hover {
    background: #3a3749;
}
.filter-label {
    font-size: 18px;
}
.filter-label-small {
    font-weight: bold;
    color: #FFFFFF;
    margin-bottom: 8px;
    display: block;
}
.filter-input-text {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #FF6B35;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: var(--color-text);
    transition: all 0.3s;
}
.filter-input-text:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}
.filter-input-text::placeholder {
    color: #999;
}
.filter-active {
    flex: 1;
    margin: 0 15px;
    font-size: 14px;
    font-weight: normal;
}
.filter-arrow {
    transition: transform 0.3s ease;
}
.filter-header[aria-expanded="true"] .filter-arrow {
    transform: rotate(180deg);
}
.filter-content {
    background: var(--color-text);
    padding: 20px;
    color: white;
}
.filter-section {
    margin-bottom: 25px;
}
.filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.filter-checkbox-label {
    padding: 8px 16px;
    background: white;
    color: #000;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 0.9em;
    transition: all 0.3s;
    display: inline-block;
    cursor: pointer;
    user-select: none;
}
.filter-checkbox-label:hover {
    border-color: #FF6B35;
}
.filter-checkbox-label input[type="checkbox"] {
    display: none;
}
.filter-checkbox-label.checked {
    background: #FF6B35;
    border-color: #FF6B35;
    color: white;
    font-weight: bold;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Časová osa pro věk */
.vek-slider-container {
    position: relative;
    height: 60px;
    margin: 30px 0 10px 0;
}
.vek-slider-track {
    position: absolute;
    top: 28px;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}
.vek-slider-range {
    position: absolute;
    top: 28px;
    height: 4px;
    background: #FF6B35;
    border-radius: 2px;
    z-index: 1;
}
.vek-slider {
    position: absolute;
    width: 100%;
    height: 60px;
    top: 0;
    left: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 3;
}
.vek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    pointer-events: all;
    border: none;
    box-shadow: none;
}
.vek-slider::-moz-range-thumb {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    pointer-events: all;
    border: none;
    box-shadow: none;
}
.vek-value {
    position: absolute;
    top: -10px;
    transform: translateX(-50%);
    background: white;
    color: var(--color-text);
    border: 3px solid #FF6B35;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    pointer-events: all;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.vek-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    opacity: 0.7;
    margin-top: 10px;
}

/* ===== STRÁNKOVÁNÍ (úpravy Bootstrap) ===== */
.pagination {
    --bs-pagination-padding-x: 0.75rem;
    --bs-pagination-padding-y: 0.375rem;
    --bs-pagination-font-size: 1rem;
    --bs-pagination-color: var(--color-text);
    --bs-pagination-bg: #fff;
    --bs-pagination-border-width: 1px;
    --bs-pagination-border-color: #dee2e6;
    --bs-pagination-border-radius: 0.375rem;
    --bs-pagination-hover-color: var(--color-text);
    --bs-pagination-hover-bg: #f8f9fa;
    --bs-pagination-hover-border-color: #dee2e6;
    --bs-pagination-focus-color: var(--color-text);
    --bs-pagination-focus-bg: #e9ecef;
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: var(--color-akcent);
    --bs-pagination-active-border-color: var(--color-akcent);
    --bs-pagination-disabled-color: #6c757d;
    --bs-pagination-disabled-bg: #fff;
    --bs-pagination-disabled-border-color: #dee2e6;
}

/* --- TLAČÍTKA (úpravy Bootstrap) --- */
.btn {
    font-family: 'Barlow', sans-serif;
    font-weight: 600;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--color-akcent);
    --bs-btn-border-color: var(--color-akcent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #d55a30;
    --bs-btn-hover-border-color: #d55a30;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #c45028;
    --bs-btn-active-border-color: #c45028;
}

.btn-secondary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #6c757d;
    --bs-btn-border-color: #6c757d;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #5c636a;
    --bs-btn-hover-border-color: #565e64;
}

/* --- KARTY (úpravy Bootstrap) --- */
.card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-header {
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

/* --- ALERTS (úpravy Bootstrap) --- */
.alert {
    border-radius: 0.5rem;
    border: 1px solid transparent;
}

.alert-info {
    --bs-alert-color: #055160;
    --bs-alert-bg: #cff4fc;
    --bs-alert-border-color: #b6effb;
}

.alert-warning {
    --bs-alert-color: #664d03;
    --bs-alert-bg: #fff3cd;
    --bs-alert-border-color: #ffecb5;
}

/* --- BADGES --- */
.badge {
    font-family: 'Barlow', sans-serif;
    font-weight: 600;
    border-radius: 0.375rem;
}

/* ============================================================
   Sdílený layout: Box s obrázkem (aktivity, pronájmy, …)
   ============================================================ */
.aktivita-body { display: flex; align-items: stretch; gap: 10px; padding: 8px 0 10px; }
.aktivita-img-square { width: 130px; height: 130px; flex-shrink: 0; border-radius: 10px; overflow: hidden; }
.aktivita-img-square img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.aktivita-img-spacer { width: 130px; height: 1px; visibility: hidden; }
.aktivita-body-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.aktivita-col { background: #fff; border-radius: 8px; padding: 10px; overflow-y: auto; overflow-x: hidden; line-height: 1.4em; }
.aktivita-info { height: auto; overflow: hidden; line-height: 1.5em; display: flow-root; }
.aktivita-info.limited { max-height: 5em; }
.aktivita-info span { display: inline; }
.aktivita-info br { display: block; line-height: 0; margin: 0; padding: 0; }
.row.g-2 { align-items: stretch; }
.row.g-2 > [class*="col-"]:not(.col-swiper):not(:has(.swiper)):not(:has(.row)) { display: flex; }
.row.g-2 .aktivita-col { flex: 1; }
.aktivita-col span.label { font-weight: bold; }
.aktivita-col .label, .aktivita-col .kontakt-jmeno { display: inline; }
.aktivita-info-lektor { height: auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; line-height: 1.5em; }
.aktivita-box, .pronajem-box, .btn { font-size: 18px; }
@media (max-width: 767px) {
    .aktivita-col .label, .aktivita-col .kontakt-jmeno { display: block; }
    .aktivita-info-lektor { -webkit-line-clamp: 2; }
}


/* ============================================================
   Styly aktivit (přesunuto z modul/aktivity/styles.php)
   ============================================================ */
.aktivity-seznam { margin: 20px 0; }
.aktivita-box {
    width: 100%;
    margin-bottom: 32px;
    background: #f5f5f5;
    border-radius: 16px;
    opacity: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}


/* Název aktivity */
.aktivita-nazev {
    color: #222;
    font-size: 1.6rem;
    margin-top: 12px;
    margin-bottom: 0;
    font-weight: bold;
}
.aktivita-pobocka {
    font-size: 1.1rem;
    margin-top: 12px;
    margin-bottom: 0;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    text-align: right;
    width: 100%;
}


/* Tělo boxu: čtvercový obrázek vlevo + obsah vpravo */
.aktivita-body {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 8px 0 10px;
}

/* Čtvercový obrázek — pevná šířka 130px */
.aktivita-img-square {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
}

/* Spacer pod obrázkem — stejná šířka */
.aktivita-img-spacer {
    width: 130px;
    height: 1px;
    visibility: hidden;
}

.aktivita-img-square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

/* Pravý obsah: info řádek + lektor řádek */
.aktivita-body-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aktivita-col {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 10px;
    opacity: 1;
    overflow-y: auto;
    overflow-x: hidden;
    line-height: 1.4em;
}

.aktivita-info {
    height: auto;
    overflow: hidden;
    line-height: 1.5em;
    display: flow-root;
}
.aktivita-info.limited {
    max-height: 5em;
}
.aktivita-info span {
    display: inline;
}
.aktivita-info br {
    display: block;
    line-height: 0;
    margin: 0;
    padding: 0;
}
.aktivita-info-lektor {
    height: auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5em;
}

/* Všechny aktivita-col v jednom řádku mají stejnou výšku */
.row.g-2 {
    align-items: stretch;
}
.row.g-2 > [class*="col-"]:not(.col-swiper):not(:has(.swiper)):not(:has(.row)) {
    display: flex;
}
.row.g-2 .aktivita-col {
    flex: 1;
}
.aktivita-col span.label {
    font-weight: bold;
}
.aktivita-col .label,
.aktivita-col .kontakt-jmeno {
    display: inline;
}

/* Text sloupec v detailu: polovina šířky + polovina šířky obrázku + gap */
@media (min-width: 768px) {
    .col-detail-text {
        flex: 0 0 auto;
        width: calc(50% + 70px);
    }
}

/* Starý styl (zachován pro zpětnou kompatibilitu) */
.aktivita-img {
    flex: 1 1 0;
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    overflow: hidden;
}
.aktivita-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
.aktivita-col-scroll-inner {
    overflow-y: auto;
    overflow-x: hidden;
    line-height: 1.4em;
    flex: 1 1 auto;
    min-height: 0;
}
/* Animace pro detail sekci */
.detail-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.detail-section.open {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

/* Swiper v detailu musí mít plnou šířku */
.detail-section .swiper {
    width: 100%;
}
/* Oprava: pokud .col- dostane display:flex z .row.g-2, swiper nesmí zdědit flex layout */
.row.g-2 > [class*="col-"] > .swiper,
.row.g-2 > [class*="col-"] .swiper {
    width: 100%;
    display: block;
}
.row.g-2 > [class*="col-"] .swiper-wrapper {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
}

/* Sloupce s obrázky v detailu mají aspect-ratio */
.image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
}
.image-wrapper--detail {
    aspect-ratio: 4 / 3;
}

img.detail-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}


.lektor-col {
    flex: 3;
    min-width: calc(3 * (100% / 6) + 2px); /* korekce šířky Lektor */
}
.podrobnosti-col,
.prihlasit-col,
.spendlik-col {
  flex: 1;
}
@media (max-width: 767px) {
    .aktivita-col .label,
    .aktivita-col .kontakt-jmeno {
        display: block;
    }
    .lektor-col,
    .podrobnosti-col,
    .prihlasit-col,
    .spendlik-col {
        flex: unset;    /* vypnutí flexu */
        min-width: unset; 

    }
      /* Horní a spodní řádek se „rozpustí“ do jednoho kontejneru */
    .aktivita-box .row.g-2,
    .aktivita-box .row.g-2.mt-1.align-items-stretch {
        display: contents;
    }  
    
 .text-end {
        text-align: start !important;
    }
}

.aktivita-box, .btn { font-size: 18px; }

/* Collapse states */
.aktivita .collapse.show ~ .row .show-only-closed {
    display: none !important;
}
.aktivita .collapse.show ~ .row .show-only-open {
    display: block !important;
}
.aktivita .collapse:not(.show) ~ .row .show-only-open {
    display: none !important;
}

/* Připnuté aktivity */
.pinned-panel {
    background: var(--color-akcent);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.pinned-header {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    background: var(--color-akcent);
}
.pinned-header:hover {
    background: #E55B25;
}
.pinned-label {
    font-weight: bold;
    font-size: 1.1em;
}
.pinned-count {
    background: rgba(255,255,255,0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.9em;
}
.pinned-names {
    flex: 1;
    font-size: 0.9em;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pinned-arrow {
    transition: transform 0.3s;
}
.pinned-header[aria-expanded="true"] .pinned-arrow {
    transform: rotate(180deg);
}
.pinned-content {
    padding: 15px 20px;
    background: white;
}
.pinned-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #4a90e2;
}
.pinned-item:last-child {
    margin-bottom: 0;
}
.pinned-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.pinned-item-details {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 0.9em;
    color: #666;
}
.btn-unpin {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
    text-decoration: none;
}
.btn-unpin:hover {
    opacity: 0.7;
}
.btn-pin {
    background: white;
    border: 2px solid #ddd;
    color: #666;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 1.3em;
}
.btn-pin:hover {
    border-color: #4a90e2;
    background: #f0f7ff;
    text-decoration: none;
}
.btn-pin.active {
    background: #4a90e2;
    border-color: #4a90e2;
    color: white;
}
.spendlik-col {
    display: flex;
    align-items: stretch;
}

/* Fotogalerie modal */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    align-items: center;
    justify-content: center;
}

.gallery-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
}

.gallery-close:hover {
    color: #FF6B35;
}

#galleryImage {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.8);
    color: #2C2A3F;
    border: none;
    padding: 16px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 4px;
    transition: all 0.3s;
}

.gallery-prev:hover,
.gallery-next:hover {
    background-color: #FF6B35;
    color: white;
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    overflow-x: auto;
    max-width: 100%;
    padding: 10px;
}

.gallery-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
    opacity: 0.6;
    transition: all 0.3s;
    border: 3px solid transparent;
}

.gallery-thumbnail:hover {
    opacity: 1;
    transform: scale(1.1);
}

.gallery-thumbnail.active {
    opacity: 1;
    border-color: #FF6B35;
}

.btn-gallery {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-gallery:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-gallery-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 107, 53, 0.9);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
}

.btn-gallery-overlay:hover {
    background: rgba(255, 107, 53, 1);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
