/**
 * Music Library - Tooltips and Feedback Visuals
 * 
 * Ce fichier contient les styles pour les tooltips et
 * les feedbacks visuels de l'interface.
 * 
 * @module assets/css/components/tooltips
 * @version 1.0.0
 */

/* ============================================
   TOOLTIP BASE
   ============================================ */

.tooltip {
    position: relative;
}

.tooltip::before,
.tooltip::after {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1000;
}

/* Contenu du tooltip */
.tooltip::before {
    content: attr(data-tooltip);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8125rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Flèche du tooltip */
.tooltip::after {
    content: '';
    border: 6px solid transparent;
}

/* Affichage au survol */
.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
}

/* ============================================
   TOOLTIP POSITIONS
   ============================================ */

/* Top (par défaut) */
.tooltip::before,
.tooltip-top::before {
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
}

.tooltip::after,
.tooltip-top::after {
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    border-top-color: rgba(0, 0, 0, 0.9);
}

.tooltip:hover::before,
.tooltip-top:hover::before {
    transform: translateX(-50%) translateY(0);
}

/* Bottom */
.tooltip-bottom::before {
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
}

.tooltip-bottom::after {
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: rgba(0, 0, 0, 0.9);
}

.tooltip-bottom:hover::before {
    transform: translateX(-50%) translateY(0);
}

/* Left */
.tooltip-left::before {
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-5px);
}

.tooltip-left::after {
    right: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    border-left-color: rgba(0, 0, 0, 0.9);
}

.tooltip-left:hover::before {
    transform: translateY(-50%) translateX(0);
}

/* Right */
.tooltip-right::before {
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(5px);
}

.tooltip-right::after {
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    border-right-color: rgba(0, 0, 0, 0.9);
}

.tooltip-right:hover::before {
    transform: translateY(-50%) translateX(0);
}

/* ============================================
   TOOLTIP VARIANTS
   ============================================ */

/* Primary */
.tooltip-primary::before {
    background: var(--music-primary);
}

.tooltip-primary.tooltip-top::after {
    border-top-color: var(--music-primary);
}

.tooltip-primary.tooltip-bottom::after {
    border-bottom-color: var(--music-primary);
}

.tooltip-primary.tooltip-left::after {
    border-left-color: var(--music-primary);
}

.tooltip-primary.tooltip-right::after {
    border-right-color: var(--music-primary);
}

/* Success */
.tooltip-success::before {
    background: #10b981;
}

.tooltip-success.tooltip-top::after {
    border-top-color: #10b981;
}

/* Warning */
.tooltip-warning::before {
    background: #f59e0b;
}

.tooltip-warning.tooltip-top::after {
    border-top-color: #f59e0b;
}

/* Error */
.tooltip-error::before {
    background: #ef4444;
}

.tooltip-error.tooltip-top::after {
    border-top-color: #ef4444;
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 16px 20px;
    border-radius: var(--music-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
}

.toast.toast-exit {
    animation: slideInRight 0.3s ease-in reverse;
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9375rem;
}

.toast-message {
    font-size: 0.8125rem;
    opacity: 0.9;
}

.toast-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    font-size: 1.25rem;
    line-height: 1;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast variants */
.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.toast-info {
    background: linear-gradient(135deg, #00d4ff 0%, #0ea5e9 100%);
}

/* ============================================
   LOADING FEEDBACK
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    animation: fadeIn 0.2s ease-out;
}

.loading-content {
    background: var(--music-bg-card);
    border: 1px solid var(--music-border);
    border-radius: var(--music-radius-lg);
    padding: var(--music-spacing-xl);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.loading-spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid var(--music-border);
    border-top-color: var(--music-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--music-spacing-md);
}

.loading-text {
    color: var(--music-text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-subtext {
    color: var(--music-text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   PROGRESS INDICATOR
   ============================================ */

.progress-indicator {
    background: var(--music-bg-card);
    border: 1px solid var(--music-border);
    border-radius: var(--music-radius);
    padding: var(--music-spacing-md);
    margin-bottom: var(--music-spacing-md);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-title {
    font-weight: 600;
    color: var(--music-text-primary);
    font-size: 0.875rem;
}

.progress-percentage {
    color: var(--music-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.progress-bar-container {
    height: 8px;
    background: var(--music-bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--music-primary) 0%, var(--music-secondary) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s ease-in-out infinite;
}

/* ============================================
   BADGE FEEDBACK
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(0, 212, 255, 0.2);
    color: var(--music-primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-info {
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

/* ============================================
   RIPPLE EFFECT
   ============================================ */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
    
    .tooltip::before {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .loading-content {
        padding: var(--music-spacing-lg);
    }
    
    .loading-spinner-large {
        width: 48px;
        height: 48px;
    }
}
