:root {
    --primary-color: #ff0066;
    --secondary-color: #FFEDED;
    --text-color: #333;
    --background-color: #fff;
    --border-radius: 8px;
    --primary-font: 'Inter', sans-serif;
    --text-color-secondary: #4B5563;
    --text-color-title: #2E2E2E;
    --text-color-tertiary: #949494;
    --text-color-cta: #E5226D;
}

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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
    background-image: url('../img/bg.png');
    background-size: cover;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Contenedor principal con nuevo orden */

.container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex-grow: 1;
}

.divider {
    width: 100%;
    height: 2px;
    border-top: 2px solid;
    border-bottom: 2px solid;
    border-left: none;
    border-right: none;
    border-color: var(--primary-color);
    padding: 1px 0;
}

/* HEADER */

.pre-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 48px 0 56px 0;
}

.meta-info {
    display: flex;
    flex-shrink: 0;
    flex-direction: row;
    gap: 2px;
    font-family: var(--primary-font);
    font-size: 12px;
    color: var(--text-color-secondary);
    line-height: 18px;
    padding: 0 24px;
}

.meta-info--left {
    text-align: left;
}

.meta-info--right {
    text-align: right;
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
    padding: 0 24px;
    border-top: none;
    border-bottom: none;
}

.header h1 {
    color: var(--text-color-title);
    text-align: center;
    font-family: "Merriweather", serif;
    font-size: 5rem;
    font-weight: 700;
    line-height: 90px;
    letter-spacing: 5.04px;
    text-transform: uppercase;
    margin: 16px auto;
}

.header h2 {
    color: var(--text-color-title);
    text-align: center;
    font-family: "Inter", sans-serif;
    font-size: 32px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 1px;
}

.header-subtitle {
    width: 80%;
    margin: 0 auto;
    color: #1A1A1A;
    text-align: center;
    font-family: "Merriweather", serif;
    font-size: 14px;
    font-style: italic;
    font-weight: 400;
    line-height: 18px;
}

/* FEATURED IMAGE */

.featured-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    opacity: 1;
    max-height: 274px;
    overflow: hidden;
    margin: 56px auto;
    transition: all 0.5s ease-in-out;
}

.featured-image-container.hidden {
    max-height: 0;
    opacity: 0;
    margin: 28px auto;
    padding: 0;
}

.featured-image {
    background-color: var(--primary-color);
    width: 50%;
    height: 100%;
    transition: all 0.5s ease;
    object-fit: cover;
}

/* SEARCH INPUT */

.chat-input-container {
    width: 75%;
    margin: 0 auto 24px auto;
    display: flex;
    padding: 12px;
    align-items: flex-start;
    gap: 1rem;
    align-self: stretch;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.40);
    box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    border: 2px solid transparent;
}

.glowing-border input {
    outline: none !important;
}

.glowing-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #FCB400, #FE0065, #080CD0, #FE0065, #8C34C9);
    background-size: 500% 500%;
    z-index: -1;
    border-radius: 20px;
    filter: blur(20px);
    animation: gradientRotation 5s infinite;
}

@keyframes gradientRotation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%;}
    100% { background-position: 0% 50%; }
}

.chat-input-container input {
    flex: 1;
    padding: 16px;
    font-size: 16px;
    border: none;
    height: 48px;
    border-radius: 8px;
    border: var(--stroke-weight-1, 1px) solid var(--color-grey-91, #E5E7EB);
    background: var(--color-white-80, rgba(255, 255, 255, 0.90));
    color: var(--text-color);
    font-family: "Montserrat", sans-serif;
    font-style: normal;
    font-weight: 400;
    line-height: 16.8px;
    outline: #FE0065 solid 2px;
}

.chat-input-container input::placeholder {
    color: var(--text-color-tertiary);
}

.chat-input-container button {
    display: flex;
    height: 48px;
    padding: 12px 32px;
    justify-content: center;
    align-items: center;
    gap: var(--item-spacing-xs, 8px);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--Base-Base-White, #FAFAFA);
    text-align: center;
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 19.2px;
}

/* CHAT RESPONSES */

.chat-messages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: 16px;
    margin: 0 auto;
    padding: 0 24px;
    margin-bottom: 3rem;
}

.message-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.95);
    background-image: url("../img/papertwo.png");
    background-size: contain;
    background-repeat: repeat;
    filter: drop-shadow(.5px 1px 1px rgba(0, 0, 0, 0.025)) drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.025)) drop-shadow(2px 4px 4px rgba(0, 0, 0, 0.025)) drop-shadow(4px 8px 8px rgba(0, 0, 0, 0.025)) drop-shadow(8px 16px 16px rgba(0, 0, 0, 0.025));
    position: relative;
    max-height: 1000px;
    transition: all 0.5s ease;
}

.message-group.hidden {
    padding: 0;
    margin: 0;
    max-height: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    display: none;
}

/* .message-group::after {
    content: "";
    position: absolute;
    top: 100%;
    height: 20px;
    width: 100%;
    left: 0;
    background: url("../img/rip.svg") bottom;
    background-size: 200%;
} */

.message {
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
    text-align: left;
    gap: 1rem;
    position: relative;
}

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

.message h3 {
    color: var(--text-color-title);
    font-family: "Roboto Serif", serif;
    font-size: 24px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    text-transform: uppercase;
}

.message p {
    color: var(--text-color-secondary);
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
}

.message img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
}

.error-message {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 12px;
    background-color: rgba(255, 0, 102, 0.15);
    border: 1px solid rgba(255, 0, 102, 0.2);
    position: relative;
    margin: 0 auto;
    border-radius: 6px;
    margin-bottom: 2rem;
    text-align: center;
}

.error-message p {
    color: var(--text-color);
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px;
}

/* AI FEATURE */

.ai-feature {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
    margin-bottom: 24px;
    align-items: center;
}

.ai-feature img {
    width: 100px;
    max-height: auto;
    object-fit: cover;
}

.ai-feature p {
    color: var(--text-color-primary);
    font-family: "IBM Plex Mono", sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
    text-align: center;
}

/* DOWNLOAD CTA */

.download-button {
    text-align: center;
    margin: 20px 0 40px;
    transition: all 0.5s ease;
}

.download-button.hidden {
    padding: 72px 0 32px 0;
    border-top: 1px solid var(--primary-color);
}

.download-button h4 {
    color: var(--primary-color);
    text-align: center;
    font-family: "Merriweather", serif;
    font-size: 24px;
    font-style: normal;
    font-weight: 400;
    line-height: 33.6px;
    margin-bottom: 2rem;
    opacity: 0;
    max-height: 0px;
    transition: all 0.5s ease;
}

.download-button.hidden h4 {
    opacity: 1;
    max-height: 100px;
}

.download-button a {
    color: var(--text-color);
    text-align: center;
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 19.2px;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.download-button a:hover {
    border-bottom: 2px solid var(--text-color-cta);
}

.download-button.hidden a {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    text-transform: none;
}

.download-button.hidden a:hover {
    background-color: var(--text-color-cta);
}

/* INFORMATION PILLARS */

.pillars-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 3rem;
    opacity: 1;
    transition: all 0.5s ease;
    max-height: 1000px;
}

.pillars-section.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.pillar {
    display: flex;
    width: 33%;
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    align-self: stretch;
    border-radius: 8px;
    background: #F0DEDE;
    box-shadow: 1px 2px 8px 0px rgba(21, 21, 21, 0.05);
}

.pillar h3 {
    color: var(--color-azure-5, #020817);
    font-family: "Roboto Serif", serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0.5px;
    position: relative;
}

.pillar h3::before {
    content: "";
    display: block;
    width: 85%;
    height: 8px;
    background-color: rgba(229, 34, 109, 0.20);
    position: absolute;
    bottom: 4px;
    left: 0;
    z-index: 1;
}

.pillar p {
    color: var(--text-color-secondary);
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 16.8px;
}

/* TYPING ANIMATION */

.typing-indicator {
    display: flex;
    align-items: flex-end;
    padding: 10px;
    justify-content: center;
    margin-bottom: 1rem;
  }

  .typing-indicator span {
    height: 12px;
    width: 12px;
    margin: 0 3px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    animation: vividBounceDots 1.1s infinite ease-in-out both;
  }

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

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

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

  @keyframes vividBounceDots {
    0%, 100% {
      transform: translateY(0) scale(0.8);
      opacity: 0.6;
    }
    50% {
      transform: translateY(0) scale(1.1);
      opacity: 1;
      background-color: var(--primary-color);
    }
  }

/* FOOTER */

.footer {
    text-align: center;
    border-top: 1px solid var(--primary-color);
}

.copyright {
    color: #020817;
    text-align: center;
    font-family: "Inter", sans-serif;
    font-size: 11.25px;
    font-style: normal;
    font-weight: 400;
    line-height: 16px;
    margin-top: 12px;
}

/* Estilos para estado de búsqueda activa */
body.search-active .featured-image-container,
body.search-active .pillars-section,
body.search-active .download-button {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body.search-active #input-container {
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(255, 0, 102, 0.2);
}

body.search-active #responses-container {
    opacity: 1;
    max-height: 3000px;
}

/* MOBILE ADJUSTMENTS */

@media (max-width: 768px) {
    .pre-header {
        flex-direction: column;
        gap: 2rem;
        padding: 28px 0 36px 0;
    }

    .meta-info--right {
        text-align: center;
    }

    .meta-info--left {
        text-align: center;
    }

    .meta-info br {
        display: none;
    }

    .header h1 {
        font-size: 3rem;
        line-height: 60px;
        letter-spacing: 3.04px;
    }

    .header h2 {
        font-size: 24px;
        line-height: 20px;
    }

    .featured-image-container {
        width: 100%;
        max-height: 200px;
        margin: 16px auto;
    }

    .featured-image-container.hidden {
        margin: 0 0 2rem 0;
        padding: 0;
        max-height: 0;
        opacity: 0;
    }

    .featured-image {
        width: 100%;
        height: 100%;
    }

    .chat-input-container {
        width: 100%;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        padding: 8px;
        gap: 0.5rem;
    }

    .chat-messages {
        grid-template-columns: repeat(1, 1fr);
        grid-auto-rows: auto;
        padding: 0 12px;
        margin: 0;
    }

    .message p {
        font-size: 16px;
    }

    .pillars-section {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .pillar {
        width: 100%;
    }

    .download-button {
        margin-top: 0;
    }

    .download-button.hidden {
        margin-top: 2rem;
    }

    .download-button.hidden a {
        padding: 14px 16px;
        font-size: 14px;
    }
}