/**
 * Universal Status Indicator CSS
 * Stili per il sistema modulare di indicatori di stato
 */

/* Container principale */
.universal-status-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

/* Singolo indicatore */
.status-indicator {
    background: rgba(33, 37, 41, 0.95);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
    position: relative;
}

/* Stati di animazione */
.status-indicator.show {
    transform: translateX(0);
    opacity: 1;
}

.status-indicator.hide {
    transform: translateX(120%);
    opacity: 0;
}

/* Animazione fade */
.status-indicator.fade {
    transform: none;
}

.status-indicator.fade.show {
    animation: fadeIn 0.3s ease forwards;
}

.status-indicator.fade.hide {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Contenuto indicatore */
.indicator-content {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    gap: 12px;
}

/* Icona */
.indicator-icon {
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
    margin-top: 2px;
}

/* Testo */
.indicator-text {
    flex: 1;
    min-width: 0;
}

.indicator-message {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 2px;
}

.indicator-description {
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.9;
    margin-top: 4px;
}

/* Pulsante chiudi */
.indicator-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 4px;
    margin: -4px -8px -4px 8px;
    transition: opacity 0.2s ease;
}

.indicator-close:hover {
    opacity: 1;
}

/* Tipi predefiniti */
.status-indicator.success {
    background-color: rgba(40, 167, 69, 0.95);
}

.status-indicator.error {
    background-color: rgba(220, 53, 69, 0.95);
}

.status-indicator.warning {
    background-color: rgba(255, 193, 7, 0.95);
    color: #000;
}

.status-indicator.info {
    background-color: rgba(0, 123, 255, 0.95);
}

.status-indicator.syncing {
    background-color: rgba(0, 123, 255, 0.95);
}

/* Bordo sinistro colorato */
.status-indicator::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255, 255, 255, 0.3);
}

.status-indicator.success::before {
    background: #28a745;
}

.status-indicator.error::before {
    background: #dc3545;
}

.status-indicator.warning::before {
    background: #ffc107;
}

.status-indicator.info::before,
.status-indicator.syncing::before {
    background: #007bff;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .universal-status-container {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }
    
    .status-indicator {
        margin-bottom: 8px;
    }
    
    .indicator-content {
        padding: 10px 14px;
        gap: 10px;
    }
    
    .indicator-icon {
        font-size: 18px;
    }
    
    .indicator-message {
        font-size: 13px;
    }
    
    .indicator-description {
        font-size: 11px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .status-indicator {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }
}

/* Animazione icona syncing */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Indicatore compatto per toolbar */
.status-indicator.compact {
    border-radius: 20px;
}

.status-indicator.compact .indicator-content {
    padding: 6px 12px;
    gap: 8px;
}

.status-indicator.compact .indicator-icon {
    font-size: 14px;
    margin-top: 0;
}

.status-indicator.compact .indicator-message {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 0;
}

.status-indicator.compact .indicator-description {
    display: none;
}

/* Posizione top */
.universal-status-container.position-top {
    top: 20px;
    bottom: auto;
}

/* Centro orizzontale */
.universal-status-container.position-center {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
}