/* =============================================================================
   RutaTurismo360 - Global Dialog Template Styles
   =============================================================================

   Estilos para diálogos y modales del sistema con prefijo rt360-*.
   Uso: componentes abiertos mediante DialogService.OpenAsync().

   Prefijo: rt360-*
   Última actualización: Marzo 2026
   Versión: 1.1.0

   ÍNDICE:
   -------
   1.  Contenedor principal (rt360-dialog-container)
   2.  Cabecera con gradiente (rt360-dialog-header)
   3.  Selector de idioma (rt360-dialog-lang-selector)
   4.  Contenido scrollable (rt360-dialog-content)
   5.  Etiquetas de sección overline (rt360-dialog-section-label)
   6.  Textos y valores (rt360-dialog-value, rt360-dialog-preview-text)
   7.  Vista previa HTML (rt360-dialog-html-preview, rt360-dialog-html-content)
   8.  Barra de preview estilo macOS (rt360-dialog-preview-bar, rt360-preview-dot)
   9.  Vista de código fuente (rt360-dialog-source-code, rt360-dialog-source-pre)
   10. Barra de toggle vista (rt360-dialog-toggle-bar)
   11. Pie del diálogo (rt360-dialog-footer)
   12. Badges con fuente monospace (rt360-badge-mono)
   13. Dark Mode
   ============================================================================= */


/* =============================================================================
   1. CONTENEDOR PRINCIPAL
   ============================================================================= */

/**
 * Wrapper raíz del contenido del diálogo
 * Uso: <div class="rt360-dialog-container">
 */
.rt360-dialog-container {
    display: flex;
    flex-direction: column;
    width: min(100%, 760px);
    background: var(--rz-base-background-color);
    color: var(--rz-text-color);
    border-radius: 8px;
    overflow: hidden;
}


/* =============================================================================
   2. CABECERA CON GRADIENTE
   ============================================================================= */

/**
 * Banda superior con gradiente primary → secondary
 * Uso: <div class="rt360-dialog-header">
 */
.rt360-dialog-header {
    background: linear-gradient(135deg, var(--rz-primary) 0%, var(--rz-secondary) 100%);
    padding: 20px 24px;
}

/**
 * Ícono de la cabecera del diálogo (tamaño mediano)
 * Uso: <RadzenIcon class="rt360-dialog-header-icon">
 */
.rt360-dialog-header-icon {
    color: #fff;
    font-size: 1.5rem;
}

/**
 * Texto de código/título en la cabecera
 * Uso: <RadzenText class="rt360-dialog-header-code">
 */
.rt360-dialog-header-code {
    color: #fff;
    margin: 0;
    font-weight: 600;
}

/**
 * Botón cerrar flotante en la cabecera
 * Uso: <RadzenButton class="rt360-dialog-close-btn">
 */
.rt360-dialog-close-btn {
    color: #fff !important;
    min-width: auto !important;
}


/* =============================================================================
   3. SELECTOR DE IDIOMA
   ============================================================================= */

/**
 * Barra con los botones de selección de idioma
 * Uso: <div class="rt360-dialog-lang-selector">
 */
.rt360-dialog-lang-selector {
    padding: 12px 24px 0;
    border-bottom: 1px solid var(--rz-border-disabled-color);
}


/* =============================================================================
   4. CONTENIDO SCROLLABLE
   ============================================================================= */

/**
 * Área de contenido principal con scroll vertical
 * Uso: <div class="rt360-dialog-content">
 */
.rt360-dialog-content {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 70vh;
    overflow-y: auto;
}


/* =============================================================================
   5. ETIQUETAS DE SECCIÓN (overline)
   ============================================================================= */

/**
 * Label de sección estilo overline (mayúsculas, espaciado)
 * Uso: <RadzenText class="rt360-dialog-section-label">
 */
.rt360-dialog-section-label {
    display: block;
    color: var(--rz-text-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}


/* =============================================================================
   6. TEXTOS Y VALORES
   ============================================================================= */

/**
 * Valor principal (negrita, sin margen)
 * Uso: <RadzenText class="rt360-dialog-value">
 */
.rt360-dialog-value {
    font-weight: 600;
    margin: 0;
}

/**
 * Texto de preview en cursiva (secundario)
 * Uso: <RadzenText class="rt360-dialog-preview-text">
 */
.rt360-dialog-preview-text {
    color: var(--rz-text-secondary-color);
    font-style: italic;
}


/* =============================================================================
   7. VISTA PREVIA HTML
   ============================================================================= */

/**
 * Contenedor del iframe-like de preview de email
 * Uso: <div class="rt360-dialog-html-preview">
 */
.rt360-dialog-html-preview {
    border: 1px solid var(--rz-border-disabled-color);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

/**
 * Área de contenido HTML renderizado
 * Uso: <div class="rt360-dialog-html-content">
 */
.rt360-dialog-html-content {
    padding: 10px 10px;
    background: #fff;
    color: #333;
}


/* =============================================================================
   8. BARRA DE PREVIEW ESTILO macOS
   ============================================================================= */

/**
 * Barra superior decorativa con los tres puntos de color
 * Uso: <div class="rt360-dialog-preview-bar">
 */
.rt360-dialog-preview-bar {
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid var(--rz-border-disabled-color);
}

/**
 * Etiqueta descriptiva de la barra de preview
 * Uso: <RadzenText class="rt360-dialog-preview-label">
 */
.rt360-dialog-preview-label {
    color: #999;
    margin-left: 8px;
}

/**
 * Punto decorativo estilo macOS
 * Uso: <div class="rt360-preview-dot rt360-preview-dot--red">
 */
.rt360-preview-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rt360-preview-dot--red    { background: #ff5f57; }
.rt360-preview-dot--yellow { background: #febc2e; }
.rt360-preview-dot--green  { background: #28c840; }


/* =============================================================================
   9. VISTA DE CÓDIGO FUENTE
   ============================================================================= */

/**
 * Contenedor del código HTML fuente
 * Uso: <div class="rt360-dialog-source-code">
 */
.rt360-dialog-source-code {
    background: var(--rz-base-300-color);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

/**
 * Elemento <pre> dentro del contenedor de código fuente
 * Uso: <pre class="rt360-dialog-source-pre">
 */
.rt360-dialog-source-pre {
    margin: 0;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--rz-text-color);
}


/* =============================================================================
   10. BARRA DE TOGGLE (rendered/source)
   ============================================================================= */

/**
 * Fila con el botón de alternar entre vista renderizada y código fuente
 * Uso: <RadzenStack class="rt360-dialog-toggle-bar">
 */
.rt360-dialog-toggle-bar {
    margin-top: 8px;
}


/* =============================================================================
   11. PIE DEL DIÁLOGO
   ============================================================================= */

/**
 * Franja inferior con botones de acción
 * Uso: <div class="rt360-dialog-footer">
 */
.rt360-dialog-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--rz-border-disabled-color);
    display: flex;
    justify-content: flex-end;
}


/* =============================================================================
   12. BADGES CON FUENTE MONOSPACE
   ============================================================================= */

/**
 * Badge con fuente monoespaciada (variables, códigos)
 * Uso: <RadzenBadge class="rt360-badge-mono">
 */
.rt360-badge-mono {
    font-family: monospace;
    font-size: 11px;
}


/* =============================================================================
   13. DARK MODE
   ============================================================================= */

/* --- Contenedor raíz: borde sutil para elevación sobre el overlay --- */
html[data-theme="dark"] .rt360-dialog-container {
    background: var(--background-light);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Cabecera: el gradiente ya usa CSS vars de Radzen, sin cambios --- */
html[data-theme="dark"] .rt360-dialog-header-icon {
    color: #fff;
    opacity: 0.95;
}

html[data-theme="dark"] .rt360-dialog-header-code {
    color: #fff;
}

/* --- Selector de idioma: fondo más oscuro + borde más visible --- */
html[data-theme="dark"] .rt360-dialog-lang-selector {
    background: rgba(0, 0, 0, 0.2);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* --- Contenido scrollable: scrollbar personalizado para dark --- */
html[data-theme="dark"] .rt360-dialog-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

html[data-theme="dark"] .rt360-dialog-content::-webkit-scrollbar {
    width: 6px;
}

html[data-theme="dark"] .rt360-dialog-content::-webkit-scrollbar-track {
    background: transparent;
}

html[data-theme="dark"] .rt360-dialog-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

html[data-theme="dark"] .rt360-dialog-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* --- Etiquetas overline: ligeramente más brillantes --- */
html[data-theme="dark"] .rt360-dialog-section-label {
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.07em;
}

/* --- Valor principal: casi blanco --- */
html[data-theme="dark"] .rt360-dialog-value {
    color: rgba(255, 255, 255, 0.92);
}

/* --- Texto preview en cursiva --- */
html[data-theme="dark"] .rt360-dialog-preview-text {
    color: rgba(255, 255, 255, 0.5);
}

/* --- Vista previa HTML: simula un "browser window" oscuro --- */
html[data-theme="dark"] .rt360-dialog-html-preview {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
}

/* --- Barra macOS: fondo oscuro con borde sutil --- */
html[data-theme="dark"] .rt360-dialog-preview-bar {
    background: #252525;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .rt360-dialog-preview-label {
    color: rgba(255, 255, 255, 0.35);
}

/* =============================================================================
   14. MAINTENANCE OVERLAY
   ============================================================================= */

.rt360-maintenance-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rz-background-color, #f5f5f5);
    padding: 2rem;
}

/* --- Contenido HTML renderizado: fondo oscuro legible --- */
html[data-theme="dark"] .rt360-dialog-html-content {
    background: #1a1a1a;
    color: #e0e0e0;
}

/* --- Vista de código fuente: estilo editor oscuro (VS Code) --- */
html[data-theme="dark"] .rt360-dialog-source-code {
    background: #1e1e2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

html[data-theme="dark"] .rt360-dialog-source-code::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

html[data-theme="dark"] .rt360-dialog-source-code::-webkit-scrollbar-track {
    background: transparent;
}

html[data-theme="dark"] .rt360-dialog-source-code::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* --- Texto de código: paleta tipo VS Code Dark+ --- */
html[data-theme="dark"] .rt360-dialog-source-pre {
    color: #d4d4d4;
}

/* --- Pie del diálogo: fondo ligeramente separado + borde visible --- */
html[data-theme="dark"] .rt360-dialog-footer {
    background: rgba(0, 0, 0, 0.15);
    border-top-color: rgba(255, 255, 255, 0.1);
}
