/* --- 1. RESET & VARIABLES (Warm Tech Style) --- */
:root {
    --bg-body: #FFFFFF;
    --bg-card: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --accent-indigo: #4F46E5;
    --accent-warm: #F97316;
    --border: #E5E7EB;
    --nav-height: 70px;
    --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.08);
    --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-mono: 'Inter', system-ui, sans-serif;
}

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

body { 
    font-family: var(--font-main); 
    background: var(--bg-body); 
    color: var(--text-main); 
    line-height: 1.6; 
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Forzar tipografía Sans Serif en todos los elementos de formulario */
body, button, input, textarea, select {
    font-family: var(--font-main) !important;
}

a { text-decoration: none; color: inherit; transition: 0.2s; cursor: pointer; }
button { border: none; cursor: pointer; background: none; }
input, textarea, select { font-family: inherit; outline: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* --- 2. NAVBAR --- */
.navbar {
    height: var(--nav-height);
    background: rgba(253, 251, 249, 0.95);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}
.navbar.scrolled { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); background: rgba(255,255,255,0.98); }

.nav-container { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.text-logo { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; color: #000; }

.nav-links { display: flex; gap: 32px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--text-muted); position: relative; }
.nav-links a:hover { color: var(--accent-indigo); }
.nav-links a.active { color: var(--accent-indigo); font-weight: 600; }
.nav-links a.active::after {
    content: ''; position: absolute; bottom: -24px; left: 0; right: 0; height: 2px; background: var(--accent-indigo);
}

.btn-primary {
    background: #111827; color: #fff; padding: 10px 24px; border-radius: 99px;
    font-size: 14px; font-weight: 600; transition: all 0.2s; white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-indigo); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }

.btn-secondary {
    background: #fff; border: 1px solid var(--border); color: var(--text-main); padding: 10px 24px; border-radius: 99px;
    font-size: 14px; font-weight: 600; transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--text-main); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-indigo);
    color: var(--accent-indigo);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-outline:hover {
    background: var(--accent-indigo);
    color: white;
}

/* --- 3. HERO & SECTIONS --- */
.hero { padding: 80px 0; text-align: center; }
.badge-warm { display: inline-flex; align-items: center; background: #FFF7ED; color: var(--accent-warm); padding: 6px 16px; border-radius: 99px; font-size: 13px; font-weight: 600; margin-bottom: 32px; border: 1px solid #FFEDD5; }
.hero h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; line-height: 1.1; margin-bottom: 24px; letter-spacing: -0.03em; }
.hero p { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 40px; max-width: 700px; margin-left: auto; margin-right: auto; }

/* Demo Preview Box (Index) */
.demo-preview {
    background: #fff; border-radius: 24px; border: 1px solid var(--border);
    box-shadow: 0 20px 60px -10px rgba(0,0,0,0.1); margin-top: 60px; overflow: hidden; position: relative;
}
.demo-header { background: #F9FAFB; padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #D1D5DB; }
.dot.red { background: #EF4444; } .dot.yellow { background: #F59E0B; } .dot.green { background: #10B981; }

/* --- 4. OWNER DASHBOARD (DEMO.HTML) --- */
.owner-layout { display: grid; grid-template-columns: 1fr 350px; gap: 40px; text-align: left; padding: 40px; }
.feed-container { position: relative; padding-left: 30px; }
.feed-line { position: absolute; left: 7px; top: 10px; bottom: 0; width: 2px; background: #E5E7EB; }
.feed-item { position: relative; margin-bottom: 40px; }
.feed-dot {
    width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--accent-indigo);
    position: absolute; left: -31px; top: 4px; z-index: 2;
}
.feed-dot.pulse { box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2); animation: pulse 2s infinite; }

.feed-card {
    background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: 0.2s;
}
.feed-card:hover { border-color: var(--accent-indigo); transform: translateX(5px); }
.feed-date { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; display: block; }
.feed-title { font-size: 16px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.feed-desc { font-size: 14px; color: #4B5563; }

/* Feedback Widget */
.feedback-widget { background: #fff; border-radius: 16px; border: 1px solid var(--border); padding: 24px; }
.stat-circle {
    width: 120px; height: 120px; border-radius: 50%; border: 8px solid #F3F4F6;
    display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto 20px;
    position: relative;
}
.stat-circle::after {
    content: ''; position: absolute; top: -8px; left: -8px; right: -8px; bottom: -8px;
    border-radius: 50%; border: 8px solid var(--accent-warm); border-color: var(--accent-warm) transparent transparent transparent;
    transform: rotate(-45deg);
}
.stat-number { font-size: 32px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); }

/* --- 5. PRICING --- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-top: 60px; }
.price-card { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 32px; text-align: left; transition: 0.2s; position: relative; }
.price-card.featured { border-color: var(--accent-indigo); box-shadow: 0 10px 30px -10px rgba(79, 70, 229, 0.15); }
.price-amount { font-size: 40px; font-weight: 800; margin: 16px 0; font-family: var(--font-mono); letter-spacing: -1px; }
.feature-list { list-style: none; margin-top: 20px; }
.feature-list li { display: flex; gap: 10px; font-size: 14px; margin-bottom: 12px; color: #4B5563; }

/* --- 6. UTILS & CHAT --- */
.floating-btn {
    position: fixed; bottom: 30px; right: 30px; width: 56px; height: 56px;
    background: var(--accent-indigo); color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3); cursor: pointer; transition: 0.2s; z-index: 900;
}
.floating-btn:hover { transform: scale(1.05); }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(79, 70, 229, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); } }

/* Responsive */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .owner-layout { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.5rem; }
}

/* --- 7. MODAL STYLES (SaaS B2B) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1; pointer-events: all;
}

.modal-overlay.hidden {
    display: none; /* Fallback */
}

.modal-card {
    background: white; width: 100%; max-width: 500px;
    padding: 32px; border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform: translateY(20px); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

/* --- DELETE BUTTON STYLES --- */
/* --- EDIT BUTTON STYLES --- */
.btn-edit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #E0E7FF;
    border-radius: 8px;
    background: #EEF2FF;
    color: #6366F1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit:hover {
    background: #E0E7FF;
    border-color: #C7D2FE;
    transform: scale(1.05);
}

.btn-edit:active {
    transform: scale(0.95);
}

/* --- DELETE BUTTON STYLES --- */
.btn-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #FEE2E2;
    border-radius: 8px;
    background: #FEF2F2;
    color: #DC2626;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: #FEE2E2;
    border-color: #FECACA;
    transform: scale(1.05);
}

.btn-delete:active {
    transform: scale(0.95);
}

/* Animación de salida para tarjetas eliminadas */
.property-card-agent.deleting {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

/* --- WHATSAPP BUTTON STYLES --- */
.btn-whatsapp {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #D1FAE5;
    border-radius: 8px;
    background: #ECFDF5;
    color: #059669;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-whatsapp:hover {
    background: #D1FAE5;
    border-color: #A7F3D0;
    transform: translateY(-1px);
}

.btn-whatsapp:active {
    transform: scale(0.98);
}

/* --- RESPONSIVE BUTTON TEXT --- */
@media (max-width: 768px) {
    .property-actions .btn-text {
        display: none;
    }
    
    .property-actions button {
        padding: 8px 10px;
        min-width: 36px;
        justify-content: center;
    }
    
    .btn-copy-link,
    .btn-whatsapp,
    .btn-primary.btn-manage {
        flex: 1;
    }
}

/* --- BRAND LOGO STYLES --- */

/* Contenedor del logo */
.brand-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
    width: 140px; /* Ancho suficiente para el texto */
    overflow: hidden;
    text-decoration: none;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estilos comunes para ambas imágenes */
.logo-text, .logo-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 32px;
    width: auto;
}

.logo-text:hover, .logo-icon:hover {
    opacity: 0.85;
}

/* Fallback para .brand-logo (cuando solo hay una imagen) */
.brand-logo {
    height: 32px;
    width: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-logo:hover {
    opacity: 0.85;
}

/* ESTADO 1: Top de la página (Navbar normal) */
/* Mostramos Texto, Ocultamos Icono */
.logo-text {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.logo-icon {
    opacity: 0;
    transform: translateY(100%); /* El icono espera abajo fuera de vista */
}

/* ESTADO 2: Scroll (Navbar pequeña) */
/* Reducimos el contenedor y mostramos el icono */
.navbar.scrolled .brand-wrapper {
    width: 50px;
}

.navbar.scrolled .logo-text {
    opacity: 0;
    transform: translateY(-150%) scale(0.8); /* El texto se va para arriba */
}

.navbar.scrolled .logo-icon {
    opacity: 1;
    transform: translateY(-50%) scale(1); /* El icono sube a su sitio */
}

/* ============================================
   MOBILE-FIRST RESPONSIVE STYLES
   ============================================ */

/* --- MOBILE MENU OVERLAY (Slide-in) --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: white;
    z-index: 2000;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    padding: 80px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mobile-menu-overlay.open {
    right: 0;
}

.mobile-menu-overlay a {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-main);
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-overlay a:last-child {
    border-bottom: none;
}

/* Backdrop oscuro cuando el menú está abierto */
.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* Botón hamburguesa */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-main);
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.hamburger-btn:hover {
    background: var(--border);
}

/* Botón cerrar menú móvil */
.close-menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

/* --- TABLET BREAKPOINT (768px) --- */
@media (max-width: 768px) {
    .nav-links {
        display: none !important;
    }
    
    .hamburger-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .property-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .property-card-agent {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .property-info {
        width: 100%;
    }
    
    .property-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Por defecto (Desktop): Ocultar iconos móviles */
.mobile-icon {
    display: none !important;
}

/* --- MOBILE BREAKPOINT (600px) --- */
@media (max-width: 600px) {
    /* Mostrar iconos móviles */
    .mobile-icon {
        display: block !important;
    }
    
    /* Ajuste del logo en móvil */
    .brand-wrapper {
        width: auto;
    }
    
    .brand-wrapper img {
        height: 32px !important;
        width: auto !important;
    }
    
    /* Botones de tarjeta: convertir en cuadrados */
    .property-card-agent .action-buttons button {
        min-width: 40px;
        height: 40px;
        padding: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .property-card-agent .action-buttons .btn-primary {
        padding: 0 12px !important;
    }
    
    .property-card-agent .action-buttons i {
        margin: 0 !important;
    }
    
    .logo-text {
        opacity: 1 !important;
        transform: translateY(-50%) !important;
        position: relative !important;
        top: auto !important;
        transform: none !important;
    }
    
    .logo-icon {
        display: none !important;
    }
    
    /* Navegación */
    .nav-container {
        padding: 0 16px;
    }
    
    /* Clase utilitaria para ocultar texto en móvil */
    .desktop-text {
        display: none !important;
    }
    
    /* Botones más compactos */
    .btn-primary, .btn-secondary {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* Tarjetas de propiedad */
    .property-card-agent .property-actions {
        gap: 8px;
    }
    
    .property-card-agent .property-actions button {
        padding: 8px;
        justify-content: center;
    }
    
    /* Hero section */
    .hero {
        padding: 40px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    /* Containers */
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Modales más pequeños */
    .modal-card {
        margin: 16px;
        padding: 24px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Stats container en dashboard */
    .stats-container {
        flex-direction: column;
    }
    
    .stats-container > div:last-child {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 24px;
        display: flex;
        gap: 24px;
        justify-content: space-around;
    }
}