/**
 * Dashboard Common Styles
 * 
 * Shared styles used across all dashboard pages:
 * - Pricing/feature gating (blur-disabled, upgrade-badge)
 * - Navigation enhancements
 * - Alert/message notifications
 */

/* ==========================================================================
   FEATURE GATING - Blur/Disable for Locked Features
   ========================================================================== */

.blur-disabled {
    filter: blur(1.2px) grayscale(0.18);
    opacity: 0.9;
    pointer-events: none;
    cursor: default;
}

.blur-disabled[aria-disabled="true"]::after {
    content: "\f023"; /* lock glyph via FontAwesome */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: 8px;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* ==========================================================================
   UPGRADE BADGE - Navigation Item Enhancement
   ========================================================================== */

/* Icon-only upgrade badge placed inline next to nav item */
.upgrade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.14), rgba(6, 182, 212, 0.04));
    color: var(--accent, #06b6d4);
    border: 1px solid rgba(6, 182, 212, 0.16);
    padding: 0;
    margin-left: 0;
    margin-right: 6px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    vertical-align: middle;
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.06);
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.upgrade-badge i {
    font-size: 0.95rem;
}

.upgrade-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(6, 182, 212, 0.12);
}

.upgrade-badge:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
}

/* Bigger prominent upgrade badge for chart overlays */
.upgrade-badge.overlay {
    width: auto;
    padding: 8px 12px;
    height: auto;
    border-radius: 10px;
    font-weight: 700;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.16), rgba(6, 182, 212, 0.06));
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.12);
    color: var(--accent, #06b6d4);
}

/* ==========================================================================
   NAVIGATION ITEM WITH BADGE
   ========================================================================== */

.nav-item-with-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
}

.nav-item-with-badge > a {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   CHART LOCKING - Blur overlay for locked charts
   ========================================================================== */

.chart-locked {
    position: relative;
}

.chart-locked .chart-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    border-radius: 16px;
    align-items: center;
    justify-content: center;
    background: rgba(6, 6, 10, 0.45);
    backdrop-filter: blur(6px) saturate(40%);
    -webkit-backdrop-filter: blur(6px) saturate(40%);
    z-index: 40;
    pointer-events: auto;
    gap: 12px;
    flex-direction: column;
    padding: 12px;
    text-align: center;
}

.chart-locked canvas,
.chart-locked .chart-container,
.chart-locked .legend-list {
    filter: blur(6px) grayscale(0.9) opacity(0.25);
    pointer-events: none;
}

.chart-lock-message {
    color: #ffffff;
    font-weight: 700;
    background: transparent;
    font-size: 0.95rem;
}

/* ==========================================================================
   TOAST NOTIFICATIONS / ALERTS
   ========================================================================== */

.messages {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 400px;
}

.alert {
    padding: 0.875rem 1.125rem;
    border-radius: 10px;
    font-weight: 400;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: slideInUp 0.3s ease-out, fadeOut 0.3s ease-in 2.7s forwards;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    min-width: 280px;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(150%);
    }
}

.alert-success {
    background: rgba(34, 197, 94, 0.25);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #86efac;
}

.alert-error {
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.alert-info {
    background: rgba(0, 212, 255, 0.25);
    border: 1px solid rgba(0, 212, 255, 0.5);
    color: #7dd3fc;
}

.alert i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .messages {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
        min-width: auto;
    }
}
