/* ==========================================================================
   TrueHRIS Unified AI Loader & Analysis Theme
   ========================================================================== */
:root {
    --thrx-ai-indigo: #4f46e5;
    --thrx-ai-purple: #7c3aed;
    --thrx-ai-cyan: #06b6d4;
    --thrx-ai-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
    --thrx-ai-glow: rgba(79, 70, 229, 0.35);
}

/* Modal and Overlay Card */
#atsLoaderModal .modal-dialog,
.thrx-ai-modal-dialog {
    max-width: 470px !important;
    margin: 1.75rem auto !important;
}

#atsLoaderModal .modal-content,
.thrx-ai-card {
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    border-radius: 24px !important;
    padding: 28px 24px 22px !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.8) inset !important;
    text-align: center !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Subtle ambient background glow at top of card */
#atsLoaderModal .modal-content::before,
.thrx-ai-card::before {
    content: "";
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 160px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

/* Header Bar */
.thrx-ai-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.thrx-ai-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.thrx-ai-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--thrx-ai-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.thrx-ai-brand-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 5px;
}

.thrx-ai-brand-badge {
    font-size: 10px;
    font-weight: 800;
    color: #ffffff;
    background: var(--thrx-ai-gradient);
    padding: 1px 6px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.thrx-ai-brand-sub {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.thrx-ai-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 100px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    font-size: 11px;
    font-weight: 700;
    color: #4338ca;
    letter-spacing: 0.4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.thrx-ai-close-btn {
    font-size: 11px !important;
    padding: 7px !important;
    border-radius: 50% !important;
    background-color: #f1f5f9 !important;
    opacity: 0.6 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.thrx-ai-close-btn:hover {
    opacity: 1 !important;
    background-color: #fee2e2 !important;
    transform: scale(1.08) !important;
}

.thrx-ai-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4f46e5;
    animation: thrxPulseDot 1.4s infinite ease-in-out;
}

.thrx-ai-dot.done {
    background: #10b981;
    animation: none;
}

@keyframes thrxPulseDot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.6);
    }
    50% {
        transform: scale(1.15);
        opacity: 0.75;
        box-shadow: 0 0 0 5px rgba(79, 70, 229, 0);
    }
}

/* Center AI Orb */
.thrx-ai-orb-wrap {
    position: relative;
    z-index: 1;
    width: 90px;
    height: 90px;
    margin: 8px auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thrx-ai-orb-glow {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, rgba(6, 182, 212, 0.2) 50%, transparent 70%);
    filter: blur(14px);
    animation: thrxOrbGlowPulse 2.8s ease-in-out infinite alternate;
}

@keyframes thrxOrbGlowPulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    100% { transform: scale(1.15); opacity: 1; }
}

.thrx-ai-ring-outer {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px dashed rgba(99, 102, 241, 0.4);
    animation: thrxSpin 14s linear infinite;
}

.thrx-ai-ring-inner {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    border-top-color: #6366f1;
    border-right-color: #06b6d4;
    animation: thrxSpinRev 2.4s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.thrx-ai-orb-core {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--thrx-ai-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

.thrx-ai-orb-core i {
    font-size: 26px;
    animation: thrxCorePulse 2.2s ease-in-out infinite;
}

@keyframes thrxSpin {
    100% { transform: rotate(360deg); }
}

@keyframes thrxSpinRev {
    100% { transform: rotate(-360deg); }
}

@keyframes thrxCorePulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.8)); }
    50% { transform: scale(1.12); filter: drop-shadow(0 0 8px rgba(255, 255, 255, 1)); }
}

/* Titles */
.thrx-ai-title {
    position: relative;
    z-index: 1;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    letter-spacing: -0.3px;
}

.thrx-ai-subtitle {
    position: relative;
    z-index: 1;
    font-size: 13.5px;
    color: #64748b;
    margin-bottom: 20px;
    font-weight: 500;
    min-height: 20px;
}

/* 4-Step Pipeline */
.thrx-ai-pipeline {
    position: relative;
    z-index: 1;
    margin: 18px 8px 18px;
}

.thrx-ai-timeline-track {
    position: absolute;
    top: 15px;
    left: 24px;
    right: 24px;
    height: 3px;
    background: #e2e8f0;
    border-radius: 6px;
    z-index: 1;
}

.thrx-ai-timeline-fill {
    height: 100%;
    width: 25%;
    background: var(--thrx-ai-gradient);
    border-radius: 6px;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.thrx-ai-steps {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
}

.thrx-ai-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.thrx-ai-step-node {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.thrx-ai-step-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #94a3b8;
    transition: all 0.3s ease;
}

/* Active & Completed step states */
.thrx-ai-step.active .thrx-ai-step-node {
    background: var(--thrx-ai-gradient);
    border-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), 0 4px 10px rgba(79, 70, 229, 0.3);
    transform: scale(1.1);
}

.thrx-ai-step.active .thrx-ai-step-label {
    color: #4f46e5;
    font-weight: 700;
}

.thrx-ai-step.completed .thrx-ai-step-node {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.thrx-ai-step.completed .thrx-ai-step-label {
    color: #10b981;
}

/* Live Status Activity Pill */
.thrx-ai-ticker-pill {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 100px;
    padding: 8px 18px;
    margin: 10px auto 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    max-width: 90%;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.thrx-ai-mini-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #cbd5e1;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: thrxSpin 0.75s linear infinite;
    flex-shrink: 0;
}

/* Results & Cards */
.thrx-ai-card-result {
    padding: 14px 16px;
    border-radius: 14px;
    margin-top: 14px;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.thrx-ai-card-result.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.thrx-ai-card-result.warning {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.thrx-ai-card-result-icon {
    font-size: 20px;
    line-height: 1;
    margin-top: 1px;
}

.thrx-ai-card-result-title {
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 2px;
}

.thrx-ai-card-result-desc {
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.9;
}

/* Primary Glow Button */
.thrx-ai-btn-primary {
    background: var(--thrx-ai-gradient) !important;
    border: none !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 11px 20px !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
    transition: all 0.2s ease !important;
}

.thrx-ai-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45) !important;
    color: #ffffff !important;
}

/* Footer Badge */
.thrx-ai-footer {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 11.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Fixed Fullscreen AI Overlay (For jobs, mrf, edit pages) */
.thrx-ai-fullscreen-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
