:root {
    /* Dark Mode (Default) */
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #bb86fc;
    --secondary-color: #03dac6;
    --text-color: #e0e0e0;
    --text-color-secondary: #a0a0a0;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
    --gradient-text: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

[data-theme="light"] {
    /* Light Mode */
    --background-color: #ffffff;
    --surface-color: #f8f9fa;
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --text-color: #333;
    --text-color-secondary: #555;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

header {
    background-color: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s ease;
}

[data-theme="light"] header {
    background-color: rgba(255, 255, 255, 0.85);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

nav ul li {
    margin-left: 30px;
}

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

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-text);
    transition: width 0.3s ease;
}

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

nav a:hover::after {
    width: 100%;
}

section {
    padding: 5rem 0;
    overflow: hidden;
    position: relative;
}

section:nth-child(even) {
    background-color: var(--surface-color);
}

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

h1 span {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 2.8rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4rem;
}

#inicio {
    text-align: center;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

#inicio .container {
    z-index: 1;
}

#inicio p {
    color: var(--text-color-secondary);
}

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

.card-servico {
    background-color: var(--surface-color);
    padding: 2.5rem;
    text-align: center;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-servico:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
}

.card-servico i {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-servico h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.card-servico p {
    color: var(--text-color-secondary);
}

.card-projeto {
    background-color: var(--surface-color);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-projeto:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
}

.card-projeto img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.card-projeto-content {
    padding: 1.5rem;
}

.card-projeto h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.card-projeto p {
    color: var(--text-color-secondary);
}

#contato {
    text-align: center;
}

#contato p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-color-secondary);
}

.social-links a {
    font-size: 2rem;
    margin: 0 15px;
    color: var(--text-color);
    transition: color 0.3s ease;
}

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

footer {
    text-align: center;
    padding: 2rem 0;
    background-color: var(--surface-color);
}

/* Theme Toggle */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}
.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}
.theme-switch input { display: none; }
.slider {
    background-color: #444;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
}
input:checked + .slider {
    background: var(--gradient-text);
}
input:checked + .slider:before {
    transform: translateX(24px);
}

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: var(--text-color);
    transition: all 0.3s ease-in-out;
}

/* Typing animation */
.typed-cursor {
    opacity: 1;
    animation: typedjsBlink 0.7s infinite;
}
@keyframes typedjsBlink {
    50% { opacity: 0.0; }
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px; /* Adjust based on header height */
        left: 0;
        width: 100%;
        background-color: var(--surface-color);
        box-shadow: var(--box-shadow);
        padding: 1rem 0;
    }

    nav ul.active {
        display: flex;
    }

    nav ul li {
        margin: 1rem 0;
        text-align: center;
    }

    .hamburger-menu {
        display: block;
        z-index: 1;
    }

    h1 {
        font-size: 2.8rem;
    }

    h2 {
        font-size: 2.2rem;
    }
}

/* Homepage Sections */
.home-section {
    padding: 5rem 0;
    text-align: center;
}

.home-section:nth-child(odd) {
    background-color: var(--surface-color);
}

.home-section h2 {
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 3rem;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.home-section p {
    max-width: 700px;
    margin: 0 auto 2rem auto;
    color: var(--text-color-secondary);
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--gradient-text);
    color: #fff;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Cards Container */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
    text-align: left;
}

.card {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent;
}

[data-theme="dark"] .card {
    background-color: #2a2a2a; /* Slightly lighter than surface for depth */
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

.card p {
    color: var(--text-color-secondary);
    font-size: 0.95rem;
}

.card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Tech Icons */
#tecnologias-home .tech-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2.5rem;
    margin-top: 3rem;
}

#tecnologias-home .tech-icons i {
    font-size: 4rem;
    color: var(--text-color-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
}

#tecnologias-home .tech-icons i:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

/* Call to Action Section */
#cta-home {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    padding: 6rem 0;
}

#cta-home h2 {
    color: #fff;
    background: none;
    -webkit-text-fill-color: unset;
}

#cta-home p {
    color: rgba(255, 255, 255, 0.9);
}

#cta-home .btn {
    background: #fff;
    color: var(--primary-color);
    box-shadow: none;
}

#cta-home .btn:hover {
    background: #fff;
    color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Servicos Page Layout */
.servicos-container {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.servicos-lista {
    flex: 2; /* Takes 2/3 of the space */
}

.chat-simulacao {
    flex: 1; /* Takes 1/3 of the space */
    position: sticky;
    top: 120px; /* Adjust based on header height */
    max-width: 400px;
    margin: 0 auto;
}

/* Chat Simulation Styles */
.chat-simulacao {
    background-color: var(--surface-color);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px; /* Fixed height */
}

[data-theme="dark"] .chat-simulacao {
    background-color: #2a2a2a;
}

.chat-header {
    background-color: #2c2c2c;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .chat-header {
    background-color: #f0f0f0;
    border-bottom: 1px solid #ddd;
}

.chat-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.chat-info .chat-name {
    font-weight: 600;
    color: var(--text-color);
}

.chat-info .chat-status {
    font-size: 0.8rem;
    color: #03dac6; /* Secondary color for 'online' */
}

.chat-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(to bottom, #1a1a1a, #2a2a2a); /* Dark gradient */
}

[data-theme="light"] .chat-body {
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0); /* Light gradient */
}

.chat-message {
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(15px);
    animation: slideIn 0.5s forwards;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-sent {
    background-color: #075e54;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

[data-theme="light"] .message-sent {
     background-color: #dcf8c6;
     color: #333;
}

.message-received {
    background-color: #333;
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

[data-theme="light"] .message-received {
    background-color: #fff;
    color: #333;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    animation: typing-bounce 1s infinite;
}

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

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

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

.chat-footer {
    padding: 10px 15px;
    background-color: #2c2c2c;
    display: flex;
    align-items: center;
    gap: 10px;
}

[data-theme="light"] .chat-footer {
    background-color: #f0f0f0;
}

.chat-footer input {
    flex-grow: 1;
    border: none;
    padding: 10px;
    border-radius: 20px;
    background-color: #444;
    color: var(--text-color);
    cursor: not-allowed;
}

[data-theme="light"] .chat-footer input {
    background-color: #fff;
    color: #333;
}

.chat-footer i {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

/* Responsive adjustments for services page */
@media (max-width: 992px) {
    .servicos-container {
        flex-direction: column;
    }
    .chat-simulacao {
        position: static;
        margin-top: 3rem;
        max-width: 100%;
    }
}

/* Auth Forms and Dashboard */
#auth-form {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 150px); /* Adjust based on header/footer height */
    padding: 2rem 0;
}

#auth-form h2 {
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.auth-card {
    background-color: var(--surface-color);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background-color: #333;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

[data-theme="light"] .form-group input[type="text"],
[data-theme="light"] .form-group input[type="email"],
[data-theme="light"] .form-group input[type="password"] {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    color: var(--text-color);
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    border-color: var(--primary-color);
    outline: none;
}

.auth-card .btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.auth-link {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-color-secondary);
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

.message {
    margin-top: 1.5rem;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.95rem;
    display: none; /* Hidden by default */
}

.message.success {
    background-color: #28a74530;
    color: #28a745;
    border: 1px solid #28a745;
}

.message.error {
    background-color: #dc354530;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.message.info {
    background-color: #007bff30;
    color: #007bff;
    border: 1px solid #007bff;
}

/* New Dashboard Layout Styles */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--surface-color);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
}

.sidebar .logo {
    margin-bottom: 3rem;
    text-align: center;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 1rem;
}

.sidebar-nav a {
    color: var(--text-color-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: background-color 0.3s, color 0.3s;
}

.sidebar-nav a i {
    margin-right: 1rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: var(--primary-color);
    color: #fff;
}

.main-content {
    flex-grow: 1;
    padding: 3rem;
    overflow-y: auto;
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
}

@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }
    .sidebar .logo {
        font-size: 1.2rem;
    }
    .sidebar-nav a span {
        display: none;
    }
    .sidebar-nav a i {
        margin-right: 0;
    }
}

/* Collapsible Sidebar Styles */
#sidebar-toggle-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 101;
    background: var(--surface-color);
    border: 1px solid #333;
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#sidebar-toggle-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.sidebar {
    transition: width 0.3s ease;
}

.main-content {
    position: relative;
    transition: margin-left 0.3s ease;
}

.dashboard-container.sidebar-collapsed .sidebar {
    width: 80px;
}

.dashboard-container.sidebar-collapsed .sidebar .logo {
    font-size: 1.5rem; /* Smaller logo */
}

.dashboard-container.sidebar-collapsed .sidebar-nav a span {
    display: none;
}

.dashboard-container.sidebar-collapsed .sidebar-nav a {
    justify-content: center;
}

.dashboard-container.sidebar-collapsed .sidebar-nav a i {
    margin-right: 0;
    font-size: 1.2rem;
}

.dashboard-container.sidebar-collapsed .main-content {
    margin-left: -170px; /* 250px - 80px */
}

/* Adjust toggle button position when sidebar is collapsed */
.dashboard-container.sidebar-collapsed #sidebar-toggle-btn {
    left: 100px; /* 80px sidebar width + 20px padding */
}
