/* =========================================================
   Eben - Kontakty (Modern UI)
   ========================================================= */

.eben-kontakty-wrapper {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}

/* ---------- Toolbar / filtre (Modern) ---------- */
.eben-kontakty-toolbar {
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #eaeaea;
}

.eben-kontakty-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.eben-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 200px; /* flexibilná šírka */
}

.eben-field--search {
    flex: 2 1 280px; /* vyhľadávanie širšie */
}

.eben-field--actions {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding-bottom: 2px; /* zarovnanie s inputmi */
}

.eben-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

.eben-inputwrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Modern Input & Select */
.input-modern, .select-modern {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    color: #333;
    appearance: none; /* pre select */
}

/* Pridáme šípku pre select manuálne pre konzistentný vzhľad */
.select-modern {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 35px;
}

.input-modern:hover, .select-modern:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.input-modern:focus, .select-modern:focus {
    border-color: #d1c6b6; /* brand color */
    outline: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.input-modern::placeholder {
    color: #bbb;
}

.eben-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

/* Buttons */
.reset-button {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 16px;
    color: #666;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    height: 42px; /* match input height */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reset-button:hover {
    background: #f0f0f0;
    color: #333;
    transform: translateY(-1px);
}

.eben-edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    height: 42px; /* match input height */
    border-radius: 10px;
    background: linear-gradient(135deg, #3aa7b8 0%, #2a8a9a 100%);
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(58, 167, 184, 0.3);
    transition: all 0.2s;
}

.eben-edit-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(58, 167, 184, 0.4);
    color: #fff !important;
}

/* ---------- GRID / KARTY (nahradzuje table) ---------- */
.airtable-table-wrapper {
    overflow-x: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Kontajner pre karty */
.eben-kontakty-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Kľúčové pre centrovanie */
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
    align-items: flex-start; /* Aby sa karty neroztahovali na výšku najvyššej v riadku */
}

/* Jednotlivá karta */
.eben-card {
    background-color: #f8f9fa; /* ZMENA: ako filter */
    border: 1px solid #eaeaea; /* ZMENA: ako filter */
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    width: 240px;
    height: auto; /* ZMENA: prispôsobivá výška */
    padding-bottom: 15px; /* Priestor pod obsahom */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    /* Reset pre istotu */
    margin: 0;
}

.eben-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    z-index: 10;
}

/* Položka vo vnútri karty */
.eben-card-field {
    padding: 4px 10px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

/* Fotka */
.column-fotka {
    width: 100%;
    height: 180px;
    padding: 0;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.column-fotka img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    display: block;
}

/* Meno */
.column-meno {
    font-weight: 700;
    font-size: 18px;
    color: #222;
    padding-top: 5px;
    padding-bottom: 2px;
}

/* Prezývka */
.column-prezývka {
    font-size: 14px;
    color: #777;
    font-style: italic;
    min-height: 0; /* ZMENA: ak je prázdna, nech nezaberá miesto */
}
/* Skryť ak je prázdna alebo "-" */
.column-prezývka:empty, .column-prezývka:contains("-") {
    display: none;
}

/* Telefón a Email */
.column-telefon, .column-email {
    font-size: 13px;
}
.column-telefon a, .column-email a {
    color: #333;
    text-decoration: none;
    border-bottom: 1px dotted #ccc;
}

/* Vek */
.column-vek {
    font-size: 12px;
    color: #999;
}
.column-vek::after {
    content: " rokov";
}

/* Trvalé bydlisko */
.column-trvale-bydlisko {
    font-size: 11px;
    color: #999;
    line-height: 1.2;
    margin-top: 10px;
    padding-bottom: 5px;
}

/* Tímy (kontajner) */
.column-timy {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 5px 10px !important;
    min-height: 10px;
    /* Zrušené staré pozadie a border bloku */
    background: transparent;
    border: none;
    width: 100%;
    margin: 5px 0;
}

/* Tímy (jednotlivý chip) */
.eben-team-chip {
    display: inline-block;
    background: #e9ecef; /* Svetlo sivá */
    color: #495057;     /* Tmavo sivé písmo */
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
    margin: 0;
    font-weight: 600;
}

/* ---------- Deti (chips) ---------- */
.column-deti2 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 5px 10px !important;
    min-height: 10px;
    margin-top: 5px;
}

.dieta {
    display: inline-block;
    background: #e3c78e;
    color: #fff;
    font-weight: 600;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
    margin: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ---------- Load More & Spinner ---------- */
.eben-load-more {
    margin-top: 20px;
    padding: 12px 30px;
    background: #fff;
    border: 2px solid #3aa7b8;
    color: #3aa7b8;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.eben-load-more:hover {
    background: #3aa7b8;
    color: #fff;
}

.eben-loading, .eben-sentinel {
    margin: 20px 0;
    color: #888;
    font-size: 14px;
}

/* ---------- Responsive Mobile ---------- */
@media (max-width: 768px) {
    .eben-kontakty-toolbar {
        padding: 15px;
    }
    
    .eben-kontakty-toolbar__row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .eben-field, .eben-field--search {
        flex: 1 1 auto;
        width: 100%;
    }

    .eben-field--actions {
        flex-direction: row;
        justify-content: space-between;
        padding-top: 10px;
        border-top: 1px solid #eee;
    }

    .reset-button, .eben-edit-link {
        flex: 1;
        text-align: center;
    }

    /* Zväčšenie textov pre lepšiu čitateľnosť na mobile */
    .column-meno {
        font-size: 20px;
        padding-top: 8px;
        padding-bottom: 4px;
    }
    
    .column-telefon, .column-email {
        font-size: 15px;
        padding: 4px 10px;
    }
    
    .column-vek, .column-trvale-bydlisko {
        font-size: 13px;
    }

    /* Väčšie štítky pre dotykové ovládanie */
    .dieta, .eben-team-chip {
        font-size: 12px;
        padding: 5px 10px;
        margin-bottom: 2px;
    }
    
    .input-modern, .select-modern {
        font-size: 16px; /* Zabraňuje zoomovaniu na iOS */
        padding: 12px 14px;
    }

    .reset-button, .eben-edit-link {
        height: 48px; /* Väčšia plocha pre dotyk */
        font-size: 15px;
    }

    /* Vynútené centrovanie kariet na mobile */
    .eben-kontakty-grid {
        justify-content: center !important;
        padding: 0;
        gap: 15px;
    }

    .eben-card {
        margin: 0 auto; /* Horizontálne centrovanie jednej karty */
        width: 100%;
        max-width: 320px;
    }
}

/* =========================================================
   Visual: circle (kruhová fotka + meno)
   Aktivuje sa cez shortcode: visual="circle"
   ========================================================= */
.eben-kontakty-wrapper[data-visual="circle"] .eben-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding-bottom: 0;
    width: 160px;
}

.eben-kontakty-wrapper[data-visual="circle"] .eben-card:hover {
    box-shadow: none;
    transform: none;
}

.eben-kontakty-wrapper[data-visual="circle"] .column-fotka {
    height: auto;
    margin-bottom: 8px;
}

.eben-kontakty-wrapper[data-visual="circle"] .column-fotka a {
    display: block;
}

.eben-kontakty-wrapper[data-visual="circle"] .column-fotka img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.eben-kontakty-wrapper[data-visual="circle"] .eben-card-field {
    padding: 0;
}

/* Zachovaj všetky polia z columns, len ich sprav "ľahšie" pod menom */
.eben-kontakty-wrapper[data-visual="circle"] .eben-card-field:not(.column-fotka):not(.column-meno) {
    margin-top: 6px;
    font-size: 13px;
    color: #555;
    text-align: center;
    padding: 0 6px;
    line-height: 1.25;
}

.eben-kontakty-wrapper[data-visual="circle"] .column-meno {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    text-align: center;
    padding: 0;
    margin-top: 6px;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .eben-kontakty-wrapper[data-visual="circle"] .eben-card {
        width: 150px;
        max-width: none;
    }
    .eben-kontakty-wrapper[data-visual="circle"] .column-fotka img {
        width: 140px;
        height: 140px;
    }
}
