/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Light Mode - Proper light backgrounds */
:root {
    --primary-color: #881a8a;
    --primary-dark: #6a1469;
    --primary-light: #a020a0;
    --secondary-color: #000000;
    --text-dark: #1a1a1a;
    --text-light: #666666;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --bg-section: #f8f9fa;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --error-color: #dc3545;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --navbar-bg: #ffffff;
    --footer-bg: #1a1a1a;
    --card-bg: #ffffff;
}

/* Light Mode Override */
[data-theme="light"] {
    --primary-color: #881a8a;
    --primary-dark: #6a1469;
    --primary-light: #a020a0;
    --secondary-color: #000000;
    --text-dark: #1a1a1a;
    --text-light: #666666;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --bg-section: #f8f9fa;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --error-color: #dc3545;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --navbar-bg: #ffffff;
    --footer-bg: #1a1a1a;
    --card-bg: #ffffff;
}

/* Dark Mode (Default) - Original DataMossa Colors */
[data-theme="dark"] {
    --primary-color: #881a8a;
    --primary-dark: #6a1469;
    --primary-light: #a020a0;
    --secondary-color: #000000;
    --text-dark: #e0e0e0;
    --text-light: #b0b0b0;
    --bg-light: #000000;
    --bg-white: #1a1a1a;
    --bg-section: #000000;
    --border-color: #333333;
    --success-color: #4caf50;
    --error-color: #f44336;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.7);
    --navbar-bg: #000000;
    --footer-bg: #000000;
    --card-bg: #1a1a1a;
}

/* Set dark mode as default */
html {
    color-scheme: dark;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Default to dark mode */
html:not([data-theme="light"]) {
    color-scheme: dark;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--navbar-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: background-color 0.3s ease;
}

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

.logo a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-img {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
    /* Logo has white background, display as-is in both themes */
    filter: none;
    border-radius: 8px;
    overflow: hidden;
}

.logo-img:hover {
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.logo-th {
    color: var(--text-light);
    font-weight: 400;
}

/* Language Toggle Button */
.lang-toggle {
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    width: 50px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dark);
    padding: 0;
    font-weight: 600;
    font-size: 0.9rem;
}

.lang-toggle:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.lang-text {
    user-select: none;
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dark);
    padding: 0;
}

.theme-toggle:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    transform: rotate(15deg);
}

.theme-icon {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

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

.nav-menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    transition: all 0.3s ease;
}

.nav-menu {
    align-items: center;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #881a8a 0%, #6a1469 50%, #000000 100%);
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

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

.hero-buttons .btn-secondary {
    color: white;
    border-color: white;
}

.hero-buttons .btn-secondary:hover {
    background: white;
    color: var(--primary-color);
}

/* Section Styles */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Solutions Section */
.solutions {
    background: var(--bg-section);
    transition: background-color 0.3s ease;
}

.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.solution-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.solution-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.solution-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.solution-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.solution-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.solution-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.solution-link:hover {
    color: var(--primary-dark);
    margin-left: 5px;
}

/* About Section */
.about {
    background: var(--bg-white);
    transition: background-color 0.3s ease;
}

.about-text {
    max-width: 900px;
    margin: 0 auto;
}

.about-text h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Why Choose Section */
.why-choose {
    background: var(--bg-section);
    transition: background-color 0.3s ease;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.feature-item p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Contact Section */
.contact {
    background: var(--bg-white);
    transition: background-color 0.3s ease;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    margin-top: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    gap: 1.5rem;
}

.contact-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.contact-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.contact-item p {
    color: var(--text-light);
    line-height: 1.7;
}

.contact-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Contact Form */
.contact-form-wrapper {
    background: var(--bg-section);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 5px;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: var(--success-color);
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background: #f8d7da;
    color: var(--error-color);
    border: 1px solid #f5c6cb;
    display: block;
}

/* Slack Chat Widget */
.slack-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.slack-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.slack-chat-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.slack-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--bg-white);
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.slack-chat-window.active {
    display: flex;
}

.slack-chat-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slack-chat-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

.slack-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

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

.slack-chat-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.slack-chat-message-wrapper {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: flex-end;
}

.slack-chat-bot-wrapper {
    justify-content: flex-start;
}

.slack-chat-user-wrapper {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.slack-chat-avatar-container {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    position: relative;
}

.slack-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: var(--bg-light);
}

.slack-chat-avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid var(--border-color);
}

.slack-chat-user-avatar {
    background: var(--primary-color);
    border-color: var(--primary-dark);
}

.slack-chat-message {
    padding: 0.75rem;
    border-radius: 8px;
    max-width: 75%;
    word-wrap: break-word;
}

.slack-chat-sender {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.8;
    color: var(--text-light);
}

.slack-chat-bot {
    background: var(--bg-light);
    align-self: flex-start;
}

.slack-chat-user {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
}

/* Chat Form (shown before first message) */
.slack-chat-form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.slack-chat-form p {
    margin: 0 0 0.5rem 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.slack-chat-form-input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.9rem;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.slack-chat-form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.slack-chat-form-submit {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
    margin-top: 0.5rem;
}

.slack-chat-form-submit:hover {
    background: var(--primary-dark);
}

.slack-chat-input-wrapper {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    gap: 0.5rem;
}

.slack-chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.9rem;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.slack-chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.slack-chat-send {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.slack-chat-send:hover {
    background: var(--primary-dark);
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: white;
    padding: 3rem 0 1rem;
    transition: background-color 0.3s ease;
}

.footer-logo {
    height: 50px;
    width: auto;
    margin-bottom: 1rem;
    /* Logo has white background, display as-is on dark footer */
    filter: none;
    opacity: 0.95;
    border-radius: 8px;
    overflow: hidden;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-version {
    font-size: 0.75rem;
    opacity: 0.5;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background: var(--navbar-bg);
        width: 100%;
        padding: 2rem;
        box-shadow: var(--shadow);
        transition: left 0.3s ease, background-color 0.3s ease;
        gap: 1rem;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .logo-img {
        height: 35px;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .solutions-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Chat Widget Mobile - Full Screen */
    .slack-chat-widget {
        bottom: 10px;
        right: 10px;
    }

    .slack-chat-toggle {
        width: 56px;
        height: 56px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .slack-chat-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
        z-index: 10000;
        /* Use 100dvh (dynamic viewport height) for better mobile support */
        height: 100dvh;
        max-height: 100dvh;
        /* Prevent layout shift when keyboard appears */
        overflow: hidden;
        display: none !important; /* Hidden by default - use !important to override any inline styles */
        flex-direction: column;
    }
    
    .slack-chat-window.active {
        display: flex !important; /* Show when active */
    }

    .slack-chat-body {
        padding: 1rem 0.75rem;
        /* Account for mobile browser UI */
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
        /* Use flex to prevent overflow issues */
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        /* Prevent layout shift */
        -webkit-overflow-scrolling: touch;
    }

    .slack-chat-header {
        padding: 1rem;
        /* Account for mobile browser UI */
        padding-top: calc(1rem + env(safe-area-inset-top));
        /* Prevent header from moving */
        flex-shrink: 0;
    }

    .slack-chat-input-wrapper {
        padding: 0.75rem;
        /* Account for mobile browser UI */
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
        /* Prevent input from moving */
        flex-shrink: 0;
        /* Ensure input stays above keyboard */
        position: relative;
        z-index: 1;
    }

    .slack-chat-form {
        padding: 1.5rem 1rem;
        /* Account for mobile browser UI */
        padding-top: calc(1.5rem + env(safe-area-inset-top));
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
        /* Use flex to prevent overflow */
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .slack-chat-message {
        max-width: 85%;
        font-size: 0.95rem;
    }

    .slack-chat-input,
    .slack-chat-form-input {
        font-size: 16px; /* Prevents zoom on iOS when focusing */
        /* Prevent iOS from zooming on focus */
        -webkit-appearance: none;
        border-radius: 0;
    }

    .slack-chat-send,
    .slack-chat-form-submit {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Fix for iOS Safari keyboard issues */
    @supports (-webkit-touch-callout: none) {
        .slack-chat-window {
            /* Use visual viewport height on iOS */
            height: -webkit-fill-available;
        }
        
        /* Prevent body scroll when chat is open - only when chat window is active */
        body.chat-open .slack-chat-window.active {
            /* Chat window handles its own scrolling */
        }
        
        /* Ensure main content is still visible when chat is closed */
        body:not(.chat-open) {
            position: relative;
        }
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 80px 0 60px;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    section {
        padding: 60px 0;
    }

    .solution-card,
    .feature-item {
        padding: 1.5rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

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

.solution-card,
.feature-item {
    animation: fadeIn 0.6s ease-out;
}

