/**
 * PleChat - Global Styles
 * Design System: Modern SaaS / Futuristic (Mint & Dark)
 */

:root {
    /* Colors */
    --accent-primary: #84EFD2;
    --accent-secondary: #5ED9B9;
    --accent-dark: #2D9F83;
    --accent-gradient: linear-gradient(135deg, #84EFD2 0%, #5ED9B9 100%);
    --accent-glow: 0 0 20px rgba(132, 239, 210, 0.3);

    /* Backgrounds */
    --bg-primary: #0f1720;
    --bg-secondary: #151d2a;
    --bg-surface: #111827;
    --bg-card: rgba(21, 29, 42, 0.7);
    --bg-hover: rgba(132, 239, 210, 0.08);
    --bg-active: rgba(132, 239, 210, 0.15);

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f1720;

    /* Status */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #84EFD2;

    /* Borders & Glass */
    --border-color: rgba(148, 163, 184, 0.1);
    --border-light: rgba(148, 163, 184, 0.05);
    --glass-bg: rgba(15, 23, 32, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-blur: blur(12px);

    /* Sizes */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 15px rgba(132, 239, 210, 0.2);

    /* Fonts & Motion */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme (Preserved but updated) */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: rgba(132, 239, 210, 0.1);
    --bg-active: rgba(132, 239, 210, 0.2);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.8);
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: var(--accent-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-secondary); text-shadow: var(--shadow-glow); }

/* Glassmorphism Classes */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-inverse);
    box-shadow: var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(132, 239, 210, 0.4);
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

/* Inputs */
input, textarea, select {
    font-size: 16px; /* Evita que el iPhone haga zoom al escribir */
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    transition: all var(--transition);
}

.form-input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(132, 239, 210, 0.1);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-4px);
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-online { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.status-offline { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulseGlow { 0% { box-shadow: 0 0 5px rgba(132, 239, 210, 0.2); } 50% { box-shadow: 0 0 20px rgba(132, 239, 210, 0.5); } 100% { box-shadow: 0 0 5px rgba(132, 239, 210, 0.2); } }

/* Modals System (Global) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl), 0 0 40px rgba(0,0,0,0.5);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.modal.large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    z-index: 10;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-body {
    padding: 24px;
}

.modal-close, .close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover, .close-modal:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-primary);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.modal-tabs .tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.modal-tabs .tab-btn.active {
    background: var(--bg-surface);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

/* Utilities */
.text-accent { color: var(--accent-primary); }
.glow-text { text-shadow: var(--shadow-glow); }
.btn-block { width: 100%; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

.mobile-bottom-nav {
    display: none; /* Hidden by default, shown on mobile */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.premium-nav {
    display: none; /* Hide premium navigation as it's replaced by mobile nav */
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 60px;
        background: var(--bg-surface);
        border-top: 1px solid var(--border-color);
        z-index: 100; /* Lowered to prevent blocking other elements */
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    }

    .mobile-nav-container {
        display: flex;
        flex-direction: row;
        width: 100%;
        height: 100%;
        justify-content: space-between;
        align-items: center;
        padding: 0 4px;
        overflow-x: auto;
    }

    .mobile-nav-item {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        color: var(--text-muted);
        border-radius: var(--radius-md);
        background: transparent;
        border: none;
        cursor: pointer;
        flex-shrink: 0;
    }

    .mobile-nav-item.active {
        color: var(--accent-primary);
        background: rgba(132, 239, 210, 0.1);
    }

    .mobile-nav-item:hover {
        color: var(--text-primary);
    }
}

/* ============================================================
   GUEST MODE – Modal de registro y banner de bienvenida
   ============================================================ */

.guest-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.guest-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.guest-modal-card {
    background: linear-gradient(145deg, #131e2e 0%, #0f1720 100%);
    border: 1px solid rgba(132, 239, 210, 0.15);
    border-radius: 24px;
    padding: 40px 32px 32px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    box-shadow: 0 32px 64px rgba(0,0,0,0.6), 0 0 60px rgba(132,239,210,0.05);
    transform: translateY(24px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.guest-modal-card.active { transform: translateY(0) scale(1); }
.guest-modal-close {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    border-radius: 50%; width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease;
}
.guest-modal-close:hover {
    background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3);
    color: #ef4444; transform: rotate(90deg);
}
.guest-modal-icon {
    width: 68px; height: 68px; border-radius: 50%;
    background: linear-gradient(145deg, rgba(132,239,210,0.12), rgba(94,217,185,0.06));
    border: 1px solid rgba(132,239,210,0.2);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    color: var(--accent-primary);
    box-shadow: 0 0 24px rgba(132,239,210,0.12);
}
.guest-modal-title {
    font-size: 1.55rem; font-weight: 800;
    background: linear-gradient(135deg, #84EFD2, #5ED9B9);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px; letter-spacing: -0.3px;
}
.guest-modal-desc { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; margin-bottom: 22px; }
.guest-modal-desc strong { color: var(--text-primary); }
.guest-modal-perks {
    display: flex; justify-content: center; gap: 10px;
    flex-wrap: wrap; margin-bottom: 28px;
}
.guest-modal-perks span {
    background: rgba(132,239,210,0.06);
    border: 1px solid rgba(132,239,210,0.12);
    color: var(--text-secondary);
    padding: 6px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 500;
}
.guest-modal-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.guest-btn-primary {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #84EFD2 0%, #5ED9B9 100%);
    color: #0f1720; font-weight: 700; font-size: 0.95rem;
    border-radius: 14px; text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(132,239,210,0.3);
}
.guest-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(132,239,210,0.45);
    filter: brightness(1.05); color: #0f1720;
}
.guest-btn-secondary {
    display: flex; align-items: center; justify-content: center;
    padding: 13px 24px;
    background: transparent;
    border: 1px solid rgba(132,239,210,0.2);
    color: var(--accent-primary); font-weight: 600; font-size: 0.9rem;
    border-radius: 14px; text-decoration: none; transition: all 0.25s ease;
}
.guest-btn-secondary:hover {
    background: rgba(132,239,210,0.08);
    border-color: var(--accent-primary);
    color: var(--accent-primary); transform: translateY(-1px);
}
.guest-modal-footer { font-size: 0.78rem; color: var(--text-muted); }

/* ── Banner de registro ──────────────────────────────────── */
.guest-register-banner {
    background: linear-gradient(135deg, rgba(132,239,210,0.07), rgba(94,217,185,0.04));
    border-bottom: 1px solid rgba(132,239,210,0.12);
    padding: 3px 12px;
    display: flex; align-items: center; justify-content: center;
    gap: 8px; flex-wrap: wrap; text-align: center;
    font-size: 0.72rem; color: var(--text-secondary);
    position: sticky; top: 0; z-index: 500;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.guest-register-banner svg {
    width: 12px !important;
    height: 12px !important;
}
.guest-register-banner strong { color: var(--text-primary); }
.guest-register-banner .banner-cta {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #84EFD2, #5ED9B9);
    color: #0f1720; font-weight: 700; font-size: 0.7rem;
    border-radius: 10px; text-decoration: none;
    transition: all 0.2s ease; white-space: nowrap;
}
.guest-register-banner .banner-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(132,239,210,0.4); color: #0f1720;
}
.guest-register-banner .banner-login {
    color: var(--accent-primary); font-size: 0.7rem;
    font-weight: 500; text-decoration: none;
}
.guest-register-banner .banner-login:hover { text-decoration: underline; }

/* Prevent iOS auto-zoom on focus by ensuring font-size is at least 16px on mobile viewports */
@media screen and (max-width: 1024px) {
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

