:root {
    --primary-blue: #1e40af; /* Blue-800 */
    --action-blue: #3b82f6;  /* Blue-500 */
    --corp-navy: #0f172a;    /* Slate-900 */
    --bg-light: #ffffff;
    --bg-soft: #f8fafc;      /* Slate-50 */
    --bg-corporate: #eff6ff; /* Blue-50 */
    --border-color: #e2e8f0; /* Slate-200 */
    --text-main: #1e293b;    /* Slate-800 */
    --text-muted: #64748b;   /* Slate-500 */
    --text-light: #f8fafc;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Corporate Background Mesh - even more subtle */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: var(--bg-light);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.02) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(15, 23, 42, 0.02) 0px, transparent 50%);
}

/* Corporate Glassmorphism - clean and white-based */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
}

.glass-hover {
    transition: all 0.3s ease;
}

.glass-hover:hover {
    background: #ffffff;
    border-color: var(--action-blue);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

/* Corporate Gradient Text */
.text-gradient-blue {
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header Scroll Effect */
header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
}

/* Section Variations */
.section-dark {
    background-color: var(--primary-blue);
    color: var(--text-light);
}

.section-soft {
    background-color: var(--bg-soft);
}

.section-corporate {
    background-color: var(--bg-corporate);
}

.section-white {
    background-color: var(--bg-light);
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-blue);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 {
    color: var(--text-light);
}

.label-formal {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-soft);
    border-left: 3px solid var(--action-blue);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--action-blue);
}

.section-dark .label-formal {
    background: rgba(255, 255, 255, 0.1);
    color: #93c5fd;
    border-left-color: #93c5fd;
}

/* Formal Buttons - Sharp Edges */
.btn-primary {
    background: var(--primary-blue);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0px; /* Sharp edges */
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid var(--primary-blue);
}

.btn-primary:hover {
    background: var(--action-blue);
    border-color: var(--action-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

.btn-secondary {
    background: #ffffff;
    color: var(--primary-blue);
    padding: 0.75rem 1.5rem;
    border-radius: 0px; /* Sharp edges */
    border: 1px solid var(--primary-blue);
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-corporate);
    color: var(--action-blue);
    border-color: var(--action-blue);
}

/* Boxed Layout Utility */
.boxed-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* AI Simulation UI - Corporate Terminal */
.sim-window {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0px; /* Sharp edges */
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.sim-header {
    background: var(--bg-soft);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sim-dot {
    width: 8px;
    height: 8px;
    border-radius: 0px; /* Sharp edges */
    background: #cbd5e1;
}

#ai-sim-content {
    height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 12px;
    scroll-behavior: smooth;
    background: #ffffff;
}

/* Chat Bubbles Corporate */
.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 0px; /* Sharp edges */
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
}

.chat-bubble.left {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    color: var(--text-main);
}

.chat-bubble.right {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    align-self: flex-end;
    color: var(--primary-blue);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-soft);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Glow Effects - Subdued for Corporate */
.glow-blue::after, .glow-cyan::after, .glow-indigo::after {
    display: none; /* Removed for corporate look */
}

/* Badge Style - Formal */
.badge {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    color: var(--primary-blue);
    padding: 4px 12px;
    border-radius: 0px; /* Sharp edges */
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Utility for sharp edges override */
.rounded-none-important {
    border-radius: 0 !important;
}

.rounded-sm-important {
    border-radius: 2px !important;
}

/* Infinite Slider */
.slider-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    padding: 1rem 0;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.slider-track {
    display: flex;
    width: max-content;
    animation: scroll 40s linear infinite;
}

.slide {
    width: auto;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =========================================
   Chat Widget Styles
   ========================================= */

.chat-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

@keyframes pulse-shadow {
    0% { box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(30, 64, 175, 0); }
    100% { box-shadow: 0 0 0 0 rgba(30, 64, 175, 0); }
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1e40af; /* primary-blue */
    border: none;
    box-shadow: 0 10px 25px -5px rgba(30, 64, 175, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
    position: relative;
    z-index: 10000;
    animation: pulse-shadow 2s infinite;
}

.chat-toggle-btn:hover {
    background: #1e3a8a;
    transform: translateY(-2px); /* Subtle lift instead of scale to avoid sliding look */
    animation: none; /* Stop pulsing on hover */
}

.chat-box {
    width: 340px; /* Reduced from 380px */
    height: 500px; /* Reduced from 600px */
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
    position: absolute; /* Relative to container */
    bottom: 80px; /* Space for toggle button + gap */
    right: 0;
    border: 1px solid #e2e8f0;
    z-index: 9999;
}

.chat-box.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.chat-header {
    padding: 16px 20px;
    background: #1e40af;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chat-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    margin: 0;
    color: white; /* Ensure visible on blue background */
}

.chat-close-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.chat-message.bot {
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    align-self: flex-start;
    border-top-left-radius: 2px;
    box-shadow: 0 2px 5px -2px rgba(0,0,0,0.05);
}

.chat-message.user {
    background: #1e40af;
    color: white;
    align-self: flex-end;
    border-top-right-radius: 2px;
    box-shadow: 0 2px 5px -2px rgba(30, 64, 175, 0.3);
}

.chat-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #1e40af;
}

.chat-send-btn {
    background: #1e40af;
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: #1e3a8a;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    border-top-left-radius: 2px;
    align-self: flex-start;
    width: fit-content;
    margin-bottom: 5px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 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; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* =========================================
   Mobile Responsiveness Improvements
   ========================================= */

@media (max-width: 768px) {
    /* General Layout & Sizing Fixes */
    body, html {
        overflow-x: hidden;
        width: 100%;
    }

    .boxed-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Reduce excessive spacing */
    .pt-28 { padding-top: 5rem !important; }
    .pb-20 { padding-bottom: 3rem !important; }
    .py-32 { padding-top: 4rem !important; padding-bottom: 4rem !important; }
    .mb-24 { margin-bottom: 3rem !important; }
    .gap-16 { gap: 2rem !important; }
    .p-16, .lg\:p-24 { padding: 2rem !important; }

    /* Typography Scaling */
    .text-5xl, .lg\:text-7xl, .lg\:text-6xl {
        font-size: 2.25rem !important;
        line-height: 1.2 !important;
        word-wrap: break-word;
    }
    
    .text-4xl {
        font-size: 1.75rem !important;
    }

    /* Chat Widget Full Screen on Mobile */
    .chat-widget-container {
        bottom: 0;
        right: 0;
        width: 0; /* Container shouldn't block clicks when closed */
        height: 0;
        z-index: 10000;
    }

    .chat-toggle-btn {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        z-index: 10000; /* Above everything */
    }

    .chat-box {
        position: fixed;
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        margin-bottom: 0;
        transform: translateY(100%); /* Start off-screen */
        opacity: 1; /* Reset desktop opacity */
        z-index: 10001;
        border: none;
    }

    .chat-box.active {
        transform: translateY(0);
    }
    
    .chat-header {
        padding: 20px;
    }
    
    /* Adjust input area for mobile keyboard */
    .chat-input-area {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}
