/* Modern Dark Theme Design System */
:root {
    /* Color Palette */
    --bg-main: #0a0c10;
    --bg-card: #14171f;
    --bg-darker: #050608;
    
    --text-primary: #f0f4f8;
    --text-secondary: #9aa8b8;
    
    /* Brand Colors (New Deep Blues) */
    --brand-blue: #2563eb; /* Vibrant primary blue */
    --brand-dark-blue: #1e3a8a; /* Deep navy */
    --brand-accent: #60a5fa; /* Lighter variant for highlights */
    
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(20, 23, 31, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, var(--brand-blue) 0%, #4a84a0 100%);
    --bg-glow: radial-gradient(circle at 50% 0%, rgba(108, 166, 193, 0.15) 0%, rgba(10, 12, 16, 0) 50%);
    
    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', 'Inter', system-ui, sans-serif;
    
    /* Spacing & Layout */
    --section-pad: 6rem;
    --container-width: 1200px;
    --border-radius-lg: 16px;
    --border-radius-md: 8px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for fixed nav */
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, .logo-text-footer {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: var(--section-pad) 0;
    position: relative;
}

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

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.hidden-visually {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-sans);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-lg {
    padding: 1rem 2.25rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--brand-blue);
    color: #fff;
    box-shadow: 0 4px 14px rgba(108, 166, 193, 0.25);
}

.btn-primary:hover {
    background: var(--brand-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 166, 193, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--brand-blue);
    transform: translateY(-2px);
}

/* Button Shine Effect */
.shine-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    animation: shine 6s infinite reverse;
}

@keyframes shine {
    0% { left: 200%; }
    20%, 100% { left: -100%; }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: all var(--transition-base);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    height: 96px; /* Increased from 80px */
}

/* LOGO MAGIC (Removing White Background) */
.brand-logo {
    height: 100%;
    width: auto;
    object-fit: contain;
    /* 
      We invert the dark text/icon so it shows as light text/icon on dark background 
    */
    filter: invert(1) brightness(1.2) contrast(1.1);
    transition: opacity 0.3s;
}

.brand-logo.fallback-active {
    /* If image fails to load, specific styling for fallback SVG */
    filter: none;
    mix-blend-mode: normal;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2rem;
}

.nav-item {
    font-weight: 500;
    font-size: 0.95rem;
    opacity: 0.8;
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-blue);
    transition: width var(--transition-base);
}

.nav-item:hover {
    opacity: 1;
}

.nav-item:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px; /* Nav offset */
    position: relative;
}

.hero-bg-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-glow);
    z-index: -1;
    pointer-events: none;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-inline: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Scroll Mouse Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.7;
}

.mouse {
    width: 24px;
    height: 36px;
    border: 2px solid var(--text-secondary);
    border-radius: 12px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--brand-blue);
    border-radius: 50%;
    animation: scrollMouse 2s infinite;
}

@keyframes scrollMouse {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 12px); opacity: 0; }
}

/* Shared Section Header */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

.title-underline {
    height: 3px;
    width: 60px;
    background: var(--primary-gradient);
    margin: 0 auto 1.5rem;
    border-radius: 2px;
}

.title-underline.left {
    margin: 0 0 1.5rem 0;
}

/* Services Section */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem 2rem;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    position: relative;
    overflow: hidden;
    flex: 1 1 300px;
    max-width: 500px;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: rgba(108, 166, 193, 0.3);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: rgba(108, 166, 193, 0.1);
    color: var(--brand-blue);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: background var(--transition-base), color var(--transition-base);
}

.service-card:hover .card-icon {
    background: var(--brand-blue);
    color: #fff;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 1rem;
}

/* About Section */
.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-content p {
    margin-bottom: 1.25rem;
}

.feature-list {
    list-style: none;
    margin-top: 2rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.feature-list .check {
    color: var(--brand-blue);
    margin-right: 12px;
    background: rgba(108, 166, 193, 0.1);
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: #fff;
}

.stat-symbol {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-blue);
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.5rem;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact-desc {
    margin-bottom: 2.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-item svg {
    color: var(--brand-blue);
}

.contact-form {
    padding: 2.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(108, 166, 193, 0.2);
}

/* Footer */
.footer {
    background: #000;
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.logo-text-footer {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.footer-brand p {
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a:hover {
    color: var(--brand-blue);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Animations (Scroll Reveal) */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-fade {
    opacity: 0;
    transition: all 1s ease-out;
}

.reveal-left {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-right {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-up.active,
.reveal-fade.active,
.reveal-left.active,
.reveal-right.active {
    opacity: 1;
    transform: translate(0);
}

.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }

/* Responsive Design */
@media (max-width: 900px) {
    .about-container,
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .about-visual {
        order: -1; /* Image/stats before text on mobile */
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .nav-links {
        display: none; /* Hide for mobile initially, can add mobile menu logic later */
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
}

/* Chatbot Widget */
.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: var(--font-sans);
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-toggle:hover {
    transform: scale(1.1);
}

.chatbot-toggle svg {
    transition: opacity 0.3s, transform 0.3s;
}

.chatbot-toggle .close-icon {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.chatbot-widget.open .chatbot-toggle .chat-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.chatbot-widget.open .chatbot-toggle .close-icon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-widget.open .chatbot-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

@media (max-width: 480px) {
    .chatbot-window {
        position: fixed;
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        z-index: 10000;
        border: none;
    }
    
    .chatbot-widget.open .chatbot-toggle {
        display: none; /* Hide toggle button in fullscreen mobile view */
    }
    
    .chatbot-header .mobile-close-btn {
        display: block !important;
    }
}

.chatbot-header {
    background: var(--brand-dark-blue);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bot-avatar {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-dark-blue);
}

.bot-info h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 0.1rem;
}

.bot-info span {
    font-size: 0.75rem;
    color: var(--brand-accent);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.bot-info span::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #10b981; /* Green status dot */
    border-radius: 50%;
    display: inline-block;
}

.mobile-close-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
}

.chatbot-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #0a0c10;
}

/* Custom scrollbar for chat */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.chat-message {
    max-width: 85%;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.bot {
    background: var(--bg-card);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.chat-message.user {
    background: var(--brand-blue);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message p {
    color: inherit;
    font-size: inherit;
    margin-bottom: 0.5rem;
}

.chat-message p:last-child {
    margin-bottom: 0;
}

.chat-message a {
    color: var(--brand-accent);
    text-decoration: underline;
    font-weight: 600;
}

.chat-message.user a {
    color: white;
}

.chat-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.chat-option-btn {
    background: transparent;
    border: 1px solid var(--brand-blue);
    color: var(--brand-accent);
    padding: 0.6rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    font-family: inherit;
}

.chat-option-btn:hover {
    background: rgba(37, 99, 235, 0.1);
    color: white;
}

.chat-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.chat-typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.chat-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.chat-typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* User Profile Dropdown Menu */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    border-radius: var(--border-radius-md);
    transition: background 0.3s;
    font-weight: 500;
}

.user-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--brand-accent);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.user-dropdown.active .user-dropdown-menu {
    display: flex;
    animation: fadeInDropdown 0.2s ease-out;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-menu a {
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--brand-accent);
}

.user-dropdown-menu a.logout-btn {
    border-top: 1px solid var(--border-color);
    color: #ef4444; /* red for logout */
}

/* Feedback Button for AI Pages */
.feedback-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    background: var(--brand-blue);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 30px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
    transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

.feedback-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.6);
    background: #1d4ed8;
    color: white; /* Ensure text stays white */
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .feedback-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

.user-dropdown-menu a.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}
