@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Roboto:wght@400;500&display=swap');

/* ========== VARIABLES Y BASE ========== */
:root {
    --cosmic-navy: #0F172A;
    --deepnova-blue: #0B1E3B;
    --supernova-violet: #7C3AED;
    --plasma-pink: #EC4899;
    --starlight-gray: #E5E7EB;
    --white: #FFFFFF;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Roboto', sans-serif;
    --container-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-secondary);
    background-color: var(--cosmic-navy);
    color: var(--starlight-gray);
    line-height: 1.7;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
}
img { max-width: 100%; height: auto; }
a { color: var(--supernova-violet); text-decoration: none; }
ul { list-style: none; }

/* ========== HEADER Y NAVEGACIÓN ========== */
.main-header {
    position: sticky; top: 0; left: 0; width: 100%; z-index: 1000;
    background-color: transparent;
    padding: 1rem 0;
    transition: background-color 0.4s ease, padding 0.4s ease;
}
.main-header.scrolled {
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.main-nav {
    display: flex; justify-content: space-between; align-items: center;
    max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem;
}
.nav-logo img { height: 45px; }
.nav-menu { display: flex; gap: 2.5rem; }
.nav-menu a { color: var(--starlight-gray); font-weight: 500; transition: color 0.3s; }
.nav-menu a:hover { color: var(--supernova-violet); }
.cta-button {
    padding: 0.7rem 1.8rem; border-radius: 8px; font-weight: 600;
    text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block; border: 2px solid transparent;
}
.cta-button.primary {
    background: linear-gradient(90deg, var(--supernova-violet), var(--plasma-pink));
    color: var(--white);
    border: none;
}
.cta-button.secondary {
    background-color: transparent;
    border: 2px solid var(--supernova-violet);
    color: var(--supernova-violet);
}
.cta-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}
.cta-button.secondary:hover {
    background-color: var(--supernova-violet);
    color: var(--white);
}
.hamburger { display: none; background: none; border: none; cursor: pointer; z-index: 1001; }
.hamburger .line { display: block; width: 25px; height: 2px; background-color: var(--white); margin: 6px 0; transition: all 0.3s ease-in-out; }

/* ========== SECCIONES GENERALES ========== */
.content-section { padding: 6rem 1.5rem; }
.section-subtitle-center, .section-subtitle-left {
    color: var(--supernova-violet); font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase; margin-bottom: 1rem;
}
.section-subtitle-center { text-align: center; }
.section-title { font-size: 2.8rem; color: var(--white); text-align: center; margin-bottom: 3rem; line-height: 1.2; }
.section-title.left-align { text-align: left; }

/* ========== HERO SECTION ========== */
.hero-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    position: relative;
    background-image: url('assets/images/hero-background.jpg');
    background-size: cover;
    background-position: center center;
}

#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1; /* Particles on top of background image */
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.7); /* --cosmic-navy at 70% opacity */
    z-index: 2; /* Overlay on top of particles */
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 3; /* Content on top of everything */
}
.hero-subtitle { color: var(--supernova-violet); font-weight: 600; margin-bottom: 1rem; }
.hero-title { font-size: 4rem; margin-bottom: 1.5rem; color: var(--white); }
.hero-description { font-size: 1.1rem; color: var(--starlight-gray); margin-bottom: 2.5rem; max-width: 600px; margin-left: auto; margin-right: auto;}
.hero-buttons { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ========== METRICS & CLIENTS ========== */
.metrics-section, .clients-section { padding: 4rem 1.5rem; background-color: var(--deepnova-blue); }
.metrics-section { display: flex; justify-content: space-around; max-width: 1000px; margin: 0 auto; flex-wrap: wrap; gap: 2rem; }
.metric-item { text-align: center; }
.metric-number { font-size: 3rem; font-weight: 700; color: var(--white); }
.clients-section { text-align: center; }
.clients-carousel { overflow: hidden; position: relative; width: 100%; }
.clients-track { display: inline-flex; width: calc(150px * 12); animation: scroll 30s linear infinite; }
.client-logo { height: 40px; margin: 0 40px; filter: grayscale(1) brightness(2); }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(calc(-150px * 6)); } }

/* ========== SERVICES ========== */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; max-width: var(--container-width); margin: 0 auto; }
.service-card {
    background-color: var(--deepnova-blue); padding: 2.5rem 2rem; border-radius: 12px;
    border: 1px solid transparent; transition: all 0.3s ease;
}
.service-card.highlight, .service-card:hover {
    transform: translateY(-10px); border-color: var(--supernova-violet);
    background: linear-gradient(180deg, var(--deepnova-blue), var(--cosmic-navy));
}
.service-card h3 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--white); }
.read-more { color: var(--supernova-violet); font-weight: 600; }

/* ========== ABOUT & WHY CHOOSE US ========== */
.about-content, .why-choose-us-content { display: flex; align-items: center; gap: 4rem; max-width: var(--container-width); margin: 0 auto; }
.about-text, .why-choose-us-text { flex: 1; }
.about-image, .why-choose-us-image { flex: 1; height: 400px; background-color: var(--deepnova-blue); border-radius: 12px; } /* Placeholder */
#seo-section .about-image img { object-fit: contain; width: 100%; height: 100%; border-radius: 12px; }
.about-text ul { margin: 1.5rem 0; }
.about-text ul li { margin-bottom: 1rem; display: flex; align-items: center; }
.check-icon { color: var(--supernova-violet); margin-right: 0.5rem; font-weight: bold; }
.reasons-list { list-style: none; margin-top: 2rem; }
.reasons-list li { margin-bottom: 1.5rem; padding-left: 2.5rem; position: relative; }
.reasons-list li::before {
    content: '0' counter(list-item); counter-increment: list-item;
    position: absolute; left: 0; top: 0; color: var(--supernova-violet);
    font-weight: 700; font-size: 1.2rem;
}
.reasons-list h3 { color: var(--white); margin-bottom: 0.5rem; }

/* ========== PORTFOLIO ========== */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 1.5rem; max-width: var(--container-width); margin: 0 auto; }
.portfolio-item { position: relative; overflow: hidden; border-radius: 12px; }
.portfolio-item img { display: block; width: 100%; transition: transform 0.5s ease; }
.portfolio-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(0deg, rgba(124, 58, 237, 0.8) 0%, rgba(15, 23, 42, 0.1) 100%);
    display: flex; justify-content: space-between; align-items: flex-end;
    padding: 1.5rem; opacity: 0; transition: opacity 0.5s ease;
}
.portfolio-item:hover .portfolio-overlay { opacity: 1; }
.portfolio-item:hover img { transform: scale(1.1); }
.portfolio-text h4 { color: var(--white); margin-bottom: 0.2rem; }
.portfolio-text p { color: var(--starlight-gray); font-size: 0.9rem; }
.portfolio-link {
    background-color: var(--white); color: var(--supernova-violet);
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}

/* ========== PRICING ========== */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; max-width: var(--container-width); margin: 0 auto; align-items: center; }
.pricing-card {
    background-color: var(--deepnova-blue); padding: 2.5rem; border-radius: 12px;
    border: 1px solid var(--deepnova-blue); text-align: center;
}
.pricing-card.popular { transform: scale(1.05); border-color: var(--supernova-violet); position: relative; overflow: hidden; }
.popular-badge {
    position: absolute; top: 15px; right: -30px;
    background-color: var(--supernova-violet); color: var(--white);
    padding: 0.3rem 3rem; transform: rotate(45deg); font-size: 0.8rem; font-weight: 600;
}
.price { font-size: 3.5rem; font-weight: 700; color: var(--white); margin: 1rem 0 0.5rem; }
.price span { font-size: 1.5rem; vertical-align: super; }
.price-desc { margin-bottom: 2rem; }
.pricing-card ul { text-align: left; margin-bottom: 2rem; }
.pricing-card ul li { margin-bottom: 1rem; }

/* ========== FOOTER ========== */
.main-footer { background-color: var(--deepnova-blue); padding: 5rem 1.5rem 2rem; }
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem; max-width: var(--container-width); margin: 0 auto; margin-bottom: 4rem;
}
.footer-logo { height: 40px; margin-bottom: 1rem; }
.footer-col h4 { font-size: 1.2rem; margin-bottom: 1.5rem; color: var(--white); }
.footer-col ul li { margin-bottom: 1rem; }
.footer-col ul a { color: var(--starlight-gray); }
.newsletter-form { display: flex; }
.newsletter-form input {
    flex-grow: 1; background: var(--cosmic-navy); border: 1px solid #334155;
    padding: 0.8rem; border-radius: 8px 0 0 8px; color: var(--white);
}
.newsletter-form button {
    background: var(--supernova-violet); border: none; padding: 0 1.2rem;
    color: var(--white); font-size: 1.5rem; border-radius: 0 8px 8px 0; cursor: pointer;
}

/* Contact Form Styles */
.contact-form .form-group { margin-bottom: 1rem; }
.contact-form input, .contact-form textarea {
    width: 100%;
    background: var(--cosmic-navy);
    border: 1px solid #334155;
    padding: 0.8rem;
    border-radius: 8px;
    color: var(--white);
    font-family: var(--font-secondary);
}
.contact-form textarea { resize: vertical; }
.contact-form .full-width { width: 100%; }
.form-status { margin-top: 1rem; font-weight: 500; }
.form-status.success { color: #34D399; }
.form-status.error { color: #F87171; }

.footer-bottom { text-align: center; border-top: 1px solid #334155; padding-top: 2rem; }

/* ========== CHAT BUBBLE & WINDOW ========== */
.chat-bubble {
    position: fixed; bottom: 2rem; right: 2rem;
    width: 60px; height: 60px; background: var(--supernova-violet);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; color: var(--white); cursor: pointer; z-index: 1000;
    transition: transform 0.3s ease;
}
.chat-bubble:hover { transform: scale(1.1); }

.chat-window {
    position: fixed; bottom: 6rem; right: 2rem;
    width: 350px; max-width: 90%;
    background-color: var(--deepnova-blue);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex; flex-direction: column;
    overflow: hidden;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}
.chat-window.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.chat-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem; background-color: var(--cosmic-navy);
    color: var(--white);
}
.chat-header h3 { font-size: 1.1rem; }
.chat-close { background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; }

.chat-body { flex-grow: 1; padding: 1rem; overflow-y: auto; height: 300px; }
.chat-message { margin-bottom: 1rem; display: flex; }
.chat-message.bot p {
    background-color: var(--cosmic-navy);
    padding: 0.8rem; border-radius: 10px 10px 10px 0;
    max-width: 80%;
}
.chat-message.user { justify-content: flex-end; }
.chat-message.user p {
    background-color: var(--supernova-violet);
    color: var(--white);
    padding: 0.8rem; border-radius: 10px 10px 0 10px;
    max-width: 80%;
}

.chat-suggestions {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chat-suggestions button {
    background-color: var(--cosmic-navy);
    color: var(--starlight-gray);
    border: 1px solid var(--supernova-violet);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.chat-suggestions button:hover {
    background-color: var(--supernova-violet);
    color: var(--white);
}

.chat-footer {
    display: flex; padding: 1rem;
    border-top: 1px solid var(--cosmic-navy);
}
.chat-footer input {
    flex-grow: 1; border: none; background: var(--cosmic-navy);
    padding: 0.8rem; border-radius: 8px; color: var(--white);
}
.chat-footer button {
    background: var(--supernova-violet); border: none;
    color: var(--white); font-size: 1.5rem;
    width: 45px; height: 45px;
    border-radius: 8px; margin-left: 0.5rem; cursor: pointer;
}

/* ========== SERVICE DETAIL PAGE ========== */
.service-detail-header { text-align: center; padding: 8rem 1.5rem 4rem; background: var(--deepnova-blue); }
.service-detail-header h1 { font-size: 3.5rem; }
.service-detail-layout { display: flex; gap: 3rem; max-width: var(--container-width); margin: 0 auto; }
.service-main-text { flex: 3; }
.service-sidebar { flex: 1; }
.service-sidebar h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.service-sidebar ul li { margin-bottom: 1rem; }
.sidebar-cta { background: var(--deepnova-blue); padding: 2rem; border-radius: 12px; margin-top: 2rem; }

/* Portfolio Project Detail Enhancements */
.project-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}
.detail-item {
    background-color: var(--deepnova-blue);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--supernova-violet);
}
.detail-item h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--white);
}
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}
.tech-tag {
    background-color: var(--deepnova-blue);
    color: var(--starlight-gray);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}
.back-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--supernova-violet);
    text-decoration: none;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--white);
}



/* ========== ANIMATIONS & RESPONSIVE ========== */
@media (max-width: 992px) {
    .about-content, .why-choose-us-content { flex-direction: column; }
    .why-choose-us-content .why-choose-us-image { order: -1; }
}
@media (max-width: 768px) {
    .nav-menu {
        position: fixed; top: 0; right: -100%; width: 70%; height: 100vh;
        flex-direction: column; justify-content: center; align-items: center;
        background: var(--deepnova-blue); transition: right 0.5s ease-in-out;
    }
    .nav-menu.active { right: 0; }
    .nav-cta { display: none; }
    .hamburger { display: block; }
    .hero-title { font-size: 2.5rem; }
}