/* ======================================================
   OPHELIA CHAT - ESTILOS DEL COMPONENTE Y DEMO
   ====================================================== */

/* --- 1. VARIABLES ESPECÍFICAS (Si ya están en style.css, se heredarán) --- */
:root {
    --ophelia-primary: #b100e8;
    --ophelia-secondary: #f20089;
    --ophelia-dark-bg: #050505;
    --ophelia-card-bg: #18181b;
    --ophelia-glass: rgba(255, 255, 255, 0.08);
}

/* --- 2. SECCIÓN LANDING (LAYOUT) --- */
.ophelia-section {
    min-height: 100vh;
    padding: 120px 0 80px 0;
    background: var(--ophelia-dark-bg);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.ophelia-main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 4rem;
    align-items: start;
    position: relative;
    z-index: 1;
}

/* Badge Superior */
.ophelia-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(177, 0, 232, 0.15), rgba(242, 0, 137, 0.15));
    border: 1px solid rgba(177, 0, 232, 0.3);
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--ophelia-primary);
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Tipografía y Textos */
.ophelia-content h1 {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: #fff;
}

.ophelia-section .gradient-text {
    background: linear-gradient(135deg, var(--ophelia-primary), var(--ophelia-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ophelia-description {
    font-size: 1.2rem;
    color: #a1a1aa; /* Gray */
    margin-bottom: 3rem;
    max-width: 600px;
    line-height: 1.7;
}

/* --- 3. CARACTERÍSTICAS (GRID) --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: linear-gradient(135deg, var(--ophelia-card-bg), rgba(24, 24, 27, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--ophelia-primary);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ophelia-primary), var(--ophelia-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: white;
}

.feature-card h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.feature-card p {
    color: #a1a1aa;
    font-size: 0.9rem;
    margin: 0;
}

/* --- 4. ESTADÍSTICAS --- */
.stats-container {
    background: linear-gradient(135deg, rgba(177, 0, 232, 0.05), rgba(242, 0, 137, 0.05));
    border: 1px solid rgba(177, 0, 232, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ophelia-primary), var(--ophelia-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #a1a1aa;
    font-size: 0.9rem;
    font-weight: 500;
}

/* --- 5. BOTONES OPHELIA --- */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.ophelia-section .btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.ophelia-section .btn-primary {
    background: linear-gradient(135deg, var(--ophelia-primary), var(--ophelia-secondary));
    color: white;
    box-shadow: 0 0 20px rgba(177, 0, 232, 0.4);
}

.ophelia-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(177, 0, 232, 0.3);
}

.ophelia-section .btn-secondary {
    background: transparent;
    border: 1px solid #27272a;
    color: #fff;
}

.ophelia-section .btn-secondary:hover {
    border-color: var(--ophelia-primary);
    color: var(--ophelia-primary);
    transform: translateY(-2px);
}

/* --- 6. CHAT PREVIEW (ESTÁTICO) --- */
.chat-preview-container {
    position: sticky;
    top: 140px;
}

.chat-preview {
    background: linear-gradient(135deg, var(--ophelia-card-bg), rgba(24, 24, 27, 0.9));
    border: 1px solid var(--ophelia-glass);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.chat-header {
    background: linear-gradient(135deg, var(--ophelia-primary), var(--ophelia-secondary));
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--ophelia-primary);
    font-size: 1.2rem;
}

.chat-info h4 {
    color: white;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    margin: 0 0 2px 0;
}

.chat-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    animation: ophelia-pulse 2s infinite;
}

.chat-messages {
    padding: 1rem;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: ophelia-slideIn 0.5s ease;
}

.chat-message.ophelia {
    background: linear-gradient(135deg, var(--ophelia-primary), var(--ophelia-secondary));
    color: white;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.chat-message.user {
    background: #27272a;
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--ophelia-glass);
    display: flex;
    gap: 8px;
}

.chat-input-area input {
    flex: 1;
    background: #27272a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--ophelia-primary), var(--ophelia-secondary));
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    cursor: pointer;
}

/* --- 7. MODAL DEMO INTERACTIVO --- */
.demo-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.demo-modal.active {
    display: flex;
}

.demo-container {
    width: 100%;
    max-width: 1000px;
    height: 80vh;
    background: var(--ophelia-dark-bg);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.demo-header {
    background: linear-gradient(135deg, var(--ophelia-primary), var(--ophelia-secondary));
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demo-title {
    font-family: 'JetBrains Mono', monospace;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-demo {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-demo:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Selección de Agente */
.agent-selection {
    padding: 2rem;
    text-align: center;
    overflow-y: auto;
}

.agent-selection h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.agent-selection p {
    color: #a1a1aa;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.agent-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.agent-type {
    background: var(--ophelia-card-bg);
    border: 1px solid var(--ophelia-glass);
    border-radius: 12px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.agent-type:hover {
    border-color: var(--ophelia-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(177, 0, 232, 0.2);
}

.agent-type .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.agent-type h4 {
    font-family: 'JetBrains Mono', monospace;
    color: #fff;
    margin-bottom: 0.5rem;
}

.agent-type p {
    color: #a1a1aa;
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Chat Interactivo */
.demo-chat {
    display: none;
    flex: 1;
    flex-direction: column;
}

.demo-chat.active {
    display: flex;
}

.demo-chat-header {
    background: var(--ophelia-card-bg);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.demo-chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--ophelia-dark-bg), #0a0a0a);
}

.demo-chat-input {
    background: var(--ophelia-card-bg);
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 1rem;
}

.demo-chat-input input {
    flex: 1;
    background: var(--ophelia-dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 12px 20px;
    color: #fff;
    font-size: 0.95rem;
}

.demo-chat-input input:focus {
    outline: none;
    border-color: var(--ophelia-primary);
    box-shadow: 0 0 20px rgba(177, 0, 232, 0.2);
}

.demo-send-btn {
    background: linear-gradient(135deg, var(--ophelia-primary), var(--ophelia-secondary));
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-send-btn:hover {
    transform: scale(1.05);
}

/* --- 8. ANIMACIONES Y RESPONSIVE --- */
@keyframes ophelia-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes ophelia-slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 968px) {
    .ophelia-main { grid-template-columns: 1fr; gap: 3rem; }
    .chat-preview-container { position: static; }
    .features-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

@media (max-width: 768px) {
    .ophelia-section { padding: 100px 0 60px 0; }
    .ophelia-content h1 { font-size: 2.5rem; }
    .action-buttons { flex-direction: column; }
    .demo-container { height: 90vh; }
    .agent-types { grid-template-columns: 1fr; }
}