﻿/* ==========================================================================
   LICENSE MANAGER STYLES
   - Banner warning per licenza in scadenza (dashboard)
   - Overlay blocco totale per licenza scaduta
   ========================================================================== */

/* ==========================================================================
   1. OVERLAY BLOCCO LICENZA SCADUTA
   ========================================================================== */
.license-expired-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

    .license-expired-overlay.visible {
        opacity: 1;
    }

.license-expired-card {
    background: white;
    border-radius: 24px;
    padding: 3rem 2.5rem;
    max-width: 540px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: translateY(20px) scale(0.96);
    animation: licenseCardAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

@keyframes licenseCardAppear {
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.license-expired-icon {
    color: #ef4444;
    margin-bottom: 1.5rem;
    animation: shieldPulse 2s ease-in-out infinite;
}

@keyframes shieldPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.license-expired-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.license-expired-subtitle {
    font-size: 1rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.license-days-ago {
    display: inline-block;
    background: #fef2f2;
    color: #dc2626;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 4px;
}

.license-expired-message {
    background: linear-gradient(135deg, #fef3c7, #fef9c3);
    border: 1px solid #fcd34d;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
    margin-bottom: 1.5rem;
}

    .license-expired-message i {
        color: #d97706;
        font-size: 1.2rem;
        margin-top: 2px;
        flex-shrink: 0;
    }

    .license-expired-message span {
        font-size: 0.9rem;
        color: #92400e;
        line-height: 1.5;
    }

.license-expired-actions {
    margin-bottom: 1.5rem;
}

.license-contact-info {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    text-align: left;
}

    .license-contact-info p {
        margin: 0.5rem 0;
        color: #475569;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .license-contact-info i {
        color: #2563eb;
        font-size: 1rem;
        width: 20px;
        text-align: center;
    }

.license-expired-footer {
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

    .license-expired-footer small {
        color: #94a3b8;
        font-size: 0.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    .license-expired-footer i {
        color: #10b981;
    }

/* ==========================================================================
   2. BANNER WARNING LICENZA IN SCADENZA
   ========================================================================== */
.license-warning-banner {
    border-radius: 16px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

    .license-warning-banner.visible {
        transform: translateY(0);
        opacity: 1;
    }

    .license-warning-banner.dismissing {
        transform: translateY(-20px);
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding: 0;
    }

/* --- Variante Warning (>7 giorni) --- */
.license-banner-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fcd34d;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15);
}

    .license-banner-warning .license-banner-icon {
        background: linear-gradient(135deg, #f59e0b, #d97706);
        color: white;
    }

    .license-banner-warning .license-banner-text strong:first-child {
        color: #92400e;
    }

    .license-banner-warning .license-banner-text span {
        color: #78350f;
    }

/* --- Variante Critical (≤7 giorni) --- */
.license-banner-critical {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    border: 1px solid #f87171;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    animation: criticalPulse 3s ease-in-out infinite;
}

@keyframes criticalPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    }

    50% {
        box-shadow: 0 4px 20px rgba(239, 68, 68, 0.35);
    }
}

.license-banner-critical .license-banner-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    animation: iconShake 4s ease-in-out infinite;
}

@keyframes iconShake {
    0%, 85%, 100% {
        transform: rotate(0deg);
    }

    88% {
        transform: rotate(-8deg);
    }

    91% {
        transform: rotate(8deg);
    }

    94% {
        transform: rotate(-4deg);
    }

    97% {
        transform: rotate(4deg);
    }
}

.license-banner-critical .license-banner-text strong:first-child {
    color: #991b1b;
}

.license-banner-critical .license-banner-text span {
    color: #7f1d1d;
}

/* --- Layout banner content --- */
.license-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.license-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.license-banner-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
}

    .license-banner-text strong:first-child {
        display: block;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 2px;
    }

.license-banner-close {
    background: rgba(0, 0, 0, 0.08);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: inherit;
}

    .license-banner-close:hover {
        background: rgba(0, 0, 0, 0.15);
        transform: scale(1.05);
    }

/* --- Progress bar nel banner critical --- */
.license-banner-progress {
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
}

.license-banner-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316);
    border-radius: 0 2px 2px 0;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   3. TOAST FEEDBACK BLOCCO
   ========================================================================== */
.license-blocked-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

    .license-blocked-toast.visible {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .license-blocked-toast i {
        color: #f87171;
        font-size: 1.1rem;
    }

/* ==========================================================================
   4. ELEMENTI DISABILITATI DA LICENZA
   ========================================================================== */
.license-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ==========================================================================
   5. RESPONSIVE
   ========================================================================== */
@media (max-width: 576px) {
    .license-expired-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .license-expired-title {
        font-size: 1.4rem;
    }

    .license-expired-icon svg {
        width: 60px;
        height: 60px;
    }

    .license-banner-content {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .license-banner-text {
        font-size: 0.85rem;
    }

    .license-blocked-toast {
        left: 15px;
        right: 15px;
        transform: translateX(0) translateY(20px);
        white-space: normal;
        text-align: center;
        justify-content: center;
    }

        .license-blocked-toast.visible {
            transform: translateX(0) translateY(0);
        }
}
