/**
 * License Expiry Alert Component Styles
 * =====================================
 * 
 * Alert banner for license expiry notifications.
 * 
 * Urgency Levels:
 * - Critical (≤1 day): Red styling with pulse animation
 * - Warning (≤2 days): Amber styling
 * - Notice (≤3 days): Blue styling
 */

/* ============================================
   CSS Custom Properties
   ============================================ */
.license-expiry-alert {
    /* Base colors - Notice level (≤3 days) */
    --lea-bg: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    --lea-border: #93c5fd;
    --lea-text: #1e40af;
    --lea-text-secondary: #3b82f6;
    --lea-icon-bg: rgba(59, 130, 246, 0.15);
    --lea-icon-color: #3b82f6;
    --lea-btn-bg: #3b82f6;
    --lea-btn-hover: #2563eb;
}

/* Warning Level (≤2 days) */
.license-expiry-alert.license-expiry-warning {
    --lea-bg: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    --lea-border: #fcd34d;
    --lea-text: #92400e;
    --lea-text-secondary: #d97706;
    --lea-icon-bg: rgba(245, 158, 11, 0.15);
    --lea-icon-color: #f59e0b;
    --lea-btn-bg: #f59e0b;
    --lea-btn-hover: #d97706;
}

/* Critical Level (≤1 day) */
.license-expiry-alert.license-expiry-critical {
    --lea-bg: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    --lea-border: #fca5a5;
    --lea-text: #991b1b;
    --lea-text-secondary: #dc2626;
    --lea-icon-bg: rgba(239, 68, 68, 0.15);
    --lea-icon-color: #ef4444;
    --lea-btn-bg: #ef4444;
    --lea-btn-hover: #dc2626;
}

/* ============================================
   Main Alert Container
   ============================================ */
.license-expiry-alert {
    width: 100%;
    background: var(--lea-bg);
    border-bottom: 2px solid var(--lea-border);
    padding: 0.875rem 1rem;
    margin-bottom: 0;
}

/* Critical level pulse effect */
.license-expiry-alert.license-expiry-critical {
    animation: leaBgPulse 2s ease-in-out infinite;
}

.license-expiry-alert__container {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

/* ============================================
   Icon Wrapper
   ============================================ */
.license-expiry-alert__icon-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--lea-icon-bg);
    border-radius: 12px;
}

.license-expiry-alert__icon {
    color: var(--lea-icon-color);
    width: 24px;
    height: 24px;
}

/* Pulse animation for critical icon */
.license-expiry-alert__icon--pulse {
    animation: leaIconPulse 1.5s ease-in-out infinite;
}

/* ============================================
   Content
   ============================================ */
.license-expiry-alert__content {
    flex: 1;
    min-width: 0;
}

.license-expiry-alert__title {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--lea-text);
    line-height: 1.3;
}

.license-expiry-alert__text {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--lea-text-secondary);
}

.license-expiry-alert__clock-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.license-expiry-alert__countdown {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Renew Button
   ============================================ */
.license-expiry-alert__actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.license-expiry-alert__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.license-expiry-alert__btn--renew {
    padding: 0.625rem 1.25rem;
    background: var(--lea-btn-bg);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.license-expiry-alert__btn--renew:hover,
.license-expiry-alert__btn--renew:focus {
    background: var(--lea-btn-hover);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.license-expiry-alert__btn--renew:active {
    transform: translateY(0);
}

.license-expiry-alert__btn--renew svg {
    transition: transform 0.2s ease;
}

.license-expiry-alert__btn--renew:hover svg {
    transform: translateX(2px);
}

/* ============================================
   Dismiss Button
   ============================================ */
.license-expiry-alert__btn--dismiss {
    width: 36px;
    height: 36px;
    padding: 0;
    margin-left: 0.5rem;
    background: transparent;
    color: var(--lea-text-secondary);
    border-radius: 50%;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.license-expiry-alert__btn--dismiss:hover {
    background: var(--lea-icon-bg);
    color: var(--lea-text);
    opacity: 1;
    transform: scale(1.05);
}

.license-expiry-alert__btn--dismiss:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--lea-border);
}

.license-expiry-alert__btn--dismiss:active {
    transform: scale(0.95);
}

.license-expiry-alert__btn--dismiss svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.license-expiry-alert__btn--dismiss:hover svg {
    transform: rotate(90deg);
}

/* ============================================
   Animations
   ============================================ */
@keyframes leaBgPulse {

    0%,
    100% {
        background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    }

    50% {
        background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    }
}

@keyframes leaIconPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .license-expiry-alert {
        padding: 0.625rem 0.75rem;
    }

    .license-expiry-alert__container {
        flex-wrap: wrap;
        gap: 0.625rem;
    }

    .license-expiry-alert__icon-wrapper {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .license-expiry-alert__icon {
        width: 18px;
        height: 18px;
    }

    .license-expiry-alert__title {
        font-size: 0.9rem;
        margin-bottom: 0.125rem;
    }

    .license-expiry-alert__text {
        font-size: 0.8rem;
        gap: 0.375rem;
    }

    .license-expiry-alert__clock-icon {
        width: 14px;
        height: 14px;
    }

    .license-expiry-alert__content {
        flex: 1 1 calc(100% - 56px);
        order: 1;
    }

    .license-expiry-alert__actions {
        order: 2;
        margin-left: auto;
        gap: 0.5rem;
    }

    .license-expiry-alert__btn--renew {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .license-expiry-alert__btn--dismiss {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 576px) {
    .license-expiry-alert {
        padding: 0.5rem 0.625rem;
    }

    .license-expiry-alert__container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
    }

    .license-expiry-alert__icon-wrapper {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .license-expiry-alert__icon {
        width: 16px;
        height: 16px;
    }

    .license-expiry-alert__content {
        flex: 1 1 0;
        min-width: 0;
        order: 1;
    }

    .license-expiry-alert__title {
        font-size: 0.8rem;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .license-expiry-alert__text {
        font-size: 0.75rem;
        gap: 0.25rem;
    }

    .license-expiry-alert__clock-icon {
        width: 12px;
        height: 12px;
    }

    .license-expiry-alert__actions {
        order: 2;
        flex-shrink: 0;
        gap: 0.375rem;
    }

    .license-expiry-alert__btn--renew {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        border-radius: 6px;
    }

    .license-expiry-alert__btn--renew svg {
        width: 12px;
        height: 12px;
    }

    .license-expiry-alert__btn--dismiss {
        width: 28px;
        height: 28px;
    }

    .license-expiry-alert__btn--dismiss svg {
        width: 12px;
        height: 12px;
    }
}

/* Extra small screens (below 400px) */
@media (max-width: 400px) {
    .license-expiry-alert {
        padding: 0.375rem 0.5rem;
    }

    .license-expiry-alert__container {
        gap: 0.375rem;
    }

    .license-expiry-alert__icon-wrapper {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    .license-expiry-alert__icon {
        width: 14px;
        height: 14px;
    }

    .license-expiry-alert__title {
        font-size: 0.75rem;
    }

    .license-expiry-alert__text {
        font-size: 0.7rem;
    }

    .license-expiry-alert__btn--renew {
        padding: 0.3125rem 0.625rem;
        font-size: 0.7rem;
    }

    .license-expiry-alert__btn--renew span {
        display: none;
    }

    .license-expiry-alert__btn--renew svg {
        width: 14px;
        height: 14px;
    }

    .license-expiry-alert__btn--dismiss {
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {

    .license-expiry-alert,
    .license-expiry-alert.license-expiry-critical,
    .license-expiry-alert__icon--pulse,
    .license-expiry-alert__btn--renew svg {
        animation: none;
        transition: none;
    }
}

@media (prefers-contrast: high) {
    .license-expiry-alert {
        border-width: 3px;
    }

    .license-expiry-alert__btn--renew {
        border: 2px solid currentColor;
    }
}

.license-expiry-alert__btn:focus-visible {
    outline: 2px solid var(--lea-btn-bg);
    outline-offset: 2px;
}