/* New Rasaneh UI hotfix — logo + dark mode
   Loaded after page-level styles on purpose. */

/* Keep the site logo's original aspect ratio and prevent stretching. */
.navbar-brand {
    min-width: 0;
    max-width: min(220px, 48vw);
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    line-height: 1;
}

.navbar-brand .site-logo-image {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 180px;
    max-height: 64px;
    object-fit: contain;
    object-position: center;
    flex: 0 1 auto;
    filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.12));
}

.navbar.scrolled .navbar-brand .site-logo-image {
    max-height: 52px;
}

.site-logo-image[hidden] {
    display: none !important;
}

.site-logo-fallback {
    display: inline-block;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--primary-color);
    font-size: clamp(1.05rem, 2.5vw, 1.45rem);
    font-weight: 800;
    line-height: 1.4;
}

[data-bs-theme="dark"] .navbar-brand .site-logo-image {
    /* Gives dark artwork a light edge without changing transparent logos. */
    filter:
        drop-shadow(0 0 1px rgba(255, 255, 255, 0.95))
        drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

/* Complete the Bootstrap color variables used by components in dark mode. */
[data-bs-theme="dark"] {
    color-scheme: dark;
    --bs-body-color: #e5e7eb;
    --bs-body-color-rgb: 229, 231, 235;
    --bs-body-bg: #111827;
    --bs-body-bg-rgb: 17, 24, 39;
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: rgba(209, 213, 219, 0.82);
    --bs-secondary-bg: #1f2937;
    --bs-tertiary-bg: #182132;
    --bs-border-color: #374151;
    --bs-border-color-translucent: rgba(148, 163, 184, 0.24);
    --bs-link-color: #93c5fd;
    --bs-link-hover-color: #bfdbfe;
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] main,
[data-bs-theme="dark"] section:not(.hero-section):not(.blogs-header):not(.blog-detail-header) {
    color: var(--text-primary);
}

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

[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] a.text-dark,
[data-bs-theme="dark"] .card-title,
[data-bs-theme="dark"] .modal-title {
    color: var(--text-primary) !important;
}

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

[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
    border-color: var(--bs-border-color) !important;
}

/* Surfaces that previously remained white or used Bootstrap's light defaults. */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card-modern,
[data-bs-theme="dark"] .blog-card,
[data-bs-theme="dark"] .recent-blog-card,
[data-bs-theme="dark"] .testimonial-card,
[data-bs-theme="dark"] .portfolio-item,
[data-bs-theme="dark"] .step-card,
[data-bs-theme="dark"] .value-props .prop,
[data-bs-theme="dark"] .trust-badge,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .offcanvas,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .list-group-item,
[data-bs-theme="dark"] .accordion-item,
[data-bs-theme="dark"] .pagination .page-link {
    color: var(--text-primary);
    background-color: var(--bg-primary) !important;
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .accordion-button,
[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .accordion-button::after,
[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text,
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
[data-bs-theme="dark"] select {
    color: var(--text-primary);
    background-color: #111827;
    border-color: #4b5563;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] textarea:focus,
[data-bs-theme="dark"] input:focus,
[data-bs-theme="dark"] select:focus {
    color: var(--text-primary);
    background-color: #111827;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(129, 140, 248, 0.2);
}

[data-bs-theme="dark"] ::placeholder {
    color: #9ca3af !important;
    opacity: 1;
}

[data-bs-theme="dark"] .table {
    --bs-table-color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--bs-border-color);
    --bs-table-striped-color: var(--text-primary);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.035);
    --bs-table-hover-color: #ffffff;
    --bs-table-hover-bg: rgba(99, 102, 241, 0.12);
}

[data-bs-theme="dark"] .btn-light {
    color: #111827;
    background-color: #f8fafc;
    border-color: #f8fafc;
}

[data-bs-theme="dark"] .btn-outline-dark {
    color: #e5e7eb;
    border-color: #94a3b8;
}

[data-bs-theme="dark"] .btn-outline-dark:hover {
    color: #111827;
    background-color: #e5e7eb;
}

[data-bs-theme="dark"] .blog-swiper-next,
[data-bs-theme="dark"] .blog-swiper-prev {
    color: #ffffff;
    background: #1f2937;
    border: 1px solid #374151;
}

[data-bs-theme="dark"] .blog-swiper-next:hover,
[data-bs-theme="dark"] .blog-swiper-prev:hover {
    background: var(--primary-color);
}

/* Partner artwork often contains black text; keep a neutral canvas in both themes. */
[data-bs-theme="dark"] .partner-logo {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.45);
}

[data-bs-theme="dark"] .partner-logo img {
    opacity: 0.82;
}

[data-bs-theme="dark"] .about-image,
[data-bs-theme="dark"] .blog-content img,
[data-bs-theme="dark"] .recent-blog-card img,
[data-bs-theme="dark"] .blog-image {
    background-color: #182132;
}

[data-bs-theme="dark"] .blog-content blockquote {
    color: var(--text-secondary);
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-light);
}

[data-bs-theme="dark"] .navbar-collapse.show,
[data-bs-theme="dark"] .navbar-collapse.collapsing {
    background-color: rgba(31, 41, 55, 0.98);
}

[data-bs-theme="dark"] .nav-link.active,
[data-bs-theme="dark"] .nav-link:hover {
    color: #bfdbfe;
}

[data-bs-theme="dark"] .footer .text-muted {
    color: #cbd5e1 !important;
}

@media (max-width: 991.98px) {
    .navbar-brand .site-logo-image {
        max-width: 150px;
        max-height: 54px;
    }

    .navbar-collapse.show,
    .navbar-collapse.collapsing {
        margin-top: 0.75rem;
        padding: 0.75rem;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .navbar-brand .site-logo-image,
    .site-logo-fallback {
        transition: none !important;
    }
}
