#ai-btn-ask,
#ai-btn-briefing,
#ai-btn-insights {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-bottom: 3px solid transparent;
    color: #cbd5e1;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1 1 auto;
    min-width: 100px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#ai-btn-ask:hover,
#ai-btn-briefing:hover,
#ai-btn-insights:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

/* Active Tab State */
#ai-btn-ask.active,
#ai-btn-briefing.active,
#ai-btn-insights.active {
    background: rgba(102, 126, 234, 0.2);
    border-bottom-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

/* Tab Content */
#ai-tab-ask,
#ai-tab-briefing,
#ai-tab-insights {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

#ai-tab-ask.active,
#ai-tab-briefing.active,
#ai-tab-insights.active {
    display: block;
}

/* 8 Minds Grid */
.ai-minds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.ai-mind {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    font-size: 11px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ai-mind:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.ai-mind-emoji {
    font-size: 18px;
    margin-bottom: 6px;
    display: block;
}

.ai-mind-name {
    color: #e2e8f0;
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 11px;
}

.ai-mind-role {
    color: #94a3b8;
    font-size: 9px;
    line-height: 1.2;
}

/* Input Area */
#ai-query-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px;
    color: #e2e8f0;
    font-size: 13px;
    resize: vertical;
    min-height: 70px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

#ai-query-input::placeholder {
    color: #64748b;
}

#ai-query-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

/* Quick Questions */
/* #ai-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

#ai-quick-questions .btn {
    flex: 0 1 auto;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
} */

/* Output Areas */
#ai-query-output,
#ai-briefing-output,
#ai-insights-output {
    min-height: 150px;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid #334155;
}

/* Action Buttons */
.ai-action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

#ai-btn-ask-submit,
#ai-btn-briefing-submit,
#ai-btn-forecast,
#ai-btn-trend,
#ai-btn-insights-full {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#ai-btn-ask-submit:hover,
#ai-btn-briefing-submit:hover,
#ai-btn-forecast:hover,
#ai-btn-trend:hover,
#ai-btn-insights-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

#ai-btn-ask-submit:active,
#ai-btn-briefing-submit:active,
#ai-btn-forecast:active,
#ai-btn-trend:active,
#ai-btn-insights-full:active {
    transform: translateY(0);
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================================
   RESPONSIVE DESIGN - MOBILE FIRST APPROACH
   ============================================================ */

/* TABLET SCREENS (768px and down) */
@media (max-width: 768px) {
    .ai-modal-wrapper {
        flex-direction: column !important;
        height: auto;
        overflow-y: auto;
    }

    .ai-sidebar {
        width: 100% !important;
        height: auto !important;
        min-height: 60px;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px !important;
    }

    .ai-main-content {
        width: 100% !important;
        padding: 12px !important;
    }

    .ai-tab-container {
        flex-wrap: nowrap;
        gap: 6px;
        margin-bottom: 15px;
    }
    
    #ai-btn-ask, 
    #ai-btn-briefing, 
    #ai-btn-insights {
        flex: 1;
        padding: 10px 8px !important;
        font-size: 12px !important;
    }

    /* Grid down to 2 columns */
    .ai-minds-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 15px;
    }

    .ai-mind {
        padding: 10px;
        font-size: 11px;
    }

    .ai-mind-emoji {
        font-size: 18px;
        margin-bottom: 4px;
    }

    /* Reduce input and output sizes */
    #ai-query-input {
        padding: 10px;
        font-size: 13px;
        min-height: 70px;
    }

    #ai-query-output,
    #ai-briefing-output,
    #ai-insights-output {
        min-height: 150px;
        max-height: 300px;
        padding: 12px;
        font-size: 13px;
        margin-top: 12px;
    }

    .ai-action-buttons {
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
    }

    #ai-btn-ask-submit,
    #ai-btn-briefing-submit,
    #ai-btn-forecast,
    #ai-btn-trend,
    #ai-btn-insights-full {
        padding: 10px;
        font-size: 13px;
    }

    .glassmorphic-btn {
        padding: 10px 16px;
        font-size: 12px;
    }

    /* Stats box on tablets */
    .ai-stats-box {
        gap: 12px;
        padding: 11px;
    }

    .ai-stats-label {
        font-size: 11px;
    }

    .ai-stats-value {
        font-size: 11px;
    }
}

/* PHONE SCREENS (480px and down) */
@media (max-width: 480px) {
    .ai-sidebar {
        padding: 10px 12px !important;
        min-height: 50px;
    }

    .ai-main-content {
        padding: 10px !important;
    }

    .ai-tab-container {
        flex-direction: row;
        gap: 6px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    #ai-btn-ask, 
    #ai-btn-briefing, 
    #ai-btn-insights {
        flex: 1;
        width: auto;
        padding: 10px 6px !important;
        font-size: 12px !important;
        border-bottom: 3px solid transparent;
        border-right: none;
        margin-bottom: 0;
        min-width: 80px;
    }

    #ai-btn-ask.active,
    #ai-btn-briefing.active,
    #ai-btn-insights.active {
        border-bottom-color: #667eea;
        border-right: none;
    }

    /* Single column grid for minds */
    .ai-minds-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 12px;
    }

    .ai-mind {
        padding: 8px;
        font-size: 10px;
        border-radius: 6px;
    }

    .ai-mind-emoji {
        font-size: 16px;
        margin-bottom: 3px;
    }

    .ai-mind-name {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .ai-mind-role {
        font-size: 9px;
    }

    /* Stats box on phones */
    .ai-stats-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px;
    }

    .ai-stats-box span {
        display: block;
        margin-bottom: 4px;
    }

    /* Compact input */
    #ai-query-input {
        padding: 8px;
        font-size: 12px;
        min-height: 60px;
        margin-bottom: 10px;
    }

    #ai-query-input:focus {
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
    }

    /* Compact outputs */
    #ai-query-output,
    #ai-briefing-output,
    #ai-insights-output {
        min-height: 120px;
        max-height: 250px;
        padding: 10px;
        font-size: 12px;
        margin-top: 10px;
        border-radius: 6px;
    }

    /* Stack all buttons */
    .ai-action-buttons {
        flex-direction: column;
        gap: 6px;
        margin-top: 10px;
        width: 100%;
    }

    #ai-btn-ask-submit,
    #ai-btn-briefing-submit,
    #ai-btn-forecast,
    #ai-btn-trend,
    #ai-btn-insights-full {
        padding: 9px 12px;
        font-size: 12px;
        width: 100%;
        border-radius: 6px;
    }

    /* Quick questions horizontal scroll */
    #ai-quick-questions {
        gap: 6px;
        padding-bottom: 6px;
    }

    #ai-quick-questions .btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* Stats box responsive */
    .ai-stats-box {
        gap: 10px;
        padding: 10px;
    }

    .ai-stats-label {
        font-size: 11px;
    }

    .ai-stats-value {
        font-size: 11px;
    }

    .glassmorphic-btn {
        padding: 8px 12px;
        font-size: 11px;
        gap: 6px;
    }

    /* Hide animations on slow devices */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation: none !important;
            transition: none !important;
        }
    }
}

/* EXTRA SMALL SCREENS (under 360px) */
@media (max-width: 360px) {
    .ai-sidebar {
        padding: 8px 10px !important;
    }

    .ai-main-content {
        padding: 8px !important;
    }

    .ai-tab-container {
        gap: 4px;
    }

    #ai-btn-ask, 
    #ai-btn-briefing, 
    #ai-btn-insights {
        padding: 9px 4px !important;
        font-size: 11px !important;
        min-width: 70px;
    }

    .ai-minds-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-bottom: 10px;
    }

    #ai-query-input {
        padding: 6px;
        font-size: 11px;
        min-height: 50px;
    }

    #ai-btn-ask-submit,
    #ai-btn-briefing-submit,
    #ai-btn-forecast,
    #ai-btn-trend,
    #ai-btn-insights-full {
        padding: 8px 10px;
        font-size: 11px;
    }

    .ai-stats-box {
        gap: 6px;
        padding: 8px;
    }

    .ai-stats-label,
    .ai-stats-value {
        font-size: 10px;
    }
}
/* ============================================================
   GLASSMORPHIC BUTTON STYLING (AI Control Center)
   ============================================================ */

.glassmorphic-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.3px;
    cursor: pointer;
    transform: translateZ(0);
    perspective: 1000px;
}

.glassmorphic-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
    z-index: 1;
}

.glassmorphic-btn i {
    position: relative;
    z-index: 2;
}

.glassmorphic-btn span {
    position: relative;
    z-index: 2;
}

/* Glowing border animation */
.glassmorphic-btn::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(102, 126, 234, 0.3), transparent);
    border-radius: 12px;
    opacity: 0;
    z-index: 0;
    animation: glassGlow 3s infinite;
    pointer-events: none;
}

.glassmorphic-btn:hover::after {
    opacity: 1;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Ripple effect on click */
@keyframes glassRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.glassmorphic-btn:active::before {
    animation: glassRipple 0.6s cubic-bezier(0.4, 0, 0.6, 1);
}

/* ============================================================
   8 MINDS GOD-TIER SYSTEM ANIMATIONS
   ============================================================ */

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(0, 230, 118, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
    }
}

@keyframes mindGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }

    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
    }
}

@keyframes mindActivate {
    0% {
        transform: translateY(0);
        opacity: 0.8;
    }

    50% {
        transform: translateY(-2px);
        opacity: 1;
    }

    100% {
        transform: translateY(0);
        opacity: 0.8;
    }
}

/* .mind-card {
    animation: mindActivate 3s ease-in-out infinite;
}

.mind-card:nth-child(1) { animation-delay: 0s; }
.mind-card:nth-child(2) { animation-delay: 0.2s; }
.mind-card:nth-child(3) { animation-delay: 0.4s; }
.mind-card:nth-child(4) { animation-delay: 0.6s; }
.mind-card:nth-child(5) { animation-delay: 0.8s; }
.mind-card:nth-child(6) { animation-delay: 1s; }
.mind-card:nth-child(7) { animation-delay: 1.2s; }
.mind-card:nth-child(8) { animation-delay: 1.4s; } */


/* ADD THIS - Prevents top tabs from breaking to next line on small screens */
#ai-btn-ask,
#ai-btn-briefing,
#ai-btn-insights {
    padding: 10px 4px;
    font-size: 12px;
}

/* ADD THIS - Stacks the big action submit buttons neatly on mobile */
.ai-action-buttons {
    flex-direction: column;
    gap: 8px;
}

/* ADD THIS - Creates a clean, modern horizontal scrolling row for suggestions */
#ai-quick-questions {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

#ai-quick-questions::-webkit-scrollbar {
    height: 6px;
}

#ai-quick-questions::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

#ai-quick-questions::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

#ai-quick-questions::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

#ai-quick-questions .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}


/* Tab Container - Button Wrapper */
.ai-tab-container {
    display: flex;
    width: 100%;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: stretch;
}



/* Stats Box - All 8 minds info display */
.ai-stats-box {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    margin: 12px 0;
}

.ai-stats-box span {
    display: inline-block;
    white-space: nowrap;
}

.ai-stats-label {
    color: #667eea;
    font-weight: 600;
    font-size: 12px;
}

.ai-stats-value {
    color: #e2e8f0;
    font-size: 12px;
    margin-left: 4px;
}

/* ADD to ensure the question box and buttons don't get squished */
#ai-query-input {
    width: 100%;
    box-sizing: border-box; /* Prevents padding from breaking the width */
}

.ai-action-buttons {
    width: 100%;
    display: flex;
    gap: 15px;
}

.ai-action-buttons button {
    flex: 1; /* Makes "Ask 8 Minds" and "Quick Analysis" equal width */
}

/* ADD to the wrapper holding the purple sidebar AND the right content */
.ai-modal-wrapper { 
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1200px;
}

/* ADD to the right-side content area */
.ai-main-content {
    flex: 1; /* Takes up all remaining space next to the purple sidebar */
    display: flex;
    flex-direction: column;
    padding: 30px;
    overflow-y: auto;
}

