/* ===========================================
   HP Components — Tlačítka, formuláře, karty
   =========================================== */

/* === Tlačítka === */
.btn-primary-custom {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary-custom:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-outline-custom {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline-custom:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
}

/* === Upload zone === */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-zone i {
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.upload-zone.dragover i {
    color: var(--primary);
}

/* === Upload URL input === */
.upload-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

.upload-divider::before,
.upload-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.upload-url-input .input-group {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.upload-url-input .input-group-text {
    background: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-light);
}

.upload-url-input .form-control {
    border-color: var(--border-color);
    font-size: 0.9rem;
}

.upload-url-input .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.upload-url-input .btn {
    white-space: nowrap;
}

/* === Formuláře === */
.form-control-custom {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    width: 100%;
}

.form-control-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* === Stats === */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card__number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-card__label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* === Feature karty (homepage) === */
.feature-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all 0.25s ease;
    height: 100%;
}

.feature-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.1);
    transform: translateY(-3px);
}

.feature-card__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.feature-card__icon--blue { background: var(--primary-light); color: var(--primary); }
.feature-card__icon--amber { background: #fef3c7; color: #d97706; }
.feature-card__icon--green { background: #d1fae5; color: #059669; }
.feature-card__icon--purple { background: #ede9fe; color: #7c3aed; }
.feature-card__icon--red { background: #fee2e2; color: #dc2626; }
.feature-card__icon--teal { background: #ccfbf1; color: #0d9488; }

.feature-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card__desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* === Match Result Card === */
.match-result-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-align: left;
    margin-top: 1.5rem;
}

.match-result-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.match-result-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
}

.match-result-card__company {
    font-weight: 400;
    color: var(--text-muted);
}

.match-score-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border: 2px solid var(--score-color, #10b981);
    border-radius: var(--radius-md);
    padding: 0.4rem 0.9rem;
    min-width: 80px;
}

.match-score-badge__number {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--score-color, #10b981);
    line-height: 1;
}

.match-score-badge__label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--score-color, #10b981);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.match-result-card__summary {
    padding: 1.25rem 1.5rem 0;
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.65;
    margin: 0;
}

.match-result-card__section {
    padding: 1rem 1.5rem 0;
}

.match-result-card__section h6 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.match-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.match-list li {
    font-size: 0.875rem;
    color: var(--text-dark);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.4;
}

.match-list li i {
    flex-shrink: 0;
    margin-top: 2px;
}

.match-list--muted li {
    color: var(--text-muted);
}

.match-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.match-skill-tag {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
}

.match-result-card__footer {
    padding: 1.25rem 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}
/* === AI Chat Floating Widget === */
.ai-chat-launcher {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(249, 115, 22, 0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.ai-chat-launcher:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 40px rgba(249, 115, 22, 0.6);
}

.ai-chat-launcher .badge-new {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border: 3px solid #fff;
    border-radius: 50%;
    display: none;
}

.ai-chat-floating {
    position: fixed;
    bottom: 7.5rem; /* Zvýšeno od launcheru (původně 6rem) */
    right: 2rem;
    width: 380px; /* Zmenšeno na polovinu/pohodlnou šířku */
    max-width: calc(100vw - 4rem);
    height: 600px;
    max-height: calc(100vh - 10rem);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transform-origin: bottom right;
}

.ai-chat-floating.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.ai-chat-floating .ai-chat-header {
    padding: 1.25rem;
    cursor: move;
}

.ai-chat-floating .ai-chat-messages {
    flex: 1;
    height: auto;
}

/* Úprava barev ve floating widgetu */
[data-theme="dark"] .ai-chat-floating {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* Mobilní zobrazení pro widget */
@media (max-width: 767px) {
    /* Widget přes celou obrazovku */
    .ai-chat-floating {
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        z-index: 1040; /* nad Bootstrap navbarem (1030) */
        transform-origin: bottom center;
        transform: translateY(100%); /* slide-up animace místo scale */
    }

    /* Otevřený stav — slide in zdola */
    .ai-chat-floating.open {
        transform: translateY(0) scale(1);
    }

    /* Zrušit cursor: move (drag na mobilu nedává smysl) */
    .ai-chat-floating .ai-chat-header {
        cursor: default;
        /* Bezpečná oblast pro iOS notch (Dynamic Island) */
        padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
    }

    /* Messages vyplní celý zbývající prostor */
    .ai-chat-floating .ai-chat-messages {
        flex: 1;
        height: auto;
        min-height: 0; /* důležité pro flex-child */
    }

    /* Bezpečná oblast na spodku (iOS home bar) */
    .ai-chat-floating .ai-chat-input {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* Skrýt launcher, když je widget otevřen */
    .ai-chat-floating.open ~ .ai-chat-launcher {
        display: none !important;
    }

    /* Launcher — stejná velikost a bottom jako theme toggle */
    .ai-chat-launcher {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 52px;
        height: 52px;
    }
}

/* === Analysis Progress Overlay === */
#analysisOverlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.analysis-progress-box {
    background: #ffffff !important;
    border-radius: 16px;
    padding: 2.5rem 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    max-width: 420px;
    width: 90%;
    animation: fadeInUp 0.3s ease-out;
    color: #1e293b !important;
}

.analysis-progress-box h5 {
    font-weight: 700;
    color: #1e293b !important;
}

.analysis-progress-box .text-muted {
    color: #6b7280 !important;
}

.analysis-steps {
    text-align: left;
    margin-top: 1.25rem;
}

.analysis-step {
    padding: 8px 0;
    color: #9ca3af;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.3s, font-weight 0.3s;
}

.analysis-step i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.analysis-step.active {
    color: #1a56db;
    font-weight: 600;
}

.analysis-step.done {
    color: #059669;
}

.analysis-step.done i::before {
    content: "\f26a"; /* bi-check-circle-fill */
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

