/*
 * board_styles.css
 * Styles specifically related to board loading, animations,
 * and JS-driven UI changes to comply with CSP.
 */

/* Helper classes for JS style manipulation (Opacity/Display) */
.is-hidden {
    opacity: 0 !important;
    /* Consider adding visibility: hidden if needed */
    /* transition: opacity 0.3s ease-out; */
}

.is-visible {
    opacity: 1 !important;
}

/* Fade classes for alerts/modals */
.fade-in {
    opacity: 1 !important;
    transform: translateX(0) !important;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out !important;
}

.fade-out {
    opacity: 0 !important;
    transform: translateX(100%) !important; /* Example for alerts closing to the right */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out !important;
}

/* Add display: none for Bootstrap's d-none if not using Bootstrap's CSS */
/* Or ensure Bootstrap CSS is loaded */
/* .d-none {
    display: none !important;
} */

/* Cursor styles */
.cursor-default {
    cursor: default !important;
}

/* Add pointer cursor utility to replace inline styles */
.cursor-pointer {
    cursor: pointer !important;
}

/* Minimum width utility for header logo container */
.min-w-350 {
    min-width: 350px !important;
}

/* Pointer events */
/* Use Bootstrap's built-in class if available: .pe-none */
/* .pointer-events-none {
    pointer-events: none !important;
} */

/* Base styles for the loading progress bar */
#loadingProgressBar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%; /* Controlled by JS */
    height: 2px;
    background: linear-gradient(90deg, #4b23b0, #9747FF, #b747ff, #9747FF, #4b23b0);
    background-size: 200% 200%;
    z-index: 9999;
    opacity: 0.8;
    transition: width 0.2s ease-out, opacity 0.2s ease-out;
    animation: loadingGradient 3s ease infinite;
}

#loadingProgressBar.is-hiding {
    opacity: 0 !important;
    width: 100% !important; /* Ensure it reaches full width before hiding */
    animation: none !important;
}

/* Hide progress bar on mobile */
@media (max-width: 767.98px) {
    #loadingProgressBar {
        display: none !important;
    }
}

@keyframes loadingGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Keyframes for progress bar gradient used in boardLoader */
@keyframes moveGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Styling for the Deep Research Toggle (Bootstrap Override) */
.deep-research-toggle-container {
    /* Styles for the container div if needed */
}

/* Override default Bootstrap switch colors */
.deep-research-toggle-container .form-check-input {
    cursor: pointer;
    background-color: #343a40; /* Default dark background */
    border-color: #6c757d; /* Default dark border */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(255,255,255,.25)'/%3e%3c/svg%3e"); /* Default knob color */
    /* Ensure size is appropriate if overriding Bootstrap */
    /* height: 1.25rem; */ 
    /* width: 2.25rem; */
}

.deep-research-toggle-container .form-check-input:checked {
    background-color: #ffc107; /* Active yellow background */
    border-color: #ffc107; /* Active yellow border */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); /* Active knob color */
}

/* Style the icon next to the toggle */
.deep-research-toggle-container .deep-research-toggle-icon {
    color: #ffc107; /* Example icon color */
    font-size: 1.1rem;
    /* Add glow effect when toggle is checked - Note: Nested CSS syntax might require preprocessor or separate rules */
    /* text-shadow: 0 0 5px rgba(255, 193, 7, 0.7); */ /* Apply this conditionally via JS or separate rules */
}

/* Example of separate rule for glow effect (adjust selector as needed based on final HTML structure) */
.deep-research-toggle-container .form-check-input:checked ~ .ms-2 .deep-research-toggle-icon {
     text-shadow: 0 0 5px rgba(255, 193, 7, 0.7);
}

/* Style the label text */
.deep-research-toggle-container .deep-research-toggle-label {
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer; /* Make label clickable */
}

/* Style the sublabel text */
.deep-research-toggle-container .deep-research-toggle-sublabel {
    font-size: 0.7rem;
    line-height: 1;
    margin-top: -2px;
}

/* Refactored rules previously attempted */
.extended-context-accordion-item {
    border-color: #444 !important;
}

.extended-context-accordion-button {
    font-size: 0.75rem !important;
    padding: 0.5rem 1rem !important;
}

.fs-tiny {
    font-size: 0.7rem !important;
}

.fs-small {
    font-size: 0.9rem !important;
}

.lh-base {
    line-height: 1.4 !important; 
}

.opacity-9 {
    opacity: 0.9 !important;
}

.btn-flex-padding {
    flex: 1 !important;
    padding: 6px 12px !important;
}

/* --- Added to replace dynamic <style> injections from cardChat.js --- */
.non-pro-hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#chatInput.deep-research-input-active {
    border-color: #ffc107 !important; /* Gold color */
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25) !important;
}

/* Ensure consistent font sizing in chat interface */
#chatInput,
.chat-message,
#sendChatBtn,
.chat-send-button,
.chat-send-button .send-text,
#imageUploadBtn,
#documentUploadBtn,
#imageUploadBtn i,
#documentUploadBtn i,
#imageUploadBtn .button-text,
#documentUploadBtn .button-text {
    font-size: 1.1rem !important;
}

/* Inherit font size for inline elements inside chat messages */
.chat-message p,
.chat-message li,
.chat-message span {
    font-size: inherit !important;
}

/* Utility classes for onboarding modals */
.progress-thin {
  height: 4px !important;
  margin: 0.5rem 0 !important;
}

.mb-2rem {
  margin-bottom: 2rem !important;
}

/* Chat loading bar replacements */
.chat-loading-progress {
  height: 2px !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.chat-loading-progress-bar {
  width: 100% !important;
  background: linear-gradient(90deg, transparent 0%, var(--bs-primary) 50%, transparent 100%) !important;
  background-size: 200% 100% !important;
  animation: moveGradient 1.5s ease-in-out infinite alternate !important;
}

/* === Column Summary Modal Utility Classes === */
.summary-present {
    background-color: #6f42c1 !important; /* Purple background when summary exists */
}

.summary-empty {
    background-color: #2b3035 !important; /* Dark gray background when no summary */
}

.fs-100 {
    font-size: 1rem !important;
}

.fs-110 {
    font-size: 1.1rem !important;
}

/* Ensure context entry summary paragraphs display inline and no extra spacing */
.context-entry-summary p {
    margin-bottom: 0 !important;
    display: inline !important;
}

.context-entry-summary strong {
    display: inline !important;
    margin: 0 !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

/* Utility classes to replace inline max-height styles */
.mh-600 {
    max-height: 600px !important;
}

.mh-600-body {
    max-height: calc(600px - 130px) !important;
    overflow-y: auto !important;
}

/* Progress bar utility classes */
.progress-tall {
    height: 1.5rem !important;
}

.progress-bg-dark {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Width utility classes w-0 to w-100 (percentage widths) */
/* Generated manually for CSP-safe progress bars */
.w-0 { width: 0% !important; }
.w-1 { width: 1% !important; }
.w-2 { width: 2% !important; }
.w-3 { width: 3% !important; }
.w-4 { width: 4% !important; }
.w-5 { width: 5% !important; }
.w-6 { width: 6% !important; }
.w-7 { width: 7% !important; }
.w-8 { width: 8% !important; }
.w-9 { width: 9% !important; }
.w-10 { width: 10% !important; }
.w-11 { width: 11% !important; }
.w-12 { width: 12% !important; }
.w-13 { width: 13% !important; }
.w-14 { width: 14% !important; }
.w-15 { width: 15% !important; }
.w-16 { width: 16% !important; }
.w-17 { width: 17% !important; }
.w-18 { width: 18% !important; }
.w-19 { width: 19% !important; }
.w-20 { width: 20% !important; }
.w-21 { width: 21% !important; }
.w-22 { width: 22% !important; }
.w-23 { width: 23% !important; }
.w-24 { width: 24% !important; }
.w-25 { width: 25% !important; }
.w-26 { width: 26% !important; }
.w-27 { width: 27% !important; }
.w-28 { width: 28% !important; }
.w-29 { width: 29% !important; }
.w-30 { width: 30% !important; }
.w-31 { width: 31% !important; }
.w-32 { width: 32% !important; }
.w-33 { width: 33% !important; }
.w-34 { width: 34% !important; }
.w-35 { width: 35% !important; }
.w-36 { width: 36% !important; }
.w-37 { width: 37% !important; }
.w-38 { width: 38% !important; }
.w-39 { width: 39% !important; }
.w-40 { width: 40% !important; }
.w-41 { width: 41% !important; }
.w-42 { width: 42% !important; }
.w-43 { width: 43% !important; }
.w-44 { width: 44% !important; }
.w-45 { width: 45% !important; }
.w-46 { width: 46% !important; }
.w-47 { width: 47% !important; }
.w-48 { width: 48% !important; }
.w-49 { width: 49% !important; }
.w-50 { width: 50% !important; }
.w-51 { width: 51% !important; }
.w-52 { width: 52% !important; }
.w-53 { width: 53% !important; }
.w-54 { width: 54% !important; }
.w-55 { width: 55% !important; }
.w-56 { width: 56% !important; }
.w-57 { width: 57% !important; }
.w-58 { width: 58% !important; }
.w-59 { width: 59% !important; }
.w-60 { width: 60% !important; }
.w-61 { width: 61% !important; }
.w-62 { width: 62% !important; }
.w-63 { width: 63% !important; }
.w-64 { width: 64% !important; }
.w-65 { width: 65% !important; }
.w-66 { width: 66% !important; }
.w-67 { width: 67% !important; }
.w-68 { width: 68% !important; }
.w-69 { width: 69% !important; }
.w-70 { width: 70% !important; }
.w-71 { width: 71% !important; }
.w-72 { width: 72% !important; }
.w-73 { width: 73% !important; }
.w-74 { width: 74% !important; }
.w-75 { width: 75% !important; }
.w-76 { width: 76% !important; }
.w-77 { width: 77% !important; }
.w-78 { width: 78% !important; }
.w-79 { width: 79% !important; }
.w-80 { width: 80% !important; }
.w-81 { width: 81% !important; }
.w-82 { width: 82% !important; }
.w-83 { width: 83% !important; }
.w-84 { width: 84% !important; }
.w-85 { width: 85% !important; }
.w-86 { width: 86% !important; }
.w-87 { width: 87% !important; }
.w-88 { width: 88% !important; }
.w-89 { width: 89% !important; }
.w-90 { width: 90% !important; }
.w-91 { width: 91% !important; }
.w-92 { width: 92% !important; }
.w-93 { width: 93% !important; }
.w-94 { width: 94% !important; }
.w-95 { width: 95% !important; }
.w-96 { width: 96% !important; }
.w-97 { width: 97% !important; }
.w-98 { width: 98% !important; }
.w-99 { width: 99% !important; }
.w-100 { width: 100% !important; }

/* Theme toggle default desktop position */
.tt-default-pos {
    right: 30px !important;
    top: 60px !important;
    margin-top: 1px !important;
    z-index: 1030 !important;
}

.z-9999 { z-index: 9999 !important; }

.fs-80 {
    font-size: 0.8em !important;
}

.opacity-8 {
    opacity: 0.8 !important;
}

.rounded-bl-6 {
    border-bottom-left-radius: 6px !important;
}

.rounded-br-6 {
    border-bottom-right-radius: 6px !important;
}

.bg-visible {
    opacity: 1 !important;
    transform: scale(1) !important;
    z-index: -1 !important;
}

.preload-img {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.top-n025 {
    top: -0.25rem !important;
}

.fs-50 {
    font-size: 0.5em !important;
}

.solid-dark-bg {
    background: #121212 !important;
    background-image: none !important;
    background-color: #121212 !important;
} 

/* width utilities for progress bars */
.w-0   { width: 0%; }
.w-10  { width: 10%; }
.w-25  { width: 25%; }
.w-40  { width: 40%; }
.w-55  { width: 55%; }
.w-70  { width: 70%; }
.w-100 { width: 100%; }

/* whitespace utility */
.whitespace-preline { white-space: pre-line; }

/* Alert utility classes to replace inline styles in quickAIChats */
.alert-success-border { border-left: 4px solid #2ea043 !important; }
.alert-right { left: auto !important; right: 20px !important; }
.alert-transition { transition: opacity 0.3s ease, transform 0.3s ease !important; }

.h-40 { height: 40px !important; }
.fs-85 { font-size: 0.85rem !important; }

/* Override Bootstrap's fs-5 to match app's 1.2rem standard */
.fs-5 { font-size: 1.2rem !important; }

/* Featured board highlight styles (replaces inline setProperty) */
.featured-board-highlight {
    background: rgba(33, 37, 41, 0.2) !important;
    background-color: rgba(33, 37, 41, 0.2) !important;
    background-image: none !important;
    border: 2px solid var(--bs-primary) !important;
    border-radius: 10px !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.opacity-0 { opacity: 0 !important; }
.translate-out { transform: translateX(100%) !important; }

/* ---- Featured Board Cursor Rules ---- */
#boardList button.featured-board {
    cursor: default !important; /* Arrow cursor for non-clickable active board */
}

/* Keep interactive children clickable */
#boardList button.featured-board a,
#boardList button.featured-board .star-icon,
#boardList button.featured-board .board-robot-icon,
#boardList button.featured-board .board-list-menu {
    cursor: pointer !important; /* Hand cursor for icons/links */
}

/* === Local button text nudge for column add-card-container === */
.add-card-container .btn > i,
.add-card-container .btn > svg,
.add-card-container .btn > span,
.add-card-container .btn > small {
    position: relative;
    top: -1px;
}

/* Reset typography for spans we added inside .add-column buttons */
.add-column .btn > span {
    font-size: inherit !important;
    color: inherit !important;
    opacity: 1 !important;
    transition: none !important;
}

/* === Local button text nudge for column add-column (Add Topic buttons) === */
.add-column .btn > i,
.add-column .btn > svg,
.add-column .btn > span,
.add-column .btn > small {
    position: relative;
    top: -1px;
} 

.thinking-pill {
    display: flex !important;
    align-items: center !important;
    box-shadow: rgba(255, 193, 7, 0.15) 0px 4px 12px !important;
    backdrop-filter: blur(10px) !important;
    position: relative !important;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 193, 7, 0.05)) !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: rgba(255, 193, 7, 0.2) !important;
    border-image: initial !important;
    border-radius: 25px !important;
    padding: 12px 20px !important;
    overflow: hidden !important;
}

.thinking-text {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: rgba(255, 193, 7, 0.95) !important;
    margin-right: 12px !important;
    text-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px !important;
}

.research-typing-dots {
    display: inline-flex !important;
    align-items: center !important;
    margin-left: 8px !important;
    gap: 4px !important;
}

.research-typing-dots span:nth-child(1) {
    animation-delay: 0.1s !important;
}

.chat-message span {
    font-size: inherit !important;
}

.research-typing-dots span {
    width: 8px !important;
    height: 8px !important;
    box-shadow: rgba(255, 193, 7, 0.3) 0px 0px 4px !important;
    background: linear-gradient(45deg, rgb(255, 193, 7), rgb(255, 140, 0)) !important;
    border-radius: 50% !important;
    animation: 1.4s ease-in-out 0s infinite normal none running research-typing !important;
}

.deep-research-status-line {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    position: relative !important;
    min-height: 48px !important;
    padding: 16px 16px 16px !important;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05), rgba(255, 193, 7, 0.02)) !important;
    border-radius: 12px !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: rgba(255, 193, 7, 0.1) !important;
    border-image: initial !important;
    margin: 10px 0px !important;
    overflow: hidden !important;
}

/* Modal header context styling */
.context-path {
    font-size: 1rem !important;
    color: #adb5bd !important;
}

.context-title {
    font-size: 1.2rem !important;
    color: white !important;
    font-weight: 500 !important;
}
