/* General Styles */
/* Font already linked in HTML */

body {
    font-family: 'Montserrat', sans-serif; /* Changed font */
    margin: 0;
    padding: 0;
    line-height: 1.7; /* Slightly increased line-height */
    color: #e0e0e0; /* Light grey text for night mode */
    background-color: #121212; /* Dark background for night mode */
}

.container {
    width: 85%; /* Slightly wider container */
    max-width: 1200px; /* Max width for larger screens */
    margin: auto;
    overflow: hidden;
    padding: 0 15px; /* Add some padding */
}

h1, h2, h3, h4, h5, h6 {
    color: #bb86fc; /* Light Purple for headings in night mode */
    font-weight: 600;
}

h2 { font-size: 2.8em; }
h3 { font-size: 2.2em; }

a {
    color: #bb86fc; /* Light Purple for links */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #d1c4e9; /* Lighter purple on hover */
}

ul {
    list-style: none;
    padding: 0;
}

/* Header */
header {
    background: #1f1f1f; /* Darker grey for header background */
    color: #e0e0e0; /* Light text */
    padding: 15px 0;
    min-height: 70px;
    border-bottom: #bb86fc 3px solid; /* Light purple border */
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); /* Adjusted shadow for dark theme */
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    display: flex;
    align-items: center;
}

header .logo h1 {
    color: #e0e0e0; /* Light text */
    margin: 0 0 0 15px;
    font-size: 30px;
    font-weight: 700;
}

header nav ul {
    margin: 0;
    padding: 0;
    display: flex;
}

header nav ul li {
    margin-left: 20px;
}

header nav ul li a {
    color: #e0e0e0; /* Light text */
    font-weight: 400;
    font-size: 17px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

header nav ul li a:hover,
header nav ul li a.active {
    background-color: rgba(187, 134, 252, 0.2); /* Light purple background on hover */
    color: #fff; /* White text on hover */
}

/* SVG Logo Styling */
.logo-svg {
    transition: transform 0.3s ease;
}

.logo-svg .logo-bg {
    fill: #bb86fc; /* Light purple background */
}

.logo-svg .logo-stroke {
    stroke: #121212; /* Dark background color for stroke */
}

.logo:hover .logo-svg {
    transform: rotate(15deg);
}


/* Hero Section */
#hero {
    background: linear-gradient(rgba(18, 18, 18, 0.85), rgba(18, 18, 18, 0.85)), url('placeholder.png') no-repeat center center/cover; /* Dark overlay */
    color: #fff; /* White text */
    min-height: 500px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px 20px;
}

#hero h2 {
    font-size: 3.5em;
    margin-bottom: 15px;
    color: #fff; /* White heading */
    font-weight: 700;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.5); /* Adjusted shadow */
}

#hero p {
    font-size: 1.4em;
    margin-bottom: 30px;
    max-width: 700px; /* Limit width */
    margin-left: auto; /* Center the block */
    margin-right: auto; /* Center the block */
    font-weight: 300;
    color: #e0e0e0; /* Light grey text */
    /* Text is already centered by #hero text-align: center, max-width + auto margins ensure block centering */
}

.cta-button {
    display: inline-block;
    background: #bb86fc; /* Light purple background */
    color: #121212; /* Dark text */
    padding: 15px 35px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.2em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* Adjusted shadow */
    border: 2px solid #bb86fc; /* Matching border */
}

.cta-button:hover {
    background-color: #3700b3; /* Darker purple on hover */
    color: #fff; /* White text on hover */
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    border-color: #3700b3;
}

/* Sections */
section {
    padding: 80px 0;
    border-bottom: 1px solid #333; /* Darker border for night mode */
}

section:last-of-type {
    border-bottom: none;
}

#sobre {
    background-color: #1e1e1e; /* Slightly lighter dark for Sobre */
}

#servicos {
     background-color: #121212; /* Main dark background for Servicos */
}

#n8n {
    background-color: #1f1f1f; /* Darker grey for n8n section */
    text-align: center; /* Center content including the button */
}

#chat-especialista {
    background-color: #1e1e1e; /* Slightly lighter dark for chat section */
}

#chat-especialista h3 {
    color: #bb86fc; /* Light purple heading */
}

#chat-box {
    background-color: #282828; /* Darker background for chat box */
    border-radius: 8px;
    padding: 20px;
    max-width: 900px; /* Increased max-width further */
    margin: 30px auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 450px; /* Increased max-height by 50% */
    margin-bottom: 15px;
    padding-right: 10px; /* Space for scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #bb86fc #3a3a3a;
    transition: scrollbar-color 0.3s ease;
}

#chat-messages.typing {
    scrollbar-color: #d1aaff #3a3a3a;
}

#chat-messages.typing::-webkit-scrollbar-thumb {
    background-color: #d1aaff;
}

/* Webkit scrollbar styles */
#chat-messages::-webkit-scrollbar {
    width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #3a3a3a;
    border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background-color: #bb86fc;
    border-radius: 4px;
    border: 2px solid #3a3a3a;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background-color: #d1aaff;
}

.message {
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background-color: #bb86fc; /* Light purple for user messages */
    color: #121212; /* Dark text */
    align-self: flex-end;
    margin-left: auto;
}

.bot-message {
    background-color: #3a3a3a; /* Dark grey for bot messages */
    color: #e0e0e0; /* Light text */
    align-self: flex-start;
    margin-right: auto;
}

#chat-input {
    display: flex;
    gap: 10px;
}

#user-message {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #555; /* Dark grey border */
    border-radius: 20px;
    background-color: #3a3a3a; /* Dark grey input background */
    color: #e0e0e0; /* Light text */
    font-size: 1em;
}

#user-message::placeholder {
    color: #bdbdbd; /* Medium grey placeholder text */
}

#send-button {
    background-color: #bb86fc; /* Light purple button */
    color: #121212; /* Dark text */
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

#send-button:hover {
    background-color: #3700b3; /* Darker purple on hover */
    color: #fff; /* White text on hover */
}

/* Typing Indicator Animation */
#typing-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 18px;
    background-color: #3a3a3a; /* Dark grey background */
    width: fit-content;
}

.dot {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: #e0e0e0; /* Light grey dots */
    border-radius: 50%;
    animation: typing 1.5s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 80%, 100% { transform: initial; }
    40% { transform: translateY(-5px); }
}


#n8n h3 {
    color: #bb86fc; /* Light purple heading */
}

#n8n p {
    color: #bdbdbd; /* Medium grey text */
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    /* text-align: center; Inherited from #n8n */
    margin-bottom: 30px;
}

/* n8n button inherits general .cta-button styles, override if needed */
/* Example: Different hover for n8n button */
 #n8n .cta-button:hover {
    background-color: #bb86fc;
    color: #121212;
    border-color: #bb86fc;
 }

section h3 {
    text-align: center;
    margin-bottom: 50px; /* Increased margin */
    font-size: 2.5em; /* Larger heading */
    position: relative;
    padding-bottom: 15px;
}

/* Underline effect for section headings */
section h3::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: #bb86fc; /* Light purple underline */
    border-radius: 2px;
}

#servicos ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

#servicos ul li {
    background: #1e1e1e; /* Dark background for service items */
    color: #e0e0e0; /* Light text */
    padding: 25px;
    margin-bottom: 0;
    border-left: none;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); /* Adjusted shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 5px solid #bb86fc; /* Light purple top border */
}

#servicos ul li:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.4); /* Darker shadow on hover */
}

/* Footer */
footer {
    background: #121212; /* Dark background */
    color: #757575; /* Dim grey text */
    text-align: center;
    padding: 30px 0;
    margin-top: 0;
    border-top: 1px solid #333; /* Add top border */
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }

    header nav ul {
        margin-top: 15px;
        justify-content: center;
    }

    header nav ul li {
        margin: 0 10px;
    }

    #hero h2 {
        font-size: 2.5em;
    }

    #hero p {
        font-size: 1.2em;
    }

    .container {
        width: 95%;
    }

    section h3 {
        font-size: 2em;
    }

    #servicos ul {
        grid-template-columns: 1fr; /* Stack services on smaller screens */
    }
}

@media (max-width: 768px) {
    #chat-box {
        max-width: 95%; /* Adjust max-width for smaller screens */
    }
}
