/* =====================================================
   SISTEMA DE CINTA DE ANUNCIO ANIMADA CON TEMAS DINÁMICOS
   ===================================================== */

.announcement-ribbon {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    width: 100%;
    height: 56px;
    min-height: 56px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(90deg, #111827, #0f172a);
    color: #f8fafc;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 10px 26px rgba(2, 6, 23, 0.35);
    animation: slideDown 0.5s ease-out;
    transition: transform 0.28s ease, opacity 0.22s ease, background 0.3s ease, color 0.3s ease, min-height 0.2s ease;
    overflow: hidden;
}

.announcement-ribbon.is-collapsed {
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
}

.announcement-ribbon.is-hidden {
    display: none;
}

/* Temas de colores dinámicos */
.announcement-ribbon.theme-yellow {
    background: linear-gradient(90deg, #0f172a 0%, #2563eb 55%, #ef4444 100%);
    color: #ffffff;
}

.announcement-ribbon.theme-red {
    background: linear-gradient(90deg, #d90000 0%, #ff1a1a 100%);
    color: #fff8f8;
}

.announcement-ribbon.theme-blue {
    background: linear-gradient(90deg, #003bff 0%, #007bff 100%);
    color: #ffffff;
}

.announcement-ribbon.theme-black {
    background: linear-gradient(90deg, #000000 0%, #0a0a0a 100%);
    color: #ffffff;
}

.announcement-ribbon.theme-green {
    background: linear-gradient(90deg, #00a63e 0%, #00e65c 100%);
    color: #001a09;
}

.announcement-ribbon.theme-purple {
    background: linear-gradient(90deg, #5c00cc 0%, #a000ff 100%);
    color: #ffffff;
}

/* Color fijo por layout para asegurar cambio con cada info */
.announcement-ribbon[data-layout='ticker'] {
    background: linear-gradient(90deg, #d90000 0%, #ff1a1a 100%) !important;
    color: #ffffff !important;
}

.announcement-ribbon[data-layout='message'] {
    background: linear-gradient(90deg, #0f172a 0%, #2563eb 55%, #ef4444 100%) !important;
    color: #ffffff !important;
}

.announcement-ribbon[data-layout='image'] {
    background: linear-gradient(90deg, #000000 0%, #0a0a0a 100%) !important;
    color: #ffffff !important;
}

.announcement-ribbon[data-layout='columns'] {
    background: linear-gradient(90deg, #00a63e 0%, #00e65c 100%) !important;
    color: #001a09 !important;
}

.ribbon-layout {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.announcement-ribbon[data-layout='ticker'] .ribbon-layout-ticker,
.announcement-ribbon[data-layout='message'] .ribbon-layout-message,
.announcement-ribbon[data-layout='image'] .ribbon-layout-image,
.announcement-ribbon[data-layout='columns'] .ribbon-layout-columns {
    display: flex;
}

.ribbon-layout-ticker {
    overflow: hidden;
}

.ribbon-layout-image {
    padding: 0 !important;
}

.ribbon-image-viewport {
    position: relative;
    width: 100%;
    height: 56px;
    border-radius: 0;
    overflow: hidden;
    border: 0;
}

.ribbon-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
}

.ribbon-image-a {
    animation: ribbonImageSwapA 8s infinite;
}

.ribbon-image-b {
    animation: ribbonImageSwapB 8s infinite;
}

.ribbon-ticker-track {
    display: inline-flex;
    gap: 24px;
    white-space: nowrap;
    font-weight: 900;
    letter-spacing: 0.04em;
    animation: ribbonTicker 20s linear infinite;
    text-transform: uppercase;
}

.ribbon-ticker-track span::after {
    content: "•";
    margin-left: 12px;
    opacity: 0.6;
}

/* Contenedor del texto animado */
.ribbon-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 100%;
    width: 100%;
    animation: shimmer 4s infinite;
}

.ribbon-layout-message .ribbon-content {
    justify-content: center;
    gap: 14px;
}

.ribbon-layout-message .ribbon-text {
    flex: 0 1 auto;
    text-align: center;
}

.ribbon-icon {
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
    animation: pulse 2.4s infinite;
    flex: 0 0 auto;
}

.ribbon-text {
    display: block;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.02em;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ribbon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.38);
    backdrop-filter: blur(10px);
    margin-left: 6px;
    flex: 0 0 auto;
}

.ribbon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
}

.ribbon-link:hover {
    background: rgba(255, 255, 255, 0.35);
}

.ribbon-columns {
    width: min(1200px, 100%);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: center;
}

.ribbon-col {
    border: 0 !important;
    border-radius: 0;
    padding: 0;
    background: transparent !important;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: none !important;
}

.ribbon-col strong {
    display: inline-block;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    animation: ribbonColPulseA 2.2s ease-in-out infinite;
}

.ribbon-col:nth-child(2) strong { animation-name: ribbonColPulseB; }
.ribbon-col:nth-child(3) strong { animation-name: ribbonColPulseC; }

.ribbon-close-btn {
    display: none !important;
}

.ribbon-close-btn:hover {
    display: none !important;
}

/* =====================================================
   BOTÓN FLOTANTE DE NOTIFICACIONES
   ===================================================== */

.notification-floating-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 90;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.notification-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.6);
}

.notification-floating-btn.is-hidden {
    display: none;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    animation: pulse 2s infinite;
}

/* =====================================================
   PANEL FLOTANTE DE NOTIFICACIONES
   ===================================================== */

.notification-panel {
    position: fixed;
    bottom: 100px;
    right: 32px;
    z-index: 89;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
    animation: none;
}

.notification-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    animation: slideUp 0.3s ease;
}

.notification-panel.is-hidden {
    display: none;
}

.notification-panel-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-panel-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.notification-panel-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.notification-panel-content {
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
}

.notification-item {
    padding: 12px;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 3px solid #3b82f6;
    transition: all 0.2s ease;
}

.notification-item:hover {
    background: #e5e7eb;
    transform: translateX(4px);
}

.notification-item-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 13px;
    margin-bottom: 4px;
}

.notification-item-text {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.notification-panel-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.notification-enable-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 55%, #ef4444 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.notification-enable-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* =====================================================
   MODAL DE SUSCRIPCIÓN A NOTIFICACIONES
   ===================================================== */

.notification-subscribe-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.notification-subscribe-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.notification-subscribe-modal.is-hidden {
    display: none;
}

.notification-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

.notification-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0f172a, #2563eb, #ef4444);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

.notification-modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 55%, #ef4444 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #ffffff;
    margin: 0 auto 20px;
    animation: bounce 1s ease infinite;
}

.notification-modal-title {
    font-size: 24px;
    font-weight: 900;
    color: #0f172a;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.2;
}

.notification-modal-subtitle {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    margin-bottom: 24px;
}

.notification-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-modal-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.notification-modal-btn.primary {
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 55%, #ef4444 100%);
    color: #ffffff;
}

.notification-modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.notification-modal-btn.secondary {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.notification-modal-btn.secondary:hover {
    background: #e5e7eb;
}

/* =====================================================
   ANIMACIONES
   ===================================================== */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes ribbonTicker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes ribbonColPulseA {
    0%, 100% { transform: translateY(0); opacity: 0.9; }
    50% { transform: translateY(-1px); opacity: 1; color: #ffffff; }
}

@keyframes ribbonColPulseB {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.03); opacity: 1; color: #111; background: rgba(255,255,255,.16); }
}

@keyframes ribbonColPulseC {
    0%, 100% { letter-spacing: 0.05em; opacity: 0.9; }
    50% { letter-spacing: 0.08em; opacity: 1; color: #ffef5a; }
}

@keyframes ribbonImageSwapA {
    0%, 45% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes ribbonImageSwapB {
    0%, 45% { opacity: 0; }
    50%, 95% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 200% 0;
    }
    50% {
        background-position: 0 0;
    }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .announcement-ribbon {
        height: 54px;
        min-height: 54px;
        padding: 0;
        font-size: 12px;
    }

    .ribbon-content {
        gap: 8px;
        align-items: center;
    }

    .ribbon-icon {
        width: 24px;
        height: 24px;
        margin-top: 0;
    }

    .notification-floating-btn {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .notification-panel {
        bottom: 80px;
        right: 20px;
        width: calc(100% - 40px);
        max-width: 340px;
    }

    .notification-modal-content {
        padding: 30px 20px;
    }

    .ribbon-link {
        display: none;
    }

    .ribbon-columns {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .ribbon-col:nth-child(n+2) {
        display: none;
    }
}

@media (max-width: 480px) {
    .announcement-ribbon {
        height: 50px;
        min-height: 50px;
        padding: 0;
        font-size: 11px;
    }

    .ribbon-badge {
        display: none;
    }

    .ribbon-text {
        font-size: 10px;
    }

    .notification-panel {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 70px;
    }

    .notification-modal-content {
        width: 95%;
        padding: 24px 16px;
    }
}
