/* =================================================================== */
/*      MAKUMOTO MODALS: BASE (v2.0)
/*      Infraestructura, Overlays y Herramientas Utilitarias
/*      (Scanner, Avatar, Share, Report)
/* =================================================================== */

/* =================================================================== */
/*      1. OVERLAYS MAESTROS (FONDO OSCURO)
/* =================================================================== */

.modal-overlay, 
.minimalist-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    
    /* Fondo oscuro base */
    background-color: rgba(0, 0, 0, 0.85);
    
    /* Efecto Cristal */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    
    /* Centrado Flexbox */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Estado Inicial: Oculto */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    
    /* Nivel de Capa (Desde generic.css) */
    z-index: var(--z-modal); 
}

/* Clase para mostrar el modal (JS Toggle) */
.modal-overlay.show, 
.minimalist-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Botón Cerrar Genérico (X) */
.modal-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
    z-index: 20; /* Siempre encima del contenido */
}
.modal-close-btn:hover { opacity: 0.8; }

/* Botón Volver Genérico (Flecha) */
.modal-back-btn {
    position: absolute; top: 12px; left: 12px;
    width: 35px; height: 35px;
    background: rgba(255,255,255,0.1);
    border: none; border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1rem;
    z-index: 20;
}

/* =================================================================== */
/*      2. SCANNER IMC (ESTILO DARK MODERN)
/* =================================================================== */

.scanner-modern-modal {
    background: #000;
    border: 2px solid #333;
    border-radius: 30px;
    width: 90%; max-width: 380px;
    height: 85vh; /* Altura fija para layout */
    
    display: flex; flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    color: #fff;
    font-family: var(--font-family);
}

/* Scroll interno */
.scanner-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px 25px;
    padding-bottom: 80px; /* Espacio para el botón flotante */
}

/* Header Scanner */
.makumoto-brand {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.6rem; letter-spacing: 2px;
    margin-bottom: 5px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.scanner-sub { color: #888; font-size: 0.85rem; margin: 0; }
.scanner-highlight { 
    color: #00f3ff; /* Cian Neón */
    font-weight: 900; text-transform: uppercase; 
    margin: 10px 0 25px 0; font-size: 1.1rem; letter-spacing: 1px;
}

/* Inputs Modernos */
.input-group-modern {
    background: #111;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px 15px;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 15px;
    position: relative;
    transition: border-color 0.3s;
}
.input-group-modern:focus-within { border-color: #00f3ff; }

.input-group-modern .icon { color: #00f3ff; width: 20px; text-align: center; font-size: 1.1rem; }
.input-group-modern input {
    background: transparent; border: none; color: #fff;
    width: 100%; font-size: 1rem; outline: none; font-family: inherit;
}
.input-unit { color: #444; font-size: 0.7rem; font-weight: 800; }

/* Botón Calcular */
.btn-calculate-cyan {
    background: #00f3ff; color: #000;
    border: none; padding: 12px 30px;
    border-radius: 50px;
    font-weight: 900; font-family: 'Orbitron', sans-serif;
    font-size: 1rem; letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
    display: block; margin: 10px auto;
    text-transform: uppercase;
}
.btn-calculate-cyan:active { transform: scale(0.95); }

/* Resultados Scanner */
.result-circle-icon {
    width: 60px; height: 60px; border-radius: 50%;
    border: 4px solid #fff; background: #000;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; margin: 0 auto 15px auto;
}
.result-big-number { font-family: 'Orbitron'; font-size: 4.5rem; font-weight: 900; line-height: 1; }
.result-status-text { font-family: 'Orbitron'; font-size: 1.5rem; font-weight: 800; text-transform: uppercase; margin-bottom: 10px; }

/* =================================================================== */
/*      3. SELECTOR DE AVATAR (ESTILO PASTEL/CLEAN)
/* =================================================================== */

#avatar-selection-modal {
    z-index: var(--z-overlay); /* Debe estar sobre el perfil */
}

#avatar-selection-modal .modal-content {
    background: #e8f5e9; /* Verde Pastel */
    color: #1b5e20;
    width: 90%; max-width: 350px;
    height: 75vh; max-height: 600px;
    border-radius: 20px;
    border: 4px solid #fff;
    box-shadow: 0 20px 50px rgba(27, 94, 32, 0.2);
    display: flex; flex-direction: column;
    overflow: hidden;
    margin: auto;
}

/* Header Avatar */
#avatar-selection-modal .modal-header {
    background: #c8e6c9; padding: 15px; text-align: center;
    border-bottom: 2px solid #fff; flex-shrink: 0;
    position: relative;
}
#avatar-selection-modal h3 { margin: 0; font-size: 1rem; font-weight: 800; color: #1b5e20; }

#avatar-close-btn {
    position: absolute; top: 10px; right: 10px;
    width: 32px; height: 32px; background: #fff; color: #ef5350;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Preview Area */
#avatar-preview-area {
    display: flex; flex-direction: column; align-items: center;
    padding: 20px 10px;
    background: linear-gradient(to bottom, #fff, #f1f8e9);
    border-bottom: 1px solid #c8e6c9; flex-shrink: 0; gap: 15px;
}

#avatar-preview-img {
    width: 110px; height: 110px; object-fit: cover;
    border-radius: 50%; border: 4px solid #2e7d32;
    background: #e0e0e0; box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn-upload-custom {
    background: #2e7d32; color: white; padding: 10px 25px;
    border-radius: 50px; font-size: 0.85rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.3);
}

/* Tabs Avatar */
.avatar-tabs {
    display: flex; justify-content: center; padding: 12px; gap: 10px;
    background: #e8f5e9; flex-shrink: 0;
}
.avatar-tab-btn {
    background: #fff; border: 1px solid #a5d6a7; color: #558b2f;
    padding: 8px 16px; border-radius: 20px; font-size: 0.8rem; font-weight: 700;
    cursor: pointer; flex: 1; text-align: center;
}
.avatar-tab-btn.active {
    background: #2e7d32; color: #fff; border-color: #2e7d32;
    box-shadow: 0 3px 8px rgba(46, 125, 50, 0.3);
}

/* Grid Avatares */
.avatar-grid-container {
    flex: 1; overflow-y: auto; padding: 15px; background: #f1f8e9;
    min-height: 0;
}
.avatar-grid {
    display: none; grid-template-columns: 1fr 1fr; gap: 15px;
    padding-bottom: 20px;
}
.avatar-grid.active { display: grid; }

.avatar-option {
    aspect-ratio: 1; border-radius: 15px; overflow: hidden;
    cursor: pointer; border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); background: #fff;
}
.avatar-option:hover { border-color: #2e7d32; transform: scale(1.03); }
.avatar-option img { width: 100%; height: 100%; object-fit: cover; }

/* =================================================================== */
/*      4. SHARE OVERLAY (COMPARTIR)
/* =================================================================== */

.share-overlay-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: var(--z-overlay);
    display: flex; align-items: flex-end; /* Desde abajo en móvil */
    justify-content: center;
    visibility: hidden; opacity: 0; transition: all 0.3s;
}
.share-overlay-container.show { visibility: visible; opacity: 1; }

.share-overlay-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
}

.share-overlay-content {
    position: relative; z-index: 2;
    background: #1a1a1a;
    width: 100%; max-width: 500px;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    border-top: 1px solid #333;
    animation: slideUp 0.3s ease-out;
}
@media (min-width: 500px) {
    .share-overlay-container { align-items: center; }
    .share-overlay-content { border-radius: 20px; }
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Grid Iconos Share */
.share-overlay-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 15px; margin-top: 15px;
}
.share-overlay-btn {
    background: none; border: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.icon-box {
    width: 50px; height: 50px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff; background: #333;
    transition: transform 0.2s;
}
.share-overlay-btn:hover .icon-box { transform: scale(1.1); }
.share-overlay-btn span { color: #ccc; font-size: 0.75rem; }

/* Colores Redes */
.icon-box.whatsapp { background: #25D366; }
.icon-box.facebook { background: #1877F2; }
.icon-box.x-twitter { background: #000; border: 1px solid #333; }
.icon-box.copy { background: #555; }

/* =================================================================== */
/*      5. REPORT MODAL (DENUNCIAS)
/* =================================================================== */

.report-reasons-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    margin-bottom: 15px;
}

.radio-item {
    background: #222; border: 1px solid #333; padding: 10px;
    border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem; color: #ddd;
}
.radio-item:hover { background: #333; border-color: #555; }
.radio-item:has(input:checked) {
    border-color: var(--color-danger);
    background: rgba(231, 76, 60, 0.1); color: #fff;
}
.radio-item input[type="radio"] { accent-color: var(--color-danger); }
/* =========================================
   MENÚ DESLIZABLE (ACTION SHEET - ESTILO APP)
   ========================================= */
.mobile-action-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); /* Fondo oscuro semitransparente */
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s;
    display: flex; flex-direction: column; justify-content: flex-end; /* Alineado abajo */
}
.mobile-action-menu-overlay.show { opacity: 1; visibility: visible; }

.action-sheet-panel {
    background: #1a1a1a;
    border-radius: 20px 20px 0 0; /* Bordes redondos solo arriba */
    padding: 20px 20px 40px 20px; /* Padding extra abajo para iPhone */
    transform: translateY(100%); /* Oculto abajo */
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); /* Efecto rebote suave */
    border-top: 1px solid #333;
}
.mobile-action-menu-overlay.show .action-sheet-panel { transform: translateY(0); }

/* Botones del menú */
.sheet-btn {
    width: 100%;
    background: #2a2a2a;
    border: none;
    padding: 16px;
    margin-bottom: 10px;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    cursor: pointer;
}
.sheet-btn i { font-size: 1.1rem; }

.sheet-btn.danger { color: #ff4444; background: rgba(255, 68, 68, 0.1); }
.sheet-btn.cancel { background: transparent; color: #888; margin-top: 10px; }
/* =========================================
   MENÚ FLOTANTE ESTILO X (POPOVER)
   ========================================= */

/* El contenedor del menú */
.x-dropdown-menu {
    position: absolute; /* Se mueve libremente */
    z-index: 10000;
    
    background-color: #000000;
    border: 1px solid #333; /* Borde sutil */
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1); /* Glow suave */
    
    width: 260px; /* Ancho fijo estilo X */
    padding: 8px 0;
    
    display: none; /* Oculto por defecto */
    flex-direction: column;
}

/* Clase para mostrarlo */
.x-dropdown-menu.show {
    display: flex;
    animation: menuFadeIn 0.1s ease-out;
}

/* Los botones individuales */
.x-menu-item {
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    
    color: #e7e9ea;
    font-size: 15px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.x-menu-item:hover {
    background-color: #16181c; /* Gris muy oscuro al pasar mouse */
}

.x-menu-item i {
    width: 20px; /* Ancho fijo para alinear iconos */
    text-align: center;
    color: #e7e9ea;
}

/* Variación para Reportar (Rojo) */
.x-menu-item.danger {
    color: #f4212e; /* Rojo X */
}
.x-menu-item.danger i {
    color: #f4212e;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}