/**
 * PrimoSoftware — mstari wa vitufe + promo bar (muundo kama e-GA, maudhui ya Primo)
 */
:root {
    --primo-rail-brand: #7c3aed;
    --primo-rail-brand-dark: #5b21b6;
}

.primo-social-side {
    position: fixed;
    right: 6px;
    bottom: 100px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.primo-social-side .social-media-box {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 1px;
    text-decoration: none;
    color: inherit;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font: inherit;
    line-height: normal;
    -webkit-appearance: none;
    appearance: none;
}

.primo-social-side .social-text {
    display: flex;
    align-items: center;
    height: 40px;
    margin-top: 4px;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px 0 0 6px;
    background: linear-gradient(135deg, var(--primo-rail-brand), var(--primo-rail-brand-dark));
    color: #fff;
    max-width: 0;
    padding: 0;
    overflow: hidden;
    transition: max-width 0.25s ease, padding 0.3s ease;
}

.primo-social-side .social-media-box:hover .social-text,
.primo-social-side .social-media-box:focus-visible .social-text {
    max-width: 220px;
    padding: 0 16px;
}

.primo-social-side .social-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.97);
    color: var(--primo-rail-brand);
    font-size: 1.1rem;
    box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.22), 0 2px 1px -1px rgba(0, 0, 0, 0.05);
}

.primo-social-side .social-icon--whatsapp { color: #16a34a; }
.primo-social-side .social-icon--demo { color: #0ea5e9; }

/* Promo bar — PrimoSoftware (chini kulia) */
.primo-promo-bar {
    position: fixed;
    bottom: 0;
    right: 4.5%;
    z-index: 1035;
    width: min(36.6vw, 440px);
    min-width: 290px;
    min-height: 75px;
    max-height: 84px;
    margin-bottom: 10px;
    padding: 5px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 55%, #f8fafc 100%);
    border: 1px solid rgba(124, 58, 237, 0.15);
    box-shadow: 0 10px 25px -5px rgba(91, 33, 182, 0.2);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.primo-promo-bar.is-hidden {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
}

.primo-promo-bar__link {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.primo-promo-bar__logo {
    min-width: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.primo-promo-bar__logo img {
    width: auto;
    height: 42px;
    max-width: 72px;
    object-fit: contain;
    animation: primo-promo-pulse 6s ease-in-out infinite;
}

@keyframes primo-promo-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.primo-promo-bar__body {
    padding: 4px 28px 4px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex: 1;
}

.primo-promo-bar__body h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primo-rail-brand-dark);
    line-height: 1.2;
}

.primo-promo-bar__body p {
    margin: 0;
    font-size: 0.82em;
    color: #475569;
    line-height: 1.3;
}

.primo-promo-close {
    position: absolute;
    top: 4px;
    right: 6px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    font-size: 1.25rem;
}

#primoSearchModal {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 4rem 1rem 1rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

#primoSearchModal.is-open { display: flex; }

#primoSearchModal .primo-search-panel {
    width: min(100%, 560px);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

#primoSearchModal .primo-search-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, #f5f3ff, #fff);
}

#primoSearchModal .primo-search-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primo-rail-brand-dark);
}

#primoSearchModal .primo-search-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
}

#primoSearchModal .primo-search-body { padding: 1rem; }

#primoSearchModal .primo-search-input {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
}

#primoSearchModal .primo-search-input:focus {
    border-color: var(--primo-rail-brand);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

#primoSearchResults {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    max-height: 16rem;
    overflow-y: auto;
    font-size: 0.875rem;
}

#primoSearchResults a {
    display: block;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: #0f172a;
    text-decoration: none;
}

#primoSearchResults a:hover { background: #f5f3ff; }

#primoChatPanel {
    position: fixed;
    right: 56px;
    bottom: 108px;
    z-index: 1045;
    width: min(340px, calc(100vw - 2rem));
    display: none;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 20px 40px -12px rgba(91, 33, 182, 0.25);
    border: 1px solid #e9d5ff;
    overflow: hidden;
}

#primoChatPanel.is-open { display: block; }

#primoChatPanel .primo-chat-head {
    border-bottom: 1px solid #e9d5ff;
    background: linear-gradient(135deg, var(--primo-rail-brand), var(--primo-rail-brand-dark));
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

#primoChatPanel .primo-chat-body {
    padding: 1rem;
    font-size: 0.875rem;
    color: #475569;
}

#primoChatPanel .primo-chat-body p { margin: 0 0 0.75rem; }

#primoChatPanel .primo-chat-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

#primoChatPanel .primo-chat-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-decoration: none;
}

#primoChatPanel .primo-chat-link--wa { background: #ecfdf5; color: #065f46; }
#primoChatPanel .primo-chat-link--wa:hover { background: #d1fae5; }
#primoChatPanel .primo-chat-link--tel { background: #f0f9ff; color: #075985; }
#primoChatPanel .primo-chat-link--tel:hover { background: #e0f2fe; }
#primoChatPanel .primo-chat-link--mail { background: #f5f3ff; color: #5b21b6; }
#primoChatPanel .primo-chat-link--mail:hover { background: #ede9fe; }
#primoChatPanel .primo-chat-link--demo { background: #fff7ed; color: #c2410c; }
#primoChatPanel .primo-chat-link--demo:hover { background: #ffedd5; }

.dark .primo-promo-bar {
    background: linear-gradient(135deg, #1e1b4b 0%, #1e293b 100%);
    border-color: rgba(167, 139, 250, 0.25);
}
.dark .primo-promo-bar__body p { color: #cbd5e1; }
.dark .primo-promo-bar__body h5 { color: #c4b5fd; }
.dark #primoSearchModal .primo-search-panel { background: #0f172a; color: #e2e8f0; }
.dark #primoSearchModal .primo-search-head { background: #1e1b4b; border-color: #334155; }
.dark #primoSearchModal .primo-search-input { background: #0f172a; border-color: #475569; color: #e2e8f0; }
.dark #primoSearchResults a { color: #e2e8f0; }
.dark #primoSearchResults a:hover { background: #1e1b4b; }
.dark #primoChatPanel { background: #0f172a; border-color: #4c1d95; }
.dark #primoChatPanel .primo-chat-body { color: #cbd5e1; }

@media (max-width: 767px) {
    .primo-promo-bar { display: none; }
    .primo-social-side { bottom: 20px; }
}

@media (max-width: 480px) {
    .primo-social-side .social-media-box:hover .social-text,
    .primo-social-side .social-media-box:focus-visible .social-text {
        max-width: 0;
        padding: 0;
    }
}
