/* public/css/app.css - Qana'App Tailwind Companion Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #0d9488;
    --primary-light: #ccfbf1;
    --primary-dark: #0f766e;
    --accent-emerald: #059669;
    --accent-amber: #d97706;
    --accent-rose: #e11d48;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #f8fafc;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

.arabic-font {
    font-family: 'Amiri', serif;
    direction: rtl;
    line-height: 1.9;
}

/* ==========================================================================
   TAB & VIEW VISIBILITY RULES
   ========================================================================== */

.tab-content.hidden {
    display: none !important;
}

#loginScreenView.hidden,
#mainAppView.hidden {
    display: none !important;
}

/* Tab Display Rules */
#tab-content-chat:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 0% !important;
    overflow: hidden !important;
}

#tab-content-vision:not(.hidden),
#tab-content-fomo:not(.hidden),
#tab-content-bk:not(.hidden) {
    display: block !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 0% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain;
}

/* ==========================================================================
   CHAT VIEWPORT & SCROLLING ENGINE
   ========================================================================== */

.chat-grid-wrapper {
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 0% !important;
    overflow: hidden !important;
}

.chat-stream-col {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 0% !important;
    overflow: hidden !important;
}

#chatMessagesContainer {
    flex: 1 1 0% !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    user-select: text !important;
    -webkit-user-select: text !important;
}

.desktop-side-col {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
}

/* ==========================================================================
   CHAT BUBBLE & COMPONENT STYLING
   ========================================================================== */

.chat-bubble-user {
    background: linear-gradient(135deg, #0d9488, #059669);
    color: #ffffff;
    border-radius: 20px 20px 4px 20px;
    box-shadow: 0 4px 14px -2px rgba(13, 148, 136, 0.25);
}

.chat-bubble-bot {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-radius: 20px 20px 20px 4px;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.04);
}

/* Typing Indicator Animation */
.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #0d9488;
    animation: typingPulse 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.1); opacity: 1; }
}

/* Navigation items */
.sidebar-nav-item.active {
    background-color: #0d9488 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3) !important;
}
.sidebar-nav-item.active i {
    color: #ffffff !important;
}

.nav-tab-btn.active {
    color: #0d9488 !important;
}
.nav-tab-btn.active .tab-icon {
    transform: translateY(-2px);
}

/* ==========================================================================
   CUSTOM SLIM SCROLLBARS
   ========================================================================== */

* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==========================================================================
   SELECT2 CUSTOM STYLING (TEAL & SLATE ROUNDED MODERN THEME)
   ========================================================================== */

.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single {
    height: 40px !important;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    font-family: inherit !important;
    transition: all 0.2s ease !important;
}

.select2-container--open .select2-selection--single,
.select2-container--focus .select2-selection--single {
    border-color: #0d9488 !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15) !important;
    outline: none !important;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    color: #1e293b !important;
    font-weight: 600 !important;
    padding-left: 2px !important;
    line-height: normal !important;
}

.select2-container .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    right: 10px !important;
}

.select2-container .select2-selection--single .select2-selection__arrow b {
    border-color: #64748b transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
}

.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #0d9488 transparent !important;
    border-width: 0 4px 5px 4px !important;
}

.select2-container .select2-selection--single .select2-selection__clear {
    color: #94a3b8 !important;
    font-size: 14px !important;
    margin-right: 6px !important;
}
.select2-container .select2-selection--single .select2-selection__clear:hover {
    color: #e11d48 !important;
}

/* Dropdown Menu */
.select2-dropdown {
    border: 1px solid #cbd5e1 !important;
    border-radius: 14px !important;
    box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.15) !important;
    background-color: #ffffff !important;
    overflow: hidden !important;
    z-index: 99999 !important;
}

.select2-search--dropdown {
    padding: 8px !important;
    background-color: #f8fafc !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    font-family: inherit !important;
    outline: none !important;
    background-color: #ffffff !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #0d9488 !important;
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15) !important;
}

.select2-results__options {
    max-height: 220px !important;
    padding: 4px !important;
    font-size: 12px !important;
    font-family: inherit !important;
}

.select2-results__option {
    padding: 8px 12px !important;
    border-radius: 8px !important;
    margin-bottom: 2px !important;
    color: #334155 !important;
    transition: background-color 0.15s ease !important;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: #0d9488 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.select2-results__option[aria-selected="true"] {
    background-color: #ccfbf1 !important;
    color: #0f766e !important;
    font-weight: 700 !important;
}
