:root {
    --isg-dark-bg: #07111f;
    --isg-dark-surface: #0d1b2e;
    --isg-dark-surface-soft: #12243a;
    --isg-dark-border: #263b55;
    --isg-dark-text: #e7eef7;
    --isg-dark-muted: #a9b8ca;
}

html {
    color-scheme: light;
}

html[data-bs-theme="dark"] {
    color-scheme: dark;
    --bs-body-bg: var(--isg-dark-bg);
    --bs-body-color: var(--isg-dark-text);
    --bs-secondary-bg: var(--isg-dark-surface);
    --bs-tertiary-bg: var(--isg-dark-surface-soft);
    --bs-border-color: var(--isg-dark-border);
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: var(--isg-dark-muted);
}

body {
    transition:
        background-color 180ms ease,
        color 180ms ease;
}

.isg-header-v3 {
    position: sticky !important;
    top: 0;
    z-index: 1040;
}

.isg-topbar-v3 {
    position: relative;
    max-height: 44px;
    overflow: hidden;
    color: #eefaff;
    background:
        radial-gradient(
            circle at 15% 0%,
            rgba(34, 211, 238, 0.18),
            transparent 34%
        ),
        linear-gradient(100deg, #06162b 0%, #092947 100%);
    border-bottom: 1px solid rgba(125, 211, 252, 0.16);
    opacity: 1;
    transform: translateY(0);
    transition:
        max-height 240ms ease,
        opacity 180ms ease,
        transform 240ms ease,
        border-color 180ms ease;
}

.isg-topbar-v3::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.04) 50%,
        transparent 100%
    );
}

.isg-header-v3.is-topbar-hidden .isg-topbar-v3 {
    max-height: 0;
    border-color: transparent;
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.isg-topbar-v3-inner {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 40px;
    gap: 18px;
}

.isg-topbar-message-v1,
.isg-topbar-contact-v1,
.isg-topbar-link-v1 {
    align-items: center;
}

.isg-topbar-message-v1 {
    gap: 9px;
    margin-right: auto;
    color: rgba(238, 250, 255, 0.82);
    font-size: 0.76rem;
    letter-spacing: 0.02em;
}

.isg-topbar-message-v1 strong {
    color: #a7f3d0;
    font-weight: 700;
}

.isg-availability-dot-v1 {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5ee89f;
    box-shadow: 0 0 0 4px rgba(94, 232, 159, 0.13);
}

.isg-topbar-divider-v1 {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.18);
}

.isg-topbar-contact-v1 {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
    gap: 15px;
}

.isg-topbar-link-v1 {
    display: inline-flex;
    gap: 6px;
    color: rgba(238, 250, 255, 0.86);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

a.isg-topbar-link-v1:hover {
    color: #67e8f9;
}

.isg-topbar-link-v1 i {
    color: #67e8f9;
}

.isg-theme-switch-v1 {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 2px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
}

.isg-theme-option-v1 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 27px;
    gap: 5px;
    padding: 4px 9px;
    border: 0;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.72);
    background: transparent;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
}

.isg-theme-option-v1:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.isg-theme-option-v1.is-active {
    color: #07182a;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.isg-theme-option-v1[data-isg-theme-value="dark"].is-active {
    color: #05131f;
    background: #67e8f9;
}

html[data-bs-theme="dark"] body,
html[data-bs-theme="dark"] main {
    background-color: var(--isg-dark-bg);
    color: var(--isg-dark-text);
}

html[data-bs-theme="dark"] .isg-navbar-v3 {
    background: rgba(7, 17, 31, 0.97) !important;
    border-color: var(--isg-dark-border) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

html[data-bs-theme="dark"] .isg-navbar-brand-v3 {
    padding: 4px 9px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.97);
}

html[data-bs-theme="dark"] .isg-desktop-menu-v3 > a {
    color: #cbd8e7;
}

html[data-bs-theme="dark"] .isg-desktop-menu-v3 > a:hover,
html[data-bs-theme="dark"] .isg-desktop-menu-v3 > a.active {
    color: #67e8f9;
}

html[data-bs-theme="dark"] .isg-language-button-v3 {
    color: #e7eef7;
    background: var(--isg-dark-surface);
    border-color: var(--isg-dark-border);
}

html[data-bs-theme="dark"] .isg-language-menu-v3,
html[data-bs-theme="dark"] .dropdown-menu,
html[data-bs-theme="dark"] .isg-mobile-menu-v3 {
    color: var(--isg-dark-text);
    background: var(--isg-dark-surface);
    border-color: var(--isg-dark-border);
}

html[data-bs-theme="dark"] .isg-language-option-v3 {
    color: #dbe7f4;
}

html[data-bs-theme="dark"] .isg-language-option-v3:hover,
html[data-bs-theme="dark"] .isg-language-option-v3.active {
    color: #67e8f9;
    background: var(--isg-dark-surface-soft);
}

html[data-bs-theme="dark"] .isg-mobile-menu-v3 .btn-close {
    filter: invert(1) grayscale(1);
}

html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] .accordion-item,
html[data-bs-theme="dark"] .list-group-item,
html[data-bs-theme="dark"] .modal-content,
html[data-bs-theme="dark"] .offcanvas {
    color: var(--isg-dark-text);
    background-color: var(--isg-dark-surface);
    border-color: var(--isg-dark-border);
}

html[data-bs-theme="dark"] .bg-white,
html[data-bs-theme="dark"] .bg-light {
    background-color: var(--isg-dark-surface) !important;
}

html[data-bs-theme="dark"] .text-dark {
    color: var(--isg-dark-text) !important;
}

html[data-bs-theme="dark"] .text-muted {
    color: var(--isg-dark-muted) !important;
}

html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
    color: var(--isg-dark-text);
    background-color: #091728;
    border-color: var(--isg-dark-border);
}

html[data-bs-theme="dark"] .form-control::placeholder {
    color: #8295aa;
}

@media (max-width: 991.98px) {
    .isg-topbar-v3-inner {
        gap: 10px;
    }

    .isg-topbar-contact-v1 {
        margin-right: auto;
    }
}

@media (max-width: 575.98px) {
    .isg-topbar-v3-inner {
        min-height: 39px;
        padding-right: 10px;
        padding-left: 10px;
        gap: 7px;
    }

    .isg-email-link-v1 {
        min-width: 0;
        font-size: 0.7rem;
    }

    .isg-email-link-v1 span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .isg-theme-option-v1 {
        width: 28px;
        min-height: 26px;
        padding: 3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body,
    .isg-topbar-v3,
    .isg-theme-option-v1 {
        transition: none !important;
    }
}
