/* AI-Header: UI utilities - animation, spacing, pre-box helpers */
/* Date: 2025-08-14 */

/* Preformatted content box (addresses, code blocks, etc.) */
.pre-box {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 1rem;
    white-space: pre-line;
}

/* Fade-in-up animation */
@keyframes anim-fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.anim-fade-in-up { animation: anim-fade-in-up 0.6s ease-out; }

/* Delay utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
/* AI-Header: Utility styles - scrollbars, animations, transitions */
/* Date: 2025-07-13 */

/* ===========================================
   SCROLLBARS - LIGHT THEME
   =========================================== */

[data-bs-theme="light"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-bs-theme="light"] ::-webkit-scrollbar-track {
    background: #f1f1f1;
}

[data-bs-theme="light"] ::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

[data-bs-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===========================================
   SCROLLBARS - DARK THEME
   =========================================== */

[data-bs-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #120000;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #5a1a1f; /* muted burgundy */
    border-radius: 4px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #7a2a32;
}

/* ===========================================
   LOADING ANIMATIONS - LIGHT THEME
   =========================================== */

[data-bs-theme="light"] .theme-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(114, 47, 55, 0.3);
    border-top: 2px solid #722F37;
    border-radius: 50%;
    animation: theme-spin 1s linear infinite;
}

/* ===========================================
   LOADING ANIMATIONS - DARK THEME
   =========================================== */

[data-bs-theme="dark"] .theme-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(233, 236, 239, 0.3);
    border-top: 2px solid #ff8a8a;
    border-radius: 50%;
    animation: theme-spin 1s linear infinite;
}

/* ===========================================
   ANIMATIONS KEYFRAMES
   =========================================== */

@keyframes theme-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================================
   GLOBAL TRANSITIONS
   =========================================== */

/* Enhanced transitions for smooth theme switching */
[data-bs-theme="light"] *,
[data-bs-theme="dark"] * {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* ===========================================
   UTILITIES - LOADING AND SPINNER COMPONENTS
   =========================================== */

/* Loading spinner for unauthenticated pages */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Loading status component for unauthenticated pages */
.loading-status {
    text-align: center;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    color: rgba(102, 126, 234, 0.9);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Themed spinner for authenticated pages */
.theme-spinner {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

[data-bs-theme="light"] .theme-spinner {
    border: 2px solid rgba(114, 47, 55, 0.3);
    border-top: 2px solid #722F37;
}

[data-bs-theme="dark"] .theme-spinner {
    border: 2px solid rgba(233, 236, 239, 0.3);
    border-top: 2px solid #ff8a8a;
}

/* Utility classes for loading states */
.loading-overlay {
    position: relative;
}

.loading-overlay::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top: 2px solid #722F37;
    border-radius: 50%;
    animation: theme-spin 1s linear infinite;
}

[data-bs-theme="dark"] .loading-overlay::after {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: #ff8a8a;
}
