/* Toast & Tour Styles */
:root {
    --tour-overlay-bg: rgba(0, 0, 0, 0.5);
    --tour-highlight-border: #fbbf24;
    --tour-highlight-glow: rgba(250, 204, 21, 0.8);
    --tour-bg: #ffffff;
    --tour-text: #064180; /* Professional dark blue */
    --tour-text-secondary: #2d3748; /* Darker charcoal/blue-gray for readability */
}

body.dark-mode {
    --tour-overlay-bg: rgba(0, 0, 0, 0.7);
    --tour-bg: #1f2937;
    --tour-text: #f3f4f6;
    --tour-text-secondary: #d1d5db;
}

/* Toast Container */
#toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 22000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

/* Toast Container - Force visibility and positioning */
#toast-container-tl {
    position: fixed !important;
    top: 60px !important;
    left: 20px !important;
    z-index: 2147483647 !important; /* Max z-index */
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    pointer-events: none !important;
    width: auto !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: transparent !important; /* Ensure container itself is invisible */
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
    width: fit-content;
    max-width: 24rem;
    /* IMPORTANT: Allow override via inline styles */
    max-width: var(--toast-max-width, 24rem);
    word-break: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    color: white;
    border: 2px solid var(--toast-border);
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.toast-info { background-color: #3b82f6; }
.toast-success { background-color: #10b981; }
.toast-error { background-color: #ef4444; }
.toast-warning { background-color: #f59e0b; }

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.7;
}
.toast-close:hover { opacity: 1; }

/* Tour Overlay SVG */
#tour-overlay-svg.active { display: block !important; }

/* Highlight Box */
#tour-highlight {
    position: fixed;
    border: 2px solid var(--tour-highlight-border);
    background-color: rgba(250, 204, 21, 0.1);
    z-index: 21001;
    pointer-events: none;
    display: none;
    /* Glow only, no shadow (shadow handled by SVG) */
    box-shadow: 0 0 20px var(--tour-highlight-glow);
    border-radius: 4px;
    transition: all 0.3s ease;
}
#tour-highlight.active { display: block; }

/* Tooltip */
#tour-tooltip {
    position: fixed;
    background-color: var(--tour-bg);
    color: var(--tour-text);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #4A90E2; 
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(6, 65, 128, 0.05); /* Multi-layered premium shadow */
    z-index: 21002;
    display: none;
    max-width: 20rem;
    width: 90%;
    font-family: 'Segoe UI', Arial, sans-serif;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Structural Anchor for Light Mode Tooltip */
body:not(.dark-mode) #tour-tooltip {
    border-top: 5px solid #064180;
    background-image: linear-gradient(to bottom, rgba(6, 65, 128, 0.03), transparent 60px);
}

#tour-tooltip.active { display: block; }

#tour-tooltip h3 {
    font-weight: 700;
    font-size: 1.0em;
    margin: 0 0 0.75rem 0;
    color: #064180; /* Professional blue for headings in light mode */
}

body.dark-mode #tour-tooltip h3 {
    color: #f3f4f6;
}

#tour-tooltip p {
    font-size: 0.85em;
    color: var(--tour-text-secondary);
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

#tour-tooltip ul {
    font-size: 0.85em;
    color: var(--tour-text-secondary);
    margin: 0 0 1rem 1.25rem;
    padding: 0;
    line-height: 1.6;
    list-style-type: disc;
}

#tour-tooltip li {
    margin-bottom: 0.5rem;
}

#tour-tooltip strong {
    color: #064180; /* Make strong tags pop in light mode */
    font-weight: 700;
}

body.dark-mode #tour-tooltip strong {
    color: #fff;
}

/* Tour Inline Icons - Mode Aware */
.tour-icon {
    width: 22px; /* Slightly larger */
    height: 22px;
    vertical-align: middle;
    margin-right: 8px;
    filter: brightness(0) saturate(100%) invert(18%) sepia(38%) saturate(3665%) hue-rotate(195deg) brightness(88%) contrast(97%); /* Matches header #064180 */
}

.tour-icon-no-invert {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 6px;
    filter: none;
}

body.dark-mode .tour-icon {
    filter: none; /* Stay white in dark mode */
}

/* Pro Tip Highlight */
.tour-tip {
    background-color: rgba(251, 191, 36, 0.15); /* Faint yellow background */
    border-left: 4px solid var(--tour-highlight-border); /* Matches bounding box */
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.85em;
    color: var(--tour-text);
}

.tour-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.tour-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    cursor: pointer;
    border: none;
    font-weight: 500;
}

.btn-tour-next {
    background-color: #064180;
    color: white;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 2px 4px rgba(6, 65, 128, 0.2);
}
.btn-tour-next:hover { 
    background-color: #0d6efd;
    box-shadow: 0 4px 8px rgba(6, 65, 128, 0.3);
}

.btn-tour-skip, .btn-tour-back {
    background-color: transparent;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    transition: all 0.2s ease;
}
.btn-tour-skip:hover, .btn-tour-back:hover:not(:disabled) {
    background-color: rgba(6, 65, 128, 0.05);
    border-color: #064180;
    color: #064180;
}

.tour-step-counter {
    font-size: 0.85em;
    font-weight: 600;
    color: #064180;
    background: rgba(6, 65, 128, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

body.dark-mode .tour-step-counter {
    color: #cbd5e0;
    background: rgba(255, 255, 255, 0.1);
}
.btn-tour-back:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

.tour-step-counter {
    font-size: 0.75rem;
    color: var(--tour-text-secondary);
    opacity: 0.8;
    white-space: nowrap;
}
