:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #fafafa;
    --text-primary: #000000;
    --text-secondary: #555555;
    --accent: #000000;
    --accent-hover: #333333;
    --border: #dddddd;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
    --chat-panel-bg: #ffffff;
    --chat-message-bg: #f0f0f0;
    --admin-panel-bg: #ffffff;
    --admin-list-bg: #f5f5f5;
    --admin-selected-bg: #e0e0e0;
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #000000;
        --bg-secondary: #111111;
        --bg-card: #1a1a1a;
        --text-primary: #ffffff;
        --text-secondary: #aaaaaa;
        --accent: #ffffff;
        --accent-hover: #dddddd;
        --border: #333333;
        --shadow: 0 4px 12px rgba(255,255,255,0.05);
        --chat-panel-bg: #1a1a1a;
        --chat-message-bg: #2a2a2a;
        --admin-panel-bg: #1a1a1a;
        --admin-list-bg: #2a2a2a;
        --admin-selected-bg: #3a3a3a;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Animaciones generales */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.click-effect {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.click-effect:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.cursor {
    display: inline-block;
    width: 3px;
    margin-left: 3px;
    animation: cursorBlink 0.8s infinite;
    color: var(--accent);
}

/* Header */
header {
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo span {
    color: var(--accent);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
}

nav a:hover {
    color: var(--text-primary);
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    letter-spacing: 0.3px;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Hero */
.hero {
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero h1 span {
    color: var(--accent);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Secciones */
section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 15px;
    text-align: center;
}

.section-subtitle {
    color: var(--text-secondary);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 50px;
    font-size: 1.1rem;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.feature-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid var(--border);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 20px;
    display: block;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Cómo funciona */
.how-it-works {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 40px;
    margin-top: 20px;
    border: 1px solid var(--border);
}

.steps {
    list-style: none;
    counter-reset: step-counter;
}

.steps li {
    counter-increment: step-counter;
    margin-bottom: 25px;
    padding-left: 50px;
    position: relative;
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 35px;
    height: 35px;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.steps li strong {
    color: var(--text-primary);
}

/* Setup */
.setup-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.setup-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.step-number {
    background: var(--accent);
    color: var(--bg-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    margin-bottom: 5px;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 30px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Chat flotante (usuario) ===== */
.chat-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: var(--transition);
    z-index: 1001;
}

.chat-toggle-btn img {
    width: 30px;
    height: 30px;
    filter: invert(1);
}

.chat-toggle-btn:hover {
    transform: scale(1.05);
}

.chat-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    max-width: calc(100vw - 40px);
    background: var(--chat-panel-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.chat-panel.open {
    display: flex;
}

.chat-header {
    background: var(--accent);
    color: var(--bg-primary);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.chat-close-btn {
    background: none;
    border: none;
    color: var(--bg-primary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: var(--chat-panel-bg);
}

.chat-messages ul {
    list-style: none;
}

.chat-messages li {
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--chat-message-bg);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.chat-messages li strong {
    font-weight: 600;
}

.chat-input-area {
    display: flex;
    padding: 15px;
    background: var(--chat-panel-bg);
    border-top: 1px solid var(--border);
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.95rem;
    outline: none;
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.chat-input-area input:focus {
    border-color: var(--accent);
}

.chat-input-area button {
    width: 45px;
    height: 45px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-area button:hover {
    background: var(--accent-hover);
}

/* ===== Botón de administrador ===== */
.admin-toggle-btn {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: var(--transition);
    z-index: 1001;
    font-size: 1.3rem;
    color: var(--bg-primary);
}

.admin-toggle-btn:hover {
    transform: scale(1.05);
}

/* ===== Panel de administración ===== */
.admin-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    height: 80vh;
    background: var(--admin-panel-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    display: none;
    z-index: 1002;
    overflow: hidden;
}

.admin-panel.open {
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: var(--accent);
    color: var(--bg-primary);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.admin-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.admin-chat-list {
    width: 250px;
    background: var(--admin-list-bg);
    padding: 15px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
}

.admin-chat-list h4 {
    margin-bottom: 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.admin-chat-list ul {
    list-style: none;
}

.admin-chat-list li {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    word-break: break-all;
}

.admin-chat-list li:hover {
    background: var(--admin-selected-bg);
}

.admin-chat-list li.active {
    background: var(--admin-selected-bg);
    font-weight: 600;
}

.admin-chat-view {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.admin-chat-messages p {
    color: var(--text-secondary);
    font-style: italic;
}

.admin-chat-messages ul {
    list-style: none;
}

.admin-chat-messages li {
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--chat-message-bg);
    border-radius: 8px;
    font-size: 0.9rem;
}

.admin-chat-messages li strong {
    font-weight: 600;
}

.admin-chat-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid var(--border);
    gap: 10px;
    background: var(--admin-panel-bg);
}

.admin-chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.95rem;
    outline: none;
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.admin-chat-input input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-chat-input button {
    width: 45px;
    height: 45px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-chat-input button:hover:not(:disabled) {
    background: var(--accent-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .header-inner { flex-direction: column; gap: 15px; }
    nav ul { gap: 15px; flex-wrap: wrap; justify-content: center; }
    .section-title { font-size: 2rem; }
    .how-it-works { padding: 20px; }
    .steps li { padding-left: 40px; }
    .steps li::before { width: 30px; height: 30px; font-size: 0.9rem; }
    .chat-panel { bottom: 100px; right: 10px; left: 10px; width: auto; }
    .chat-toggle-btn { bottom: 20px; right: 20px; width: 55px; height: 55px; }
    .admin-toggle-btn { bottom: 80px; right: 20px; width: 45px; height: 45px; }
    .admin-panel { width: 95%; height: 90vh; }
    .admin-body { flex-direction: column; }
    .admin-chat-list { width: 100%; height: auto; max-height: 30%; border-right: none; border-bottom: 1px solid var(--border); }
    .admin-chat-list ul { display: flex; flex-wrap: wrap; gap: 5px; }
    .admin-chat-list li { margin-bottom: 0; }
}

/* Accesibilidad: reduce motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}