/* ===== CSS Variables ===== */
:root {
    --primary-red: #D32F2F;
    --primary-red-hover: #b71c1c;
    --secondary-red: #ffcdd2;
    --white: #ffffff;
    --light-bg: #f9f9f9;
    --dark-text: #2c3e50;
    --light-text: #7f8c8d;
    --border-color: #eaeaea;
    --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(211, 47, 47, 0.15);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ===== Global Reset & Typography ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

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

.section {
    padding: 6rem 0;
}

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

h1,
h2,
h3,
h4 {
    color: var(--dark-text);
    font-weight: 800;
    line-height: 1.2;
}

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

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

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-red);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-red-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ===== Header & Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

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

.logo img {
    height: 85px;
    object-fit: contain;
    transition: var(--transition);
}

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

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

.nav-links a {
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    padding-bottom: 0.25rem;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

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

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

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--dark-text);
    transition: var(--transition);
}

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

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

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

/* ===== Hero Section ===== */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, var(--secondary-red) 100%);
    overflow: hidden;
}

/* Abstract Background Pattern */
.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(211, 47, 47, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: 4.5rem;
    color: var(--dark-text);
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero .motto {
    font-size: 1.5rem;
    color: var(--primary-red);
    font-weight: 600;
    margin-bottom: 2.5rem;
}

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

.divider {
    width: 60px;
    height: 4px;
    background-color: var(--primary-red);
    margin: 0 auto;
    border-radius: 2px;
}

/* ===== About Section ===== */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
    color: var(--light-text);
}

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

.highlight-box {
    background-color: var(--secondary-red);
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
    border-left: 5px solid var(--primary-red);
}

.highlight-box p {
    color: var(--primary-red-hover);
    font-weight: 600;
    margin: 0;
    font-size: 1.2rem;
}

/* ===== Services Section ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-red);
}

.service-card .icon {
    width: 70px;
    height: 70px;
    background-color: var(--secondary-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary-red);
    transition: var(--transition);
}

.service-card:hover .icon {
    background-color: var(--primary-red);
    color: var(--white);
    transform: scale(1.1) rotate(5deg);
}

.service-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* ===== Contact Section ===== */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    background-color: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

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

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.icon-circle {
    width: 50px;
    height: 50px;
    background-color: var(--secondary-red);
    color: var(--primary-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.info-item p {
    color: var(--light-text);
}

.info-item a:hover {
    color: var(--primary-red);
}

.map-container {
    min-height: 400px;
}

/* ===== Footer ===== */
footer {
    background-color: var(--dark-text);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo img {
    height: 40px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

footer p {
    color: #95a5a6;
    font-size: 0.9rem;
}

/* ===== Animations ===== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.2s;
}

.delay-2 {
    transition-delay: 0.4s;
}

.delay-3 {
    transition-delay: 0.6s;
}

/* ===== Media Queries ===== */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 3.5rem;
    }

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

    .map-container {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        gap: 0;
        text-align: center;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.05);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s ease-in-out;
    }

    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .nav-links li {
        padding: 1.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .hero .motto {
        font-size: 1.2rem;
    }

    .section {
        padding: 4rem 0;
    }

    .contact-info {
        padding: 2rem;
    }
}

/* ===== Chatbot Widget ===== */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

.chat-bubble {
    width: 60px;
    height: 60px;
    background-color: var(--primary-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-bubble:hover {
    transform: scale(1.1);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-window.hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

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

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

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.chat-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: #f5f7f9;
}

/* Custom Scrollbar for Chat Messages */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red);
}

.message {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Markdown typography refinements inside chat bubbles */
.message p {
    margin-bottom: 0.5rem;
}

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

.message ul,
.message ol {
    margin-left: 1.2rem;
    margin-bottom: 0.5rem;
}

.message ul:last-child,
.message ol:last-child {
    margin-bottom: 0;
}

.message li {
    margin-bottom: 0.25rem;
}

.message code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.85em;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.bot-message a {
    color: var(--primary-red);
    text-decoration: underline;
}

.bot-message a:hover {
    color: var(--primary-red-hover);
}

.bot-message {
    background-color: white;
    color: var(--dark-text);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: var(--shadow-sm);
}

.user-message {
    background-color: var(--primary-red);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    box-shadow: var(--shadow-sm);
}

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

#chat-input {
    flex-grow: 1;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

#chat-input:focus {
    border-color: var(--primary-red);
}

#send-chat {
    background-color: var(--primary-red);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

#send-chat:hover {
    background-color: var(--primary-red-hover);
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .chat-window {
        position: fixed;
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}

/* ===== Typing Indicator ===== */
.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: var(--light-text);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}