/* ============================================================
   App shell — site-wide additions on top of main.css.
   Preloader (first load splash) + WhatsApp floating button +
   brand logo shadow. Loaded globally.
   ============================================================ */

/* ---------- Brand logo — swaps to the white mark on dark backgrounds ---------- */

[data-bs-theme="dark"] .brand-logo-swap {
    content: url("/assets/imgs/template/logo/aice-logo-white.png");
}

.app-preloader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--at-neutral-0, #fefefe);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.app-preloader--leaving {
    opacity: 0;
    visibility: hidden;
}

[data-bs-theme="dark"] .app-preloader {
    background: var(--at-neutral-950, #0f0f0f);
}

.app-preloader__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.app-preloader__logo {
    width: 200px;
    height: auto;
    animation: appPreloaderPulse 1.4s ease-in-out infinite;
}

@media (max-width: 574.98px) {
    .app-preloader__logo {
        width: 150px;
    }
}

@keyframes appPreloaderPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.55;
        transform: scale(0.97);
    }
}

.app-preloader__bar {
    width: 180px;
    height: 3px;
    border-radius: 999px;
    background: var(--at-neutral-100, #dfdfdf);
    overflow: hidden;
}

.app-preloader__bar-fill {
    display: block;
    height: 100%;
    background: #25843e;
    border-radius: inherit;
    transition: width 0.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .app-preloader__logo {
        animation: none;
    }
}

/* ---------- WhatsApp floating button ---------- */

.whatsapp-float {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 98;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px 8px 8px;
    background: #25d366;
    color: #fff;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.whatsapp-float:hover {
    color: #fff;
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.5);
    transform: translateY(-3px);
}

.whatsapp-float__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 50%;
    background: #fff;
}

.whatsapp-float__icon::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: whatsappPulse 2.4s ease-out infinite;
}

.whatsapp-float__label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

@keyframes whatsappPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .whatsapp-float__icon::before {
        animation: none;
    }
}

@media (max-width: 575.98px) {
    .whatsapp-float {
        left: 16px;
        bottom: 16px;
        padding: 0;
        width: 52px;
        height: 52px;
        justify-content: center;
    }
    .whatsapp-float__label {
        display: none;
    }
    .whatsapp-float__icon {
        width: 52px;
        height: 52px;
    }
}

/* ---------- Site search (popular searches + live results) ---------- */

.at-categories-item {
    cursor: pointer;
    font-family: inherit;
}

.at-search-form-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.at-search-results .at-categories-title {
    margin-top: 0;
}

.at-search-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
}

.at-search-result-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--at-neutral-100);
    background: var(--at-neutral-0);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.at-search-result-item:hover,
.at-search-result-item:focus-visible {
    background: var(--at-neutral-50);
    border-color: var(--at-neutral-900);
    transform: translateX(4px);
}

.at-search-result-item__title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--at-neutral-900);
}

.at-search-result-item__desc {
    font-size: 14px;
    color: var(--at-neutral-500);
}

.at-search-results-empty {
    color: var(--at-neutral-500);
    font-size: 15px;
    margin: 0;
}

/* ---------- Portfolio case-study detail list (checkmark bullets) ---------- */

.portfolio-detail-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
}

.portfolio-detail-list__item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 17px;
    line-height: 1.55;
    color: var(--at-neutral-950, #0f0f0f);
}

.portfolio-detail-list__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 3px;
    border-radius: 50%;
    background: var(--at-theme-primary, #25843e);
    color: #fff;
}

.portfolio-detail-list__icon svg {
    width: 10px;
    height: 10px;
}
