/* Base Styles & Variables */
:root {
    --primary-color: #0071e3;
    --secondary-color: #86868b;
    --accent-color: #f5f5f7;
    --text-color: #1d1d1f;
    --light-text: #f5f5f7;
    --background-color: #ffffff;
    --card-background: #f5f5f7;
    --success-color: #4cd964;
    --error-color: #ff3b30;
    --border-radius: 12px;
    --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --whatsapp-green: #25D366;
    --whatsapp-light-green: #128C7E;
    --whatsapp-dark-green: #075E54;
    --whatsapp-bg: #E5DDD5;
    --whatsapp-bubble: #DCF8C6;
    --whatsapp-header: #075E54;
    --whatsapp-message: #ffffff;
    --whatsapp-check: #34B7F1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

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

a:hover {
    color: #005bbf;
}

ul {
    list-style: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

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

.btn-primary:hover {
    background-color: #005bbf;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 113, 227, 0.15);
}

.btn-secondary {
    background-color: rgba(0, 113, 227, 0.1);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: rgba(0, 113, 227, 0.2);
    transform: translateY(-2px);
}

/* WhatsApp Button styles moved to components/whatsapp-button.css */


.btn-full {
    width: 100%;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.logo-animation {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
}

.logo-animation span {
    color: var(--primary-color);
}

.loader-progress {
    width: 200px;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar {
    height: 100%;
    width: 0;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Header & Navigation */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.main-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span {
    color: var(--primary-color);
}

.main-nav ul {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
}

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

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

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

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
}

.mobile-menu-toggle span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: var(--text-color);
    border-radius: 2px;
    transition: 0.25s ease-in-out;
}

.mobile-menu-toggle span:nth-child(1) {
    top: 0;
}

.mobile-menu-toggle span:nth-child(2) {
    top: 10px;
}

.mobile-menu-toggle span:nth-child(3) {
    top: 20px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    top: 10px;
    transform: rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    top: 10px;
    transform: rotate(-45deg);
}

/* Language Selector */
.language-selector {
    position: relative;
}

.current-lang {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--nav-text);
    transition: color 0.3s ease;
}

.lang-icon {
    font-size: 1.25rem;
    color: var(--nav-text);
}

nav .language-selector .language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--dropdown-bg);
    min-width: 160px;
    box-shadow: var(--dropdown-shadow);
    border-radius: var(--border-radius);
    padding: 0.5rem 0;
    z-index: 10;
    display: none;
    margin: 0;
    flex-direction: column;
}

nav .language-selector .language-dropdown.active {
    display: flex;
}

nav .language-selector .language-dropdown li {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex !important;
    align-items: center;
    width: 100%;
    float: none;
    margin: 0;
    gap: 0.5rem;
    color: var(--dropdown-text);
}

nav .language-selector .language-dropdown li:hover {
    background-color: var(--dropdown-hover);
    color: var(--primary-color);
}

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

/* Hero Section */
.hero {
    padding: 160px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, var(--text-color) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-bottom: 2.5rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
}

.hero-image {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.device-mockup {
    position: relative;
    width: 320px;
    max-width: 100%;
    border-radius: 2.5rem;
    background-color: #1d1d1f;
    padding: 0.75rem;
    box-shadow: 
        0 50px 100px rgba(0, 0, 0, 0.15),
        0 30px 60px rgba(0, 0, 0, 0.18),
        0 15px 35px rgba(0, 0, 0, 0.15);
    transform: perspective(800px) rotateY(-15deg) rotateX(10deg);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.device-mockup:hover {
    transform: perspective(800px) rotateY(-5deg) rotateX(5deg);
}

.device-mockup::before {
    content: '';
    position: absolute;
    width: 30%;
    height: 1.5rem;
    background-color: #1d1d1f;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    z-index: 10;
}

.device-screen {
    border-radius: 2rem;
    overflow: hidden;
    background-color: var(--whatsapp-bg);
    aspect-ratio: 9/19;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chat-animation.whatsapp-style {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--whatsapp-bg);
    font-size: 0.9rem;
    position: relative;
    /* Prevent theme transitions from affecting WhatsApp chat */
    transition: none !important;
}

/* Status bar to accommodate the notch */
.chat-animation.whatsapp-style::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.5rem; /* Same height as the notch */
    background-color: var(--whatsapp-dark-green);
    z-index: 5;
}

.chat-header {
    background-color: var(--whatsapp-light-green);
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 5;
    margin-top: 1.5rem; /* Add margin to position below the status bar */
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--whatsapp-dark-green);
}

.chat-contact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bot-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-contact-info {
    display: flex;
    flex-direction: column;
}

.contact-name {
    font-weight: 600;
    font-size: 1rem;
}

.contact-status {
    font-size: 0.8rem;
    opacity: 0.8;
}

.chat-header-controls {
    display: flex;
    gap: 1.5rem;
}

.chat-messages {
    flex: 1;
    padding: 0.75rem 0.75rem 1rem;
    overflow-y: scroll !important; /* Changed to scroll from auto */
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background-color: var(--whatsapp-bg);
    background-position: center;
    height: 370px !important; /* Increased height to better fit device mockup */
    max-height: 100% !important;
    min-height: 370px !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    scroll-behavior: auto; /* Changed from smooth for immediate scrolling */
    -webkit-overflow-scrolling: touch;
    position: relative; /* Enable positioning context */
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border-radius: 3px;
}

.chat-message {
    max-width: 75%;
    padding: 0.5rem 0.75rem 0.2rem;
    border-radius: 0.75rem;
    position: relative;
    animation-duration: 0.3s;
    animation-fill-mode: both;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    font-size: 0.95rem;
    line-height: 1.4;
}

.chat-message p {
    margin-bottom: 0.25rem;
    white-space: pre-wrap;
}

/* Bubble tails for WhatsApp style */
.chat-message.incoming::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-top: 8px solid var(--whatsapp-message);
    border-right: 8px solid var(--whatsapp-message);
    border-radius: 0;
}

.chat-message.outgoing::before {
    content: '';
    position: absolute;
    top: 0;
    right: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-top: 8px solid var(--whatsapp-bubble);
    border-left: 8px solid var(--whatsapp-bubble);
    border-radius: 0;
}

.chat-message.incoming {
    align-self: flex-start;
    background-color: var(--whatsapp-message);
    color: var(--whatsapp-message-text);
    border-top-left-radius: 0;
    animation-name: slideInLeft;
    margin-right: 40px;
}

.chat-message.outgoing {
    align-self: flex-end;
    background-color: var(--whatsapp-bubble);
    color: var(--whatsapp-message-text);
    border-top-right-radius: 0;
    animation-name: slideInRight;
    margin-left: 40px;
}

.message-time {
    font-size: 0.65rem;
    color: var(--whatsapp-time);
    margin-top: 0.1rem;
    text-align: right;
    float: right;
    margin-left: 0.4rem;
}

.message-status {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    color: var(--whatsapp-check);
    float: right;
    margin-top: 0.15rem;
}

.chat-message.hidden {
    display: none;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--whatsapp-message);
    border-radius: 0.75rem;
    width: fit-content;
    border-top-left-radius: 0;
    margin-bottom: 0;
    position: relative;
}

.typing-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-top: 8px solid var(--whatsapp-message);
    border-right: 8px solid var(--whatsapp-message);
    border-radius: 0;
    transition: none !important;
}

.typing-indicator span {
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--whatsapp-time);
    border-radius: 50%;
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out both;
    opacity: 0.7;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

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

@keyframes slideInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* WhatsApp chat input area */
.chat-input-area {
    padding: 10px;
    background-color: #f0f0f0;
    border-bottom-left-radius: 1.5rem;
    border-bottom-right-radius: 1.5rem;
}

.chat-input-container {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 24px;
    padding: 8px 12px;
}

.chat-input-emoji {
    margin-right: 10px;
    cursor: pointer;
}

.chat-input-field {
    flex: 1;
}

.chat-input-field input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    color: #333;
    background-color: transparent;
}

.chat-input-field input::placeholder {
    color: #999;
}

.chat-input-voice {
    margin-left: 10px;
    cursor: pointer;
}

.hero-shape {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1;
    line-height: 0;
}

.hero-shape svg {
    width: 100%;
    height: 100px;
}

/* Media Queries */
@media (max-width: 1024px) {
    .hero {
        padding: 120px 0 60px;
    }

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

    .hero .container {
        gap: 2rem;
    }

    .device-mockup {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-content {
        order: 1;
    }

    .hero-image {
        margin: 0 auto;
        width: 100%;
        max-width: 380px;
    }

    .hero-cta {
        justify-content: center;
    }

    .device-mockup {
        width: 300px;
        transform: perspective(800px) rotateY(0deg) rotateX(0deg);
    }
}

@media (max-width: 480px) {
    .device-mockup {
        width: 280px;
    }
}
