/*
 * Portfolio shell — pomocné styly pro AICV portfolio template
 * (loading overlay, SSO state visibility, exp-project pilly + CTA, hero upload zone).
 *
 * Tento soubor existuje, aby v index.html nebyly žádné inline <style> bloky ani
 * style="..." atributy. Kanonické typografické styly (.hero-v10__name, .skill-badge,
 * .position-card, …) zůstávají v hp-base/hp-sections/hp-components/hp-hero-v10.css —
 * ty jsou 1:1 sdílené s bachurek.cz.
 */

/* ================================================================
   1. SSO state — bachurek.cz / aicv.cz cross-domain login flag.
   Toggluje portfolio-boot.js podle localStorage.aicv_session.
   ================================================================ */
[data-aicv-show="logged-in"]                                         { display: none !important; }
html.aicv-logged-in [data-aicv-show="logged-in"]                     { display: inline-flex !important; }
html.aicv-logged-in .nav-user-dropdown[data-aicv-show="logged-in"]   { display: inline-block !important; }
html.aicv-logged-in [data-aicv-show="logged-out"]                    { display: none !important; }


/* ================================================================
   2. Loading overlay — viditelný, dokud app.js nenačte data z API.
   Po načtení body dostane class .is-portfolio-ready a overlay zmizí.
   ================================================================ */
.cv-portfolio-loading {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    gap: 1rem;
    background: #fff;
    z-index: 9999;
    font-family: system-ui, -apple-system, sans-serif;
    color: #6b7280;
}
.cv-portfolio-loading__spin {
    width: 40px; height: 40px;
    border: 3px solid #e5e7eb; border-top-color: #2563eb;
    border-radius: 50%;
    animation: cv-spin 1s linear infinite;
}
@keyframes cv-spin { to { transform: rotate(360deg); } }

body.is-portfolio-ready .cv-portfolio-loading { display: none; }
body:not(.is-portfolio-ready) .main-content,
body:not(.is-portfolio-ready) .public-nav,
body:not(.is-portfolio-ready) .site-footer,
body:not(.is-portfolio-ready) .cv-promo-fixed { visibility: hidden; }

.cv-portfolio-error {
    max-width: 520px;
    margin: 10vh auto;
    padding: 2rem;
    text-align: center;
    font-family: system-ui, sans-serif;
    color: #374151;
}
.cv-portfolio-error h1 {
    font-size: 2rem;
    margin: 0 0 1rem;
    color: #dc2626;
}


/* ================================================================
   3. Position-filter grey-out — pilly mimo vybranou pozici se zesvětlí.
   Aplikuje app.js po kliknutí na .position-card.
   ================================================================ */
.skill-badge.skill-badge--dimmed { opacity: .25; filter: saturate(.6); }


/* ================================================================
   4. Tech pilly + CTA tlačítko v exp-project-item.
   ================================================================ */
.exp-project-tags {
    display: flex; flex-wrap: wrap; gap: .35rem;
    margin-top: .5rem;
}
.exp-project-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    background: rgba(37, 99, 235, .08);
    color: #1e40af;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .01em;
    border: 1px solid rgba(37, 99, 235, .15);
    line-height: 1.4;
}
.hp-dark-mode .exp-project-tag {
    background: rgba(96, 165, 250, .12);
    color: #93c5fd;
    border-color: rgba(96, 165, 250, .25);
}

.exp-project-cta {
    display: flex; align-items: center; justify-content: center;
    gap: .5rem;
    width: 100%;
    margin-top: auto;
    padding: .7rem 1rem;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff !important;
    text-decoration: none !important;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .01em;
    border-radius: .55rem;
    box-shadow: 0 2px 10px rgba(37, 99, 235, .25);
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
}
.exp-project-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, .4);
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
}
.exp-project-cta i.bi:not(.exp-project-cta__arrow) { font-size: .95rem; }
.exp-project-cta__arrow                            { font-size: .9rem; transition: transform .25s ease; }
.exp-project-cta:hover .exp-project-cta__arrow     { transform: translateX(3px); }
.hp-dark-mode .exp-project-cta                     { box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }

/* Item layout: column flex → CTA padá na spodek + karty v gridu mají stejnou výšku. */
.exp-project-item                       { display: flex; flex-direction: column; height: 100%; }
.exp-project-item > .exp-project-tags   { margin-bottom: .5rem; }


/* ================================================================
   5. exp-item.exp-open detail override.
   hp-sections.css má max-height: 600px, což ořezává detail s > 3 projekty.
   Tady to nadrážíme na velkou hodnotu, aby všechny projekty byly viditelné.
   ================================================================ */
.exp-item.exp-open .exp-details { max-height: 5000px; }


/* ================================================================
   6. Honeypot — viditelné pouze pro boty (offscreen, 1×1px, hidden).
   Nahrazuje inline style="position:absolute;left:-9999px;..." v <form>.
   ================================================================ */
.contact-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}


/* ================================================================
   7. Upload zone container (Pro HR matchmaking) — max-width wrap.
   Nahrazuje inline style="max-width: 600px; margin: 0 auto;".
   ================================================================ */
.hero-upload-zone__wrap {
    max-width: 600px;
    margin: 0 auto;
}


/*
 * Universal PDF FAB — fixed pill tlačítko vlevo od AI launcheru.
 * z-index 1001 → vždy nad CV promo barem (z-index 950) i obsahem.
 * Position: bottom: 6rem (stejná řada jako AI launcher na bottom: 6rem),
 * right: 5.5rem (mezera 5rem vlevo od pravého okraje + 56px AI launcher).
 */

.aicv-pdf-fab {
    position: fixed;
    bottom: 6rem;
    right: 5.5rem; /* AI launcher je na right:1.5rem, šířka 56px → 5.5rem = mezera před ním */
    z-index: 1001;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .65rem 1.15rem .65rem 1rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #1d4ed8 100%);
    color: #fff;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .35);
    transition: transform .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s ease;
    text-decoration: none; /* pro <a> tagy */
    height: 56px; /* zarovnání s AI launcherem (56×56 kruh) */
    box-sizing: border-box;
}
.aicv-pdf-fab:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 32px rgba(15, 23, 42, .45);
    color: #fff;
}
.aicv-pdf-fab:active { transform: translateY(0) scale(.98); }
.aicv-pdf-fab i { font-size: 1.1rem; }

/* AI launcher z bachurek_cz nebo _shared/ai-chat-widget.css je na z-index 999.
   Boost na 1001, ať jistě nad promo barem. */
.aicv-chat-launcher { z-index: 1001 !important; }

/* Mobile — schovat textový label, jen ikona (kruh) */
@media (max-width: 640px) {
    .aicv-pdf-fab {
        right: 5rem; /* mezi AI launcherem a okrajem */
        padding: 0;
        width: 52px;
        height: 52px;
        justify-content: center;
        gap: 0;
        bottom: 5.5rem;
    }
    .aicv-pdf-fab__label { display: none; }
    .aicv-pdf-fab i { font-size: 1.25rem; }
}

/* Velmi úzké obrazovky — pokud není místo, schovat PDF FAB.
   AI launcher je důležitější (ai_widget feature). */
@media (max-width: 380px) {
    .aicv-pdf-fab { display: none; }
}

@media print {
    .aicv-pdf-fab { display: none !important; }
}

/* ============================================================
 * Bachurek_cz — overridy univerzálního PDF FAB
 * Důvod: bachurek_cz má vlastní AI launcher (.ai-chat-launcher)
 * na bottom:2rem, right:2rem, šířka 64px. Univerzální PDF FAB
 * default cílí na _shared/ai-chat-widget.css launcher (bottom:6rem,
 * right:1.5rem), takže v bachurek_cz se ocitnou v různých řadách.
 *
 * Sjednotit do stejné řady — pdf-fab vlevo od ai-chat-launcher.
 * ============================================================ */
.aicv-pdf-fab {
    bottom: 2rem;
    right: calc(2rem + 64px + 0.75rem); /* 2rem (launcher right) + 64px (launcher width) + gap */
}
.ai-chat-launcher { z-index: 1001 !important; }
.cv-promo-fixed   { z-index: 950 !important; }

/* Tablet (≤ 992px) — switch na icon-only kruh, na same row jako bachurek_cz launcher */
@media (max-width: 992px) {
    .aicv-pdf-fab {
        right: calc(2rem + 64px + 0.75rem);
        padding: 0;
        width: 56px;
        height: 56px;
        justify-content: center;
        gap: 0;
    }
    .aicv-pdf-fab__label { display: none; }
    .aicv-pdf-fab i { font-size: 1.35rem; }
}

@media (max-width: 640px) {
    .aicv-pdf-fab {
        bottom: 1.25rem;
        right: calc(1.25rem + 52px + 0.6rem); /* mobile launcher 52px @ right:1.25rem */
        width: 48px;
        height: 48px;
    }
    .aicv-pdf-fab i { font-size: 1.2rem; }
}

/* ============================================================
 * Online indikátor pro bachurek_cz vlastní AI launcher
 * (`.ai-chat-launcher` — odlišné CSS od _shared/aicv-*).
 *
 * Pozn.: `.ai-chat-launcher` má v hp-components.css `position: fixed`
 * (right:2rem, bottom:2rem) — fixed je positioning context pro absolutní
 * potomky, takže `.ai-chat-launcher__online { position: absolute; }` se
 * správně přichytí k launcheru. NEPŘEPISUJEME na position:relative.
 * ============================================================ */
.ai-chat-launcher__online {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #fff;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, .6);
    animation: ai-chat-online-pulse 2s ease-out infinite;
    pointer-events: none;
    z-index: 2;
}
@keyframes ai-chat-online-pulse {
    0%   { box-shadow: 0 0 0 0    rgba(16, 185, 129, .6); }
    70%  { box-shadow: 0 0 0 8px  rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0    rgba(16, 185, 129, 0); }
}

