/* ============================================
   ESTILOS COMPARTIDOS - PÁGINAS DE ERROR
   Sistemas SKULL - Diseño Minimalista
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    padding: 2rem;
    position: relative;
}

/* SISTEMA DE DOBLE BARRA - Top: Origen, Bottom: Tipo HTTP */
.status-bar {
    position: fixed;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 1000;
    animation: slideIn 0.5s ease-out;
}

.status-bar.top {
    top: 0;
}

.status-bar.bottom {
    bottom: 0;
}

/* Colores para Barra SUPERIOR (Origen del Error) */
.status-bar.origin-database { background: linear-gradient(90deg, #DC2626 0%, #B91C1C 100%); }
.status-bar.origin-application { background: linear-gradient(90deg, #EA580C 0%, #C2410C 100%); }
.status-bar.origin-network { background: linear-gradient(90deg, #2563EB 0%, #1D4ED8 100%); }
.status-bar.origin-security { background: linear-gradient(90deg, #991B1B 0%, #7F1D1D 100%); }
.status-bar.origin-validation { background: linear-gradient(90deg, #D97706 0%, #B45309 100%); }
.status-bar.origin-authentication { background: linear-gradient(90deg, #7C3AED 0%, #6D28D9 100%); }
.status-bar.origin-system { background: linear-gradient(90deg, #6B7280 0%, #4B5563 100%); }

/* Colores para Barra INFERIOR (Tipo HTTP) */
.status-bar.http-success { background: linear-gradient(90deg, #10B981 0%, #059669 100%); }
.status-bar.http-redirection { background: linear-gradient(90deg, #3B82F6 0%, #2563EB 100%); }
.status-bar.http-client-error { background: linear-gradient(90deg, #EF4444 0%, #DC2626 100%); }
.status-bar.http-server-error { background: linear-gradient(90deg, #F59E0B 0%, #D97706 100%); }
.status-bar.http-informational { background: linear-gradient(90deg, #8B5CF6 0%, #7C3AED 100%); }

@keyframes slideIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Para páginas de éxito con gradiente */
body.success-page {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.container {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

/* Box para páginas de éxito */
.success-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.6s ease-out;
}

.logo-container {
    margin-bottom: 1rem;
    animation: fadeIn 0.6s ease-out;
}

.logo {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    background: url('/assets/favicons/depo.bo/android-chrome-512x512.png') center/contain no-repeat;
}

/* Branding debajo del logo */
.branding {
    margin-top: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

/* Icono de éxito */
.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease-out 0.3s both;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    stroke: white;
}

.error-code,
.status-code {
    font-size: 8rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 1rem;
    animation: slideUp 0.8s ease-out;
}

.status-code {
    font-size: 3rem;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-title,
.success-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    animation: slideUp 0.8s ease-out 0.1s both;
}

.error-description,
.success-description {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    animation: slideUp 0.8s ease-out 0.2s both;
}

/* Mensaje personalizable */
.custom-message {
    background: #f5f5f5;
    border-left: 4px solid #667eea;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    text-align: left;
    animation: slideUp 0.8s ease-out 0.25s both;
}

.custom-message strong {
    display: block;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.custom-message p {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: slideUp 0.8s ease-out 0.3s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #1a1a1a;
    color: #ffffff;
}

.btn-primary:hover {
    background: #333;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: #1a1a1a;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

/* Botones de éxito con gradiente */
.success-page .btn-primary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.success-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

.footer {
    margin-top: 4rem;
    font-size: 0.875rem;
    color: #999;
    animation: fadeIn 1s ease-out 0.5s both;
}

.success-page .footer {
    color: rgba(255, 255, 255, 0.9);
}

/* Detalles técnicos */
.tech-details {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    max-height: 300px;
    overflow-y: auto;
}

.tech-details h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tech-details table {
    width: 100%;
    border-collapse: collapse;
}

.tech-details td {
    padding: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.tech-details td:first-child {
    font-weight: 600;
    color: #666;
    width: 140px;
}

.tech-details td:last-child {
    color: #333;
    word-break: break-all;
}

.error-stack {
    background: #2d2d2d;
    color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.813rem;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* Selector de idioma */
.lang-switcher {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.lang-switcher a {
    padding: 0.5rem 0.75rem;
    background: #f5f5f5;
    border-radius: 6px;
    text-decoration: none;
    color: #1a1a1a;
    font-size: 0.875rem;
    transition: all 0.2s;
    font-weight: 500;
}

.lang-switcher a:hover {
    background: #e0e0e0;
}

.lang-switcher a.active {
    background: #1a1a1a;
    color: white;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Responsive */
@media (max-width: 640px) {
    .error-code {
        font-size: 6rem;
    }

    .status-code {
        font-size: 2.5rem;
    }

    .error-title,
    .success-title {
        font-size: 1.25rem;
    }

    .error-description,
    .success-description {
        font-size: 0.9375rem;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .custom-message {
        padding: 0.875rem 1.25rem;
    }

    .lang-switcher {
        top: 1rem;
        right: 1rem;
    }
}

/* ============================================
   EXTENSIONES PARA TIPOS PERSONALIZADOS
   ============================================ */

/* Estilos dinámicos para barras (colores desde PHP) */
.status-bar.top { z-index: 1001; }
.status-bar.bottom { z-index: 1000; }

/* Sección de datos técnicos desplegable */
.error-data-section { 
    margin: 2rem 0; 
    border-radius: 8px; 
    overflow: hidden; 
}

.btn-toggle-data {
    background: #f8f9fa; 
    border: 1px solid #dee2e6; 
    padding: 1rem 1.5rem;
    width: 100%; 
    text-align: left; 
    cursor: pointer; 
    display: flex;
    align-items: center; 
    justify-content: space-between; 
    font-weight: 600;
    transition: all 0.2s; 
    border-radius: 8px 8px 0 0;
}

.btn-toggle-data:hover { 
    background: #e9ecef; 
}

.error-data-content {
    background: #f8f9fa; 
    border: 1px solid #dee2e6; 
    border-top: none;
    padding: 0; 
    max-height: 0; 
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    border-radius: 0 0 8px 8px;
}

.error-data-content.show { 
    max-height: 5000px; 
    padding: 1.5rem; 
}

.data-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 1.5rem; 
}

.data-table td { 
    padding: 0.75rem; 
    border-bottom: 1px solid #dee2e6; 
    vertical-align: top; 
}

.data-table td:first-child { 
    font-weight: 600; 
    color: #495057; 
    width: 200px; 
}

.data-table td:last-child { 
    color: #6c757d; 
    font-family: 'Courier New', monospace; 
    font-size: 0.9em; 
    word-break: break-all; 
}

.data-badge {
    display: inline-block; 
    padding: 0.25rem 0.75rem; 
    border-radius: 4px;
    font-size: 0.85em; 
    font-weight: 600; 
    margin-right: 0.5rem;
}

.highlight-row { 
    background: #fff3cd !important; 
}

.diagnostico {
    background: #e7f3ff; 
    border-left: 4px solid #2196F3;
    padding: 1rem; 
    margin: 1rem 0; 
    border-radius: 4px;
}

.log-section {
    background: #2d2d2d; 
    color: #f8f8f2; 
    padding: 1rem;
    border-radius: 4px; 
    font-family: 'Courier New', monospace;
    font-size: 0.85em; 
    overflow-x: auto; 
    margin-top: 0.5rem;
    max-height: 200px; 
    overflow-y: auto;
}

.section-title {
    font-weight: 600; 
    color: #333; 
    margin: 1.5rem 0 0.5rem 0;
    padding-bottom: 0.5rem; 
    border-bottom: 2px solid #dee2e6;
}

/* Badge de tipo personalizado */
.badge-type {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0.5rem 0;
}

.badge-type.success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.badge-type.info {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
}

.badge-type.warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
}

.badge-type.error {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

.badge-type.critical {
    background: linear-gradient(135deg, #DC2626, #991B1B);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Actualizar custom-message para soportar tipos */
.custom-message.success {
    border-left-color: #10B981;
    background: #f0fdf4;
}

.custom-message.info {
    border-left-color: #3B82F6;
    background: #eff6ff;
}

.custom-message.warning {
    border-left-color: #F59E0B;
    background: #fffbeb;
}

.custom-message.error,
.custom-message.critical {
    border-left-color: #EF4444;
    background: #fef2f2;
}

/* Sección de datos personalizados */
.custom-data-section {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.custom-data-table {
    width: 100%;
    margin-top: 1rem;
}

.custom-data-table dt {
    font-weight: 600;
    color: #374151;
    margin-top: 0.75rem;
    font-size: 0.95em;
}

.custom-data-table dd {
    margin-left: 0;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 4px;
    margin-top: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #6b7280;
}

/* ============================================
   BOTÓN DE CONTACTO
   ============================================ */

.contact-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.contact-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.contact-modal.show {
    display: flex;
}

.contact-modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
}

.contact-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
}

.contact-modal-close:hover {
    color: #1f2937;
}

.contact-info {
    margin-top: 1rem;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.contact-info-item svg {
    flex-shrink: 0;
}

.contact-info-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9em;
    margin-bottom: 0.25rem;
}

.contact-info-value {
    color: #6b7280;
    font-size: 0.95em;
}

.contact-info-value a {
    color: #3B82F6;
    text-decoration: none;
}

.contact-info-value a:hover {
    text-decoration: underline;
}

/* Responsive para nuevos elementos */
@media (max-width: 640px) {
    .contact-button {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem 1.25rem;
        font-size: 0.9em;
    }
    
    .badge-type {
        font-size: 0.8em;
        padding: 0.4rem 0.8rem;
    }
}

/* ============================================
   CORRECCIONES DISEÑO MODAL DE CONTACTO
   ============================================ */

/* Mejorar z-index y backdrop */
.contact-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.contact-modal.show {
    display: flex;
}

.contact-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.contact-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.contact-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: rotate(90deg);
}

.contact-info {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.contact-info-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateX(4px);
}

.contact-info-item svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.contact-info-item > div {
    flex: 1;
    min-width: 0;
}

.contact-info-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875em;
    margin-bottom: 0.25rem;
    display: block;
}

.contact-info-value {
    color: #6b7280;
    font-size: 0.95em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.contact-info-value a {
    color: #3B82F6;
    text-decoration: none;
    transition: color 0.2s;
}

.contact-info-value a:hover {
    color: #2563EB;
    text-decoration: underline;
}

/* Botón de contacto mejorado */
.contact-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
    transition: all 0.3s;
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideInBottom 0.5s ease-out;
}

.contact-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.5);
}

.contact-button:active {
    transform: translateY(-1px);
}

/* Responsive mejorado */
@media (max-width: 640px) {
    .contact-button {
        bottom: 1rem;
        right: 1rem;
        padding: 0.875rem 1.25rem;
        font-size: 0.875em;
    }

    .contact-button span {
        display: none;
    }

    .contact-button svg {
        margin: 0;
    }

    .contact-modal {
        padding: 0.5rem;
    }

    .contact-modal-content {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .contact-info-item {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .contact-info-item svg {
        margin-top: 0;
    }
}

/* Animación para scroll suave */
.contact-modal-content::-webkit-scrollbar {
    width: 8px;
}

.contact-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.contact-modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.contact-modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Título del modal mejorado */
.contact-modal-content h2 {
    margin-bottom: 1.5rem;
    color: #1f2937;
    font-size: 1.5rem;
    padding-right: 2rem;
}

/* Badge de empresa destacado */
.contact-info-item:last-child {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #bfdbfe;
}

.contact-info-item:last-child .contact-info-label,
.contact-info-item:last-child .contact-info-value {
    color: #1e40af;
}

/* Prevenir scroll del body cuando modal está abierto */
body.modal-open {
    overflow: hidden;
}
