/**
 * Common styles for Ada application
 * Uses Bootstrap 5.3 native dark mode (data-bs-theme)
 */

/* ============================================================================
   Toast Notifications
   ============================================================================ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.ada-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateX(100%);
    transition: all 300ms ease;
}

.ada-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.ada-toast-success { border-left: 4px solid var(--bs-success); }
.ada-toast-error { border-left: 4px solid var(--bs-danger); }
.ada-toast-warning { border-left: 4px solid var(--bs-warning); }
.ada-toast-info { border-left: 4px solid var(--bs-primary); }

.ada-toast-icon { font-size: 1.25rem; line-height: 1; }
.ada-toast-success .ada-toast-icon { color: var(--bs-success); }
.ada-toast-error .ada-toast-icon { color: var(--bs-danger); }
.ada-toast-warning .ada-toast-icon { color: var(--bs-warning); }
.ada-toast-info .ada-toast-icon { color: var(--bs-primary); }

.ada-toast-message { flex: 1; font-size: 0.9rem; }
.ada-toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--bs-secondary);
    cursor: pointer;
    padding: 0;
}
.ada-toast-close:hover { color: var(--bs-body-color); }

/* ============================================================================
   Loading States
   ============================================================================ */
.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid var(--bs-border-color);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg { width: 2.5rem; height: 2.5rem; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading { pointer-events: none; opacity: 0.7; }

.loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(2px);
    z-index: 10;
}

[data-bs-theme="dark"] .loading-overlay {
    background: rgba(33,37,41,0.8);
}

/* ============================================================================
   Theme Toggle Button
   ============================================================================ */
.theme-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-secondary-bg);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 150ms ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* ============================================================================
   Mobile Responsiveness
   ============================================================================ */
@media (max-width: 768px) {
    .table { font-size: 0.85rem; }
    .table th, .table td { padding: 0.5rem; white-space: nowrap; }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    .toast-container { left: 0.5rem; right: 0.5rem; max-width: none; }
    .theme-toggle { bottom: 0.5rem; right: 0.5rem; width: 36px; height: 36px; }
    .quote-container { margin: 1rem auto !important; padding: 1rem !important; }
    .quote-text { font-size: 0.95rem !important; }
}

/* ============================================================================
   Dark mode scrollbar
   ============================================================================ */
[data-bs-theme="dark"] ::-webkit-scrollbar { width: 8px; height: 8px; }
[data-bs-theme="dark"] ::-webkit-scrollbar-track { background: var(--bs-secondary-bg); }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--bs-border-color); border-radius: 4px; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: var(--bs-secondary); }
