/**
 * Estilos para Sistema de Notificaciones IN-APP - Billetaxo
 * Diseño moderno y responsive
 */

/* =====================================================
   DROPDOWN DE NOTIFICACIONES (Header)
   ===================================================== */

.header-notifications {
    position: relative !important;
}

/* Estilos específicos para btn-notifications - TAMAÑO FIJO en ambos idiomas */
.header-notifications .btn-notifications,
.btn-notifications {
    position: relative !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 0.5rem !important;
    font-size: 1.5rem !important; /* Tamaño fijo de la campanita */
    color: #023047 !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    min-height: auto !important;
    line-height: 1 !important;
}

/* Asegurar que el emoji de la campanita tenga tamaño fijo */
.header-notifications .btn-notifications span:first-child,
.btn-notifications span:first-child {
    font-size: 1.5rem !important;
    line-height: 1 !important;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
}

.header-notifications .btn-notifications:hover,
.btn-notifications:hover {
    color: #1E3A8A !important;
    transform: scale(1.1) !important;
}

/* Badge SOLO NÚMERO - sin punto rojo */
.header-notifications .notification-badge,
.notification-badge {
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    background: transparent !important; /* Sin fondo rojo */
    color: #EF4444 !important; /* Número en rojo */
    border-radius: 0 !important; /* Sin círculo */
    min-width: auto !important;
    height: auto !important;
    display: none !important; /* Oculto por defecto, se mostrará solo si count > 0 */
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.9rem !important; /* Aumentado para mejor legibilidad */
    font-weight: 700 !important;
    padding: 0 !important;
    border: none !important; /* Sin border */
    z-index: 10 !important;
    box-shadow: none !important; /* Sin sombra */
    line-height: 1 !important;
    text-align: center !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8); /* Sombra blanca para legibilidad */
}

/* Badge visible cuando tiene contenido */
.notification-badge:not([style*="display: none"]) {
    display: flex !important;
}

/* Asegurar que el contenido del badge (número) esté centrado */
.header-notifications .notification-badge *,
.notification-badge * {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    text-align: center !important;
}

/* Badge en móvil - mismo tamaño */
@media (max-width: 1023px) {
    .header-notifications .notification-badge,
    .notification-badge {
        top: -6px !important;
        right: -6px !important;
        font-size: 0.9rem !important; /* Mismo tamaño en móvil */
    }
}

.notifications-dropdown {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    min-width: 360px;
    max-width: 420px;
    max-height: 600px;
    overflow: hidden;
    z-index: 9999 !important;
    animation: slideDown 0.2s ease-out;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    margin-top: 0.5rem !important;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.2s ease-out;
}

.notifications-dropdown[style*="display: block"],
.notifications-dropdown:not([style*="display: none"]) {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notifications-dropdown-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid #F3F4F6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, #FAFBFC, white);
}

.notifications-dropdown-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #023047;
    letter-spacing: -0.01em;
}

.btn-close-dropdown {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #6B7280;
    padding: 0.375rem;
    line-height: 1;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-close-dropdown:hover {
    background: #F3F4F6;
    color: #374151;
}

.notifications-list {
    max-height: 450px;
    overflow-y: auto;
    padding: 0.5rem;
}

.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
    background: #F9FAFB;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

.notification-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    border: 1px solid transparent;
    position: relative;
}

.notification-item:hover {
    background: #F9FAFB;
    border-color: #E5E7EB;
    transform: translateX(2px);
}

.notification-item:active {
    transform: translateX(0);
}

.notification-item.notification-unread {
    background: linear-gradient(to right, #EFF6FF 0%, #FFFFFF 100%);
    border-left: 3px solid #3B82F6;
}

.notification-item.notification-unread:hover {
    background: linear-gradient(to right, #DBEAFE 0%, #F9FAFB 100%);
}

.notification-unread-dot {
    width: 10px;
    height: 10px;
    background: #3B82F6;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.5rem;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.2);
    }
}

.notification-item-title {
    font-weight: 600;
    color: #023047;
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.notification-item.notification-unread .notification-item-title {
    font-weight: 700;
}

.notification-item-body {
    color: #6B7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.notification-item-time {
    color: #9CA3AF;
    font-size: 0.8125rem;
    font-weight: 500;
}

.notifications-dropdown-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #F3F4F6;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #FAFBFC;
}

.btn-mark-all-read {
    background: #1E3A8A;
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    letter-spacing: 0.01em;
}

.btn-mark-all-read:hover:not(:disabled) {
    background: #1E40AF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

.btn-mark-all-read:active:not(:disabled) {
    transform: translateY(0);
}

.btn-mark-all-read:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.notifications-view-all {
    color: #1E3A8A;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.notifications-view-all:hover {
    background: #EFF6FF;
    color: #1E40AF;
}

/* Estados del dropdown */
.notification-state {
    padding: 3rem 2rem;
    text-align: center;
    color: #6B7280;
}

.notification-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

.notification-empty {
    padding: 3rem 2rem;
}

.notification-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.notification-empty-text {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.notification-empty-desc {
    font-size: 0.875rem;
    color: #6B7280;
}

.notification-error {
    padding: 3rem 2rem;
    color: #EF4444;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* =====================================================
   PÁGINA DE NOTIFICACIONES (/notifications)
   ===================================================== */

.notifications-page {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.notifications-header {
    margin-bottom: 2rem;
}

.notifications-header h1 {
    font-size: 2.25rem;
    color: #023047;
    margin: 0 0 0.5rem 0;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.notifications-header p {
    color: #6B7280;
    font-size: 1.0625rem;
    margin: 0;
    line-height: 1.6;
}

.notifications-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 1.75rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: none;
    letter-spacing: 0.01em;
}

.btn-back {
    background: white;
    color: #374151;
    border: 1.5px solid #E5E7EB;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-back:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-mark-all-read {
    background: linear-gradient(135deg, #1E3A8A 0%, #1E40AF 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

.btn-mark-all-read:hover:not(:disabled) {
    background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.35);
}

.btn-mark-all-read:active:not(:disabled) {
    transform: translateY(0);
}

.notifications-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #F3F4F6;
}

.notifications-list-page {
    min-height: 300px;
}

.notification-item-page {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #F3F4F6;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.notification-item-page:last-child {
    border-bottom: none;
}

.notification-item-page:hover {
    background: #F9FAFB;
    padding-left: 2rem;
}

.notification-item-page.notification-unread {
    background: linear-gradient(to right, #EFF6FF 0%, #FFFFFF 100%);
    border-left: 4px solid #3B82F6;
}

.notification-item-page.notification-unread:hover {
    background: linear-gradient(to right, #DBEAFE 0%, #F9FAFB 100%);
    padding-left: 2rem;
}

.notification-item-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.notification-item-page.notification-unread .notification-icon {
    background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.notification-item-details {
    flex: 1;
    min-width: 0;
}

.notification-item-title-page {
    font-weight: 700;
    color: #023047;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.4;
}

.notification-item-page.notification-unread .notification-item-title-page {
    color: #1E3A8A;
}

.notification-item-body-page {
    color: #6B7280;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.notification-item-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: #9CA3AF;
}

.notification-item-time-page {
    font-weight: 500;
}

.notification-item-type {
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    background: #F3F4F6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.notification-item-page.notification-unread .notification-item-type {
    background: #DBEAFE;
    color: #1E40AF;
}

/* Responsive - MODAL FUNCIONA IGUAL EN WEB Y MOBILE */
@media (max-width: 1023px) {
    /* Mobile: modal responsive pero funcional */
    .notifications-dropdown {
        min-width: calc(100vw - 2rem) !important;
        max-width: calc(100vw - 2rem) !important;
        max-height: 70vh !important;
        position: fixed !important;
        z-index: 9999 !important;
        /* El JS ajustará la posición desde el botón */
    }
    
    .notifications-page {
        margin: 1rem auto;
        padding: 0 0.75rem;
    }
    
    .notifications-header h1 {
        font-size: 1.75rem;
    }
    
    .notifications-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
    }
    
    .notification-item-page {
        padding: 1rem;
    }
    
    .notification-item-page:hover {
        padding-left: 1rem;
    }
}

/* Desktop: mantiene posición absolute */
@media (min-width: 1024px) {
    .notifications-dropdown {
        position: absolute !important;
        min-width: 360px !important;
        max-width: 420px !important;
    }
}
