/* Base & Reset */
:root {
    --primary-color: #4db6ac;
    --primary-dark: #00897b;
    --secondary-color: #263238;
    --text-color: #37474f;
    --text-light: #78909c;
    --bg-light: #f5f7fa;
    --bg-dark: #1f2933;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.15);
    --font-main: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

html {
    scroll-padding-top: 100px;
    /* Space for sticky navbar */
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5 {
    color: var(--secondary-color);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.text-center {
    text-align: center;
}

.section {
    padding: 2.5rem 0;
    /* Reduced from 4rem */
    overflow: hidden;
    /* For animations */
}

/* Reduce gap between Process and Testimonials */
#spolupraca {
    padding-bottom: 0;
}

#referencie {
    padding-top: 2.5rem;
    /* Standard, but explicit */
}

.bg-light {
    background-color: var(--bg-light);
}

.bg-dark {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: var(--transition);
    background: transparent;
}

.navbar.navbar-hidden {
    transform: translateY(-100%);
}

.navbar.scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    padding: 0.8rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 45px;
    width: auto;
    transition: var(--transition);
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--white);
    position: relative;
    font-size: 1.05rem;
    padding-bottom: 5px;
}

.navbar.scrolled .nav-link {
    color: var(--secondary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white) !important;
    padding: 0.7rem 1.8rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(77, 182, 172, 0.4);
}

.btn-primary:hover {
    background: var(--white);
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

.menu-toggle {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--white);
    transition: var(--transition);
}

.navbar.scrolled .bar {
    background-color: var(--secondary-color);
}

/* Hero Section */
.hero {
    position: relative;
    height: 92vh;
    /* Reduced from 100vh */
    min-height: 600px;
    display: flex;
    align-items: center;
    color: var(--white);
    margin-top: -80px;
    padding-top: 80px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

#rainCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.4;
    /* Subtle effect */
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
    /* Slightly zoomed for parallax possibility */
}

.hero-bg .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2));
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 800px;
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    color: var(--white);
    line-height: 1.1;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.highlight {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    opacity: 0.9;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--secondary-color);
}

.pulse-btn {
    background: var(--primary-color);
    color: var(--white);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(77, 182, 172, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(77, 182, 172, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(77, 182, 172, 0);
    }
}

/* Stats Section */
.stats-section {
    background: var(--white);
    padding: 3rem 0;
    margin-top: -3rem;
    /* Overlap hero */
    position: relative;
    z-index: 10;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
    text-align: center;
}

.stat-item .number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-item .label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Feature Rows & About */
.section-header {
    margin-bottom: 2rem;
    /* Reduced from 3rem */
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

.divider {
    height: 4px;
    width: 60px;
    background: var(--primary-color);
    margin: 0 auto 1.5rem;
    border-radius: 2px;
}

.feature-row {
    display: flex;
    align-items: center;
    gap: 4rem;
    /* Also reduced gap slightly */
    margin-bottom: 3rem;
    /* Reduced from 4rem */
}

.feature-row.reverse {
    flex-direction: row-reverse;
}

.col-text {
    flex: 1;
}

.col-image {
    flex: 1;
    perspective: 1000px;
}

.col-text h3 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
}

.col-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.check-list li {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.check-list i {
    color: var(--primary-color);
    background: rgba(77, 182, 172, 0.1);
    padding: 8px;
    border-radius: 50%;
    font-size: 0.9rem;
}

/* 3D Card Effect */
.card-3d {
    transition: transform 0.5s ease;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg);
}

/* Systems Grid */
.systems-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

@media (max-width: 768px) {
    .systems-grid {
        grid-template-columns: 1fr;
    }
}

.system-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}

.system-card:hover {
    transform: translateY(-15px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    height: 250px;
    position: relative;
    overflow: hidden;
}

.card-image img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.system-card:hover .card-image img {
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-content {
    padding: 2.5rem;
}

.card-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.card-content ul {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.card-content ul li {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
}

.card-content ul li i {
    width: 24px;
    text-align: center;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Contact Dark Section */
#contact {
    color: var(--white);
}

#contact h2 {
    color: var(--white);
}

.subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

/* Contact Dark Section */
#contact {
    color: var(--white);
    position: relative;
    overflow: hidden;
    padding-top: 4rem;
    /* Ensure space top */
}

.contact-container-relative {
    position: relative;
}

.contact-worker-img {
    position: absolute;
    bottom: -20px;
    left: 8%;
    height: 380px;
    /* Further reduced */
    width: auto;
    z-index: 1;
    pointer-events: none;
    /* Transparent PNG doesn't need masking */
}

/* Adjust wrapper z-index to stay above worker */
.contact-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

@media (min-width: 992px) {
    .contact-wrapper {
        flex-direction: row;
        align-items: flex-start;
    }

    .contact-info {
        flex: 1;
        padding-top: 2rem;
    }

    /* Push form to right, worker is on left/center peek */
    .contact-form-wrapper {
        flex: 1.2;
        margin-top: 2rem;
        /* Optically align with left text */
    }

    /* Adjust worker position for desktop */
    .contact-worker-img {
        left: 20%;
        /* Positioned in the gap/behind form */
        bottom: -20px;
        opacity: 1;
    }
}

@media (max-width: 992px) {
    .contact-worker-img {
        display: none;
        /* Hide on mobile/tablet as it might overlap text */
    }
}

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.testimonial-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.testimonial-card .stars {
    color: #f1c40f;
    /* Gold color */
    margin-bottom: 1.2rem;
    font-size: 1rem;
    letter-spacing: 2px;
}

.testimonial-card p {
    font-style: italic;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.testimonial-card h4 {
    color: var(--secondary-color);
    margin-bottom: 0.2rem;
    font-size: 1.1rem;
}

.testimonial-card .location {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.icon-circle {
    width: 40px;
    height: 40px;
    background: rgba(77, 182, 172, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.info-item h4 {
    color: var(--white);
    margin-bottom: 0.2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-item p,
.info-item a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.info-item a:hover {
    color: var(--primary-color);
}

.contact-info h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Big Form Styling */
.glass-form {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.glass-form h3 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 5px rgba(77, 182, 172, 0.2);
    transform: translateY(-2px);
}

.btn-glow {
    background: var(--primary-color);
    color: #fff;
    font-size: 1rem;
    padding: 1rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    border: none;
    transition: all 0.3s ease;
}

.btn-glow:hover {
    background: #00897b;
    /* Darker teal */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(77, 182, 172, 0.4);
}

@media (max-width: 768px) {
    .glass-form {
        padding: 1.5rem 1rem;
        /* Less padding to stretch inputs to sides */
    }
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    border-radius: 15px;
    overflow: hidden;
    height: 300px;
}

.gallery-item img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Footer */
/* Footer Redesign */
footer {
    background: #0f161b;
    padding: 6rem 0 0;
    font-size: 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-logo {
    height: 35px;
    /* Optimal size */
    margin-bottom: 2rem;
    opacity: 0.9;
}

.footer-col h4 {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.footer-col ul li {
    margin-bottom: 1.2rem;
}

.footer-col ul li a {
    color: #b0bec5;
    font-size: 1.1rem;
}

.social-links a {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
}

.footer-bottom {
    background: #0a0f12;
    padding: 2rem 0;
    margin-top: 0;
    text-align: center;
}

/* Responsive */
@media (max-width: 968px) {
    .feature-row {
        flex-direction: column;
        gap: 3rem;
    }

    .feature-row.reverse {
        flex-direction: column;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    /* Stats removed previously but kept query just in case */

    .contact-wrapper {
        flex-direction: column;
    }
}

@media (max-width: 992px) {
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        padding: 5rem 2rem 3rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        gap: 2rem;
        transform: translateY(-100%);
        /* Slide up */
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        border-bottom-left-radius: 30px;
        border-bottom-right-radius: 30px;
        z-index: 1000;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        color: var(--secondary-color);
        font-size: 1.3rem;
    }

    .menu-toggle {
        display: block;
        position: relative;
        z-index: 1001;
    }

    /* Animate Hamburger to X */
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
        background-color: var(--secondary-color);
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
        background-color: var(--secondary-color);
    }

    .hero {
        padding-top: 200px;
        /* Significantly more space */
        align-items: flex-start;
        /* Align to top instead of center to avoid overlap */
    }

    .hero h1 {
        font-size: 2.2rem;
        /* Smaller text */
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Google Reviews Autoscroll */
.testimonials-viewport {
    overflow: hidden;
    position: relative;
    width: 100%;
    /* Removed mask for full visibility */
    padding: 2rem 0;
}

.testimonials-track {
    display: flex;
    gap: 2rem;
    width: max-content;
    animation: scroll 60s linear infinite;
    /* Slower because track is longer */
    padding-left: 0;
}

/* Pause on hover */
.testimonials-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Google Card Design */
.google-card {
    flex: 0 0 270px;
    /* 270px * 4 + gaps fits in <1200px */
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Roboto', sans-serif;
    position: relative;
    transition: box-shadow 0.3s;
    text-align: center;
}

.google-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header-g {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 1rem;
    width: 100%;
}

.g-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 5px;
}

.g-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.g-name {
    font-weight: 700;
    font-size: 1rem;
    color: #202124;
    margin-bottom: 0;
}

.g-location {
    font-size: 0.8rem;
    color: #5f6368;
    margin-bottom: 3px;
}

.g-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #70757a;
}

.g-stars {
    color: #fbbc04;
    font-size: 0.8rem;
    display: flex;
    gap: 1px;
}

.g-text {
    font-size: 0.9rem;
    color: #3c4043;
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

/* Cleanup old classes if conflicts */
.testimonial-card,
.testimonials-grid {
    /* redefine above overrides */
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.testimonial-card p {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.testimonial-card .stars {
    color: #ffc107;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.testimonial-card .stars i {
    margin-right: 3px;
}

/* Tech Specs List Style */
.tech-specs {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.tech-specs li {
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
}

.tech-specs strong {
    font-weight: 600;
    color: var(--secondary-color);
    min-width: 90px;
}

.tech-specs i {
    width: 24px;
    text-align: center;
    color: var(--primary-color);
}

/* Process Section */
.process-section {
    margin-bottom: 6rem;
}

.process-steps {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.step-item {
    flex: 1;
    min-width: 200px;
    text-align: center;
    position: relative;
}

.step-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    position: relative;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(77, 182, 172, 0.4);
}

/* Connecting line */
.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 30px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #eee;
    z-index: 1;
}

.step-item h4 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.step-item p {
    color: var(--text-light);
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .step-item:not(:last-child)::after {
        display: none;
    }

    .process-steps {
        flex-direction: column;
        gap: 3rem;
    }
}

/* --- CHATBOT UTILITY CLASSES (Missing Bootstrap) --- */
.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.me-3 {
    margin-right: 1rem !important;
}

.w-100 {
    width: 100% !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

/* --- CHATBOT THEME CONFIGURATION --- */
:root {
    --chat-primary: #4db6ac;
    --chat-primary-gradient: linear-gradient(135deg, #4db6ac 0%, #00897b 100%);
    --chat-header-bg: linear-gradient(135deg, #4db6ac 0%, #00897b 100%);
    --chat-bot-bubble: #f5f7fa;
    --chat-text-on-primary: #ffffff;
    --chat-bg: #ffffff;
    --chat-body-bg: #ffffff;
}

/* --- CHATBOT STYLES --- */

.chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
    z-index: 10000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-toggle-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: wiggle 5s infinite;
}

/* Chat Tooltip (Bubble) */
.chat-tooltip {
    position: absolute;
    top: 50%;
    right: 85px;
    /* Position to the left of the 70px button */
    transform: translateY(-50%) translateX(-20px) scale(0.8);
    background: #ffffff;
    color: #333;
    padding: 12px 20px;
    border-radius: 20px 20px 0 20px;
    /* Rounded, except bottom-right pointing to icon */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.chat-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0) scale(1);
}

.chat-tooltip::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    /* Arrow on the right side */
    width: 15px;
    height: 15px;
    background: #ffffff;
    clip-path: polygon(0 0, 0% 100%, 100% 100%);
    /* Triangle corner */
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.05);
    /* Fake shadow */
    border-radius: 0 0 5px 0;
}

/* Visualizer Bars */
.visualizer {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.visualizer span {
    display: block;
    width: 3px;
    background: #fff;
    border-radius: 3px;
    animation: sound 0ms -800ms linear infinite alternate;
    height: 5px;
}

.chat-toggle:hover .visualizer span {
    animation-duration: 400ms;
}

.visualizer span:nth-child(1) {
    height: 10px;
    animation-delay: -500ms;
}

.visualizer span:nth-child(2) {
    height: 16px;
    animation-delay: -400ms;
}

.visualizer span:nth-child(3) {
    height: 20px;
    animation-delay: -300ms;
}

.visualizer span:nth-child(4) {
    height: 14px;
    animation-delay: -200ms;
}

.visualizer span:nth-child(5) {
    height: 10px;
    animation-delay: -100ms;
}

@keyframes sound {
    0% {
        height: 5px;
        opacity: 0.5;
    }

    100% {
        height: 20px;
        opacity: 1;
    }
}

/* Old Badge Removed/Hidden */
.notification-badge {
    display: none;
}

.ai-chatbot {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: var(--chat-bg);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 10001;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    background: var(--chat-header-bg);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 80px;
    /* Standard height */
    display: flex;
    align-items: center;
}

.bot-avatar {
    width: 55px;
    /* Balanced size */
    height: 55px;
    position: relative;
    background: transparent;
    margin-right: 15px !important;
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    /* Natural position */
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    /* Transform removed */
}

.status-dot {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 16px;
    /* Slightly larger */
    height: 16px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #ffffff;
    /* White border matches avatar border */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
    /* Ensure it stays on top */
}


.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--chat-body-bg);
    scroll-behavior: smooth;
}

.bot-message-wrapper {
    margin-bottom: 15px;
    max-width: 85%;
    align-self: flex-start;
}

.bot-message {
    background: #f1f5f9;
    color: #334155;
    padding: 12px 16px;
    border-radius: 15px 15px 15px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-msg-container {
    margin-bottom: 15px;
    max-width: 85%;
    align-self: flex-end;
    margin-left: auto;
    /* Push to right */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-message {
    background: var(--chat-primary);
    color: var(--chat-text-on-primary);
    padding: 12px 16px;
    border-radius: 15px 15px 0 15px;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.msg-time {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 5px;
    display: block;
}

/* Testimonials Avatars */
.testimonial-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 15px;
}

.testimonial-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.testimonial-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--dark-color);
    font-weight: 600;
}

.testimonial-header .location {
    font-size: 0.85rem;
    color: #666;
    display: block;
}

/* Override old header style inside card if any */
.testimonial-card h4 {
    margin: 0;
    /* Handled by header now, but keeping for safety */
}

.testimonial-card>h4 {
    display: none;
}

/* Hide old H4 if structure changed but CSS lingers */
.testimonial-card>.location {
    display: none;
}

/* Hide old location span */
.chat-footer {
    padding: 15px;
    background: #ffffff;
    border-top: 1px solid #eef0f5;
}

.chat-input {
    border-radius: 25px !important;
    padding-left: 20px;
    border: 2px solid #eef0f5;
    background: #f8f9fa;
    font-size: 0.95rem;
}

.chat-input:focus {
    box-shadow: none;
    outline: none;
    border-color: var(--chat-primary);
    background: #fff;
}

/* Bot Avatar Image Zoom - Reset is handled above in .bot-avatar img block */

/* Attention Animation */
@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    10%,
    30% {
        transform: rotate(-10deg) scale(1.1);
    }

    20%,
    40% {
        transform: rotate(10deg) scale(1.1);
    }

    50% {
        transform: rotate(0deg) scale(1);
    }
}




/* Chat Footer Layout */
.chat-footer-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.input-wrapper {
    flex: 1;
    /* Takes available space */
    position: relative;
    display: flex;
    align-items: center;
}

.chat-input {
    border-radius: 25px !important;
    padding-left: 20px;
    padding-right: 45px !important;
    /* Space for internal mic only */
    border: none;
    background: #f1f5f9;
    font-size: 0.95rem;
    height: 50px;
    width: 100%;
    transition: all 0.3s;
}

.chat-input:focus {
    background: #fff;
    box-shadow: 0 0 0 2px var(--chat-primary);
    outline: none;
}

/* Actions inside the input (Mic / Send) */
.input-internal-actions {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

/* 1. Dictation Mic (Small, Internal) */
.mic-icon {
    font-size: 1.1rem;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.mic-icon:hover {
    color: var(--secondary-color);
    background: rgba(0, 0, 0, 0.05);
}

/* 2. Voice Mode Button (Big Circle, External) */
.voice-mode-btn {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    /* Don't squash */
    background: var(--primary-color);
    /* Teal Background */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    /* Ignored by spans, but good logic */
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(77, 182, 172, 0.4);
    /* Colored shadow */
    border: none;
    transition: all 0.1s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Faster transition for press */
    user-select: none;
    /* Prevent selection on hold */
    -webkit-user-select: none;
    touch-action: manipulation;
    /* Improve touch handling */
}

.voice-mode-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.voice-mode-btn:active {
    transform: scale(0.95);
    /* Tactile press effect */
    background: var(--primary-dark);
    /* Darker teal on press */
    box-shadow: 0 2px 6px rgba(77, 182, 172, 0.4);
}

.voice-mode-active {
    background: var(--chat-primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(77, 182, 172, 0.2);
    animation: voice-pulse 2s infinite;
}

@keyframes voice-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.send-btn {
    color: var(--chat-primary);
    font-size: 1.2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Header Icons White */
.header-icons i {
    color: #ffffff !important;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.header-icons i:hover {
    opacity: 1;
}

.action-hidden {
    display: none !important;
}

/* Visualizer Animation (Radio Look) */
.visualizer-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 18px;
    /* Fit inside button */
}

.visualizer-bars span {
    display: block;
    width: 3px;
    background: white;
    /* White bars on Teal button */
    border-radius: 3px;
    animation: sound 0ms -800ms linear infinite alternate;
    height: 5px;
}

.voice-mode-btn:hover .visualizer-bars span {
    animation-duration: 400ms;
}

.visualizer-bars span:nth-child(1) {
    height: 10px;
    animation-delay: -500ms;
}

.visualizer-bars span:nth-child(2) {
    height: 16px;
    animation-delay: -400ms;
}

.visualizer-bars span:nth-child(3) {
    height: 20px;
    animation-delay: -300ms;
}

.visualizer-bars span:nth-child(4) {
    height: 14px;
    animation-delay: -200ms;
}

.visualizer-bars span:nth-child(5) {
    height: 10px;
    animation-delay: -100ms;
}

@keyframes sound {
    0% {
        height: 5px;
        opacity: 0.6;
    }

    100% {
        height: 20px;
        opacity: 1;
    }
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@media (max-width: 576px) {
    .ai-chatbot {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        z-index: 20000;
    }

    .chat-toggle {
        bottom: 20px;
        right: 20px;
    }
}