/* Custom CSS Extensions to Bootstrap */
:root {
    --link-color: #1a0dab;
    --link-visited: #681da8;
}

body {
    font-family: 'Plus Jakarta Sans', arial, sans-serif;
    background-color: #ffffff;
}

input, button, select, textarea {
    font-family: 'Plus Jakarta Sans', arial, sans-serif;
}

/* Base Adjustments */
a {
    color: var(--link-color);
}
a:hover {
    text-decoration: underline;
}
.text-primary {
    color: var(--link-color) !important;
}

/* Animations and Focus */
.hover-shadow {
    transition: box-shadow 200ms cubic-bezier(0.4, 0.0, 0.2, 1);
}
.hover-shadow:hover,
.hover-shadow:focus-within {
    box-shadow: 0 1px 6px rgba(32,33,36,.28) !important;
}

/* Result Overrides for Authenticity */
.result-title:visited {
    color: var(--link-visited) !important;
}

/* Page Loader Animation */
.search-loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.search-loader {
    width: 40px;
    height: 40px;
    position: relative;
    animation: orbit 1.5s linear infinite;
}

.search-loader i {
    font-size: 40px;
    color: #000080; /* Lacivert */
    position: absolute;
    top: 0;
    left: 0;
}

@keyframes orbit {
    0% { transform: rotate(0deg) translateX(55px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(55px) rotate(-360deg); }
}

.search-loader-wrapper.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* --------------------------------------
 * DARK MODE OVERRIDES (For Inline CSS)
 * -------------------------------------- */
[data-bs-theme="dark"] body {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] [style*="background: #fff"],
[data-bs-theme="dark"] [style*="background-color: #ffffff"],
[data-bs-theme="dark"] [style*="background-color: #fff"] {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] [style*="background: rgba(255,255,255,0.9)"],
[data-bs-theme="dark"] [style*="background: rgba(255,255,255,0.85)"],
[data-bs-theme="dark"] [style*="background: rgba(255, 255, 255, 0.9)"],
[data-bs-theme="dark"] [style*="background: rgba(255, 255, 255, 0.85)"] {
    background-color: rgba(30, 30, 30, 0.9) !important;
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] [style*="color: #444"],
[data-bs-theme="dark"] [style*="color:#444"],
[data-bs-theme="dark"] [style*="color: #555"],
[data-bs-theme="dark"] [style*="color:#555"],
[data-bs-theme="dark"] [style*="color: #888"],
[data-bs-theme="dark"] [style*="color:#888"],
[data-bs-theme="dark"] [style*="color: #1a1a1a"],
[data-bs-theme="dark"] [style*="color:#1a1a1a"],
[data-bs-theme="dark"] [style*="color: #4b5563"],
[data-bs-theme="dark"] [style*="color:#4b5563"],
[data-bs-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .text-muted {
    color: #a0a0a0 !important;
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
}

/* Brand Logo Box Fix for Dark Mode */
[data-bs-theme="dark"] .brand-logo-box {
    background-color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .form-control {
    background-color: #1e1e1e !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .form-control[style*="background: transparent"] {
    background-color: transparent !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #888 !important;
}

[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-light,
[data-bs-theme="dark"] [style*="border: 1px solid #e5e7eb"],
[data-bs-theme="dark"] [style*="border-color: #e5e7eb"] {
    border-color: #333 !important;
}

[data-bs-theme="dark"] .shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.5) !important;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #e0e0e0;
}
[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: #333;
    color: #fff;
}

[data-bs-theme="dark"] .search-loader-wrapper {
    background-color: #121212 !important;
}
[data-bs-theme="dark"] .search-loader i {
    color: #c9a84c; /* Goldish for dark mode instead of dark blue */
}

/* Modal and Dropdown fixes */
[data-bs-theme="dark"] .modal-header {
    border-bottom-color: #333;
}
[data-bs-theme="dark"] .modal-footer {
    border-top-color: #333;
}
[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dark Mode Logo Switcher */
[data-bs-theme="dark"] img[alt="AraBest Logo"],
[data-bs-theme="dark"] img[alt="AraBest"] {
    content: url('/dark-logo.png') !important;
}

