/* Global Variables - Management Consulting Palette */
:root {
    --primary-navy: #0A192F;
    --accent-blue: #1B4F72;
    --text-charcoal: #2D3436;
    --text-muted: #636E72;
    --bg-white: #FFFFFF;
    --bg-off-white: #F9FAFB;
    --border-light: #E5E7EB;
    --logo-blue: #1699e7;
    /* Blue from the insight collective logo */

    --shadow-premium: 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-intense: 0 20px 40px rgba(0, 0, 0, 0.05);

    --primary-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --serif-font: 'Playfair Display', serif;

    /* Responsive Spacing */
    --section-padding: clamp(60px, 8vw, 120px);
}

/* Base Styles */
body {
    background-color: var(--bg-white);
    font-family: var(--primary-font);
    color: var(--text-charcoal);
    line-height: 1.7;
    margin: 0;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: auto;
    /* Allow mouse interaction for 3D effect */
    background-color: var(--bg-white);
    /* Fallback background */
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--primary-navy);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); line-height: 1.05; }
h2 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; }
h3 { font-size: clamp(1.5rem, 4vw, 2.25rem); }

/* Navbar - Institutional & Clean */
.navbar {
    background: var(--primary-navy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--bg-white) !important;
    letter-spacing: -0.01em;
}

.navbar-brand img {
    height: 32px;
    margin-right: 12px;
    /* Removed filter to display the actual logo image */
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    font-size: 0.95rem;
    margin-left: 1.5rem;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.nav-link:hover {
    color: var(--bg-white) !important;
    opacity: 1;
}

/* Buttons - Deliberate & Premium */
.btn-primary {
    background-color: var(--primary-navy);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 4px;
    /* More architectural than rounded pill */
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-premium);
}

.btn-primary:hover {
    background-color: #124060;
    /* Darker accent blue */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary-navy);
    color: var(--primary-navy);
    padding: 0.875rem 2rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Typographic Accents */
.accent-line {
    width: 40px;
    height: 2px;
    background: var(--accent-blue);
    margin: 1rem 0;
}

/* Section Components */
.section-padding {
    padding: var(--section-padding) 0;
}

.bg-muted {
    background-color: var(--bg-off-white);
}

/* Hero Section - Selective & Authoritative */
.hero-section {
    background: var(--bg-white);
    padding: clamp(120px, 15vh, 200px) 0 clamp(60px, 8vw, 100px) 0;
    text-align: left;
}

.hero-sub {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    display: block;
}

.hero-title {
    max-width: 900px;
}

.hero-desc {
    font-size: 1.35rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 2rem 0;
}

/* Cards - Structured Intelligence */
.intelligence-card {
    background: white;
    border: 1px solid var(--border-light);
    padding: 3rem;
    height: 100%;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-premium);
}

.intelligence-card:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-intense);
}

.card-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-blue);
    margin-bottom: 1rem;
    display: block;
}

/* Blog/Insights Components */
.article-card {
    border: none;
    border-bottom: 1px solid var(--border-light);
    padding: 2rem 0;
    text-decoration: none;
    display: block;
    transition: opacity 0.2s ease;
}

.article-card:hover {
    opacity: 0.8;
}

.article-title {
    font-size: 1.75rem;
    margin: 0.5rem 0;
}

.article-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Intake Form - Selective & Serious */
.intake-form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 4rem);
    background: var(--bg-off-white);
    border: 1px solid var(--border-light);
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--primary-navy);
}

.form-control {
    border-radius: 2px;
    border: 1px solid var(--border-light);
    padding: 0.875rem;
    background: white;
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: none;
}

/* Footer - Architectural Integrity */
.footer {
    background: var(--primary-navy);
    color: white;
    padding: 80px 0 40px 0;
}

.footer-logo-container img {
    height: 40px;
    /* Removed filter to display original logo */
    margin-bottom: 2rem;
}

.footer h5 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer p,
.footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
}

.footer a:hover {
    color: white;
}

/* Mobile Adjustments */
@media (max-width: 992px) {
    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .section-padding {
        padding: 60px 0;
    }

    .hero-section {
        padding: 120px 0 60px 0;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-desc {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .glass-card {
        padding: 1.5rem;
    }
}

/* AI Floating Widget Styles */
.ai-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ai-floating-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-navy);
    color: white;
    font-size: 1.8rem;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.ai-floating-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
    animation: floatPulse 2s ease-in-out infinite;
}

@keyframes floatPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.25); opacity: 0; }
}

.ai-floating-btn:hover {
    transform: scale(1.1);
    background: var(--accent-blue);
}

/* Ensure buttons wrap on small screens */
.d-flex.gap-3 {
    flex-wrap: wrap;
}

.ai-chat-window {
    width: 400px;
    max-width: calc(100vw - 40px);
    height: clamp(420px, 72vh, 620px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.08);
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-chat-window:not(.d-none) {
    display: flex !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-chat-header {
    background: var(--primary-navy);
    color: white;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.95rem;
}

.ai-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

.ai-header-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.ai-header-btn:hover { background: rgba(255,255,255,0.25); }
.ai-header-btn.muted { color: rgba(255,255,255,0.4); }

.ai-chat-body {
    flex-grow: 1;
    padding: 18px;
    overflow-y: auto;
    background: #f8f9fb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-message {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.92rem;
    max-width: 88%;
    line-height: 1.5;
    animation: msgFadeIn 0.25s ease-out;
}

@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-received {
    background: white;
    color: var(--text-charcoal);
    align-self: flex-start;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    border-bottom-left-radius: 4px;
}

.ai-sent {
    background: var(--accent-blue);
    color: white;
    align-self: flex-end;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-bottom-right-radius: 4px;
}

/* Suggestion chips */
.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
    animation: msgFadeIn 0.3s ease-out;
}

.ai-chip {
    background: white;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.ai-chip:hover {
    background: var(--accent-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Chat input area */
.ai-chat-input {
    padding: 12px 14px;
    background: white;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.ai-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-input-row .form-control {
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 0.9rem;
    border: 1px solid rgba(0,0,0,0.1);
    transition: border-color 0.2s;
}
.ai-input-row .form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.ai-voice-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: var(--primary-navy);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.ai-voice-btn:hover { background: #e2e8f0; }
.ai-voice-btn.recording {
    background: #ef4444;
    color: white;
    animation: micPulse 0.8s ease-in-out infinite;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
}

.ai-send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary-navy);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.ai-send-btn:hover { background: var(--accent-blue); transform: scale(1.05); }

/* Voice status bar */
.ai-voice-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 2px;
    font-size: 0.82rem;
    color: #64748b;
}

.ai-listening-wave {
    display: inline-flex;
    gap: 3px;
    align-items: center;
    height: 16px;
}
.ai-listening-wave::before,
.ai-listening-wave::after,
.ai-listening-wave span {
    content: '';
    width: 3px;
    height: 10px;
    border-radius: 2px;
    background: #ef4444;
    animation: waveBar 0.6s ease-in-out infinite alternate;
}
.ai-listening-wave::before { animation-delay: 0s; height: 8px; }
.ai-listening-wave::after { animation-delay: 0.3s; height: 14px; }

@keyframes waveBar {
    from { transform: scaleY(0.5); }
    to { transform: scaleY(1.3); }
}

/* Typing indicator */
.ai-typing {
    display: inline-flex;
    gap: 4px;
    padding: 12px 16px;
}
.ai-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typingBounce 1.2s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Speaking indicator on messages */
.ai-speaking {
    position: relative;
}
.ai-speaking::after {
    content: '\1F50A';
    font-size: 0.7rem;
    position: absolute;
    bottom: 4px;
    right: 8px;
    animation: speakPulse 1s ease-in-out infinite;
}
@keyframes speakPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@media (max-width: 500px) {
    .ai-chat-window {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 80px;
        position: fixed;
        border-radius: 14px;
    }
}

/* Cleanup duplicate/competing queries */
@media (max-width: 992px) {
    /* Styles are mostly handled by clamp() and bootstrap classes now */
}