/* ============================================
   COMPONENTS.CSS - Composants réutilisables
   Dépendances : core.css
   ============================================ */

/* ============================================
   BADGES GLASSMORPHISM
   ============================================ */

/* Badge de base */
.badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-3xl);
    font-size: var(--font-size-xs);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--glass-bg-light);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    box-shadow: 
        var(--shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Badge avec bordure */
.badge--outline {
    border: 1px solid var(--glass-border);
    background: var(--glass-bg-lighter);
    color: var(--color-text);
}

.badge--outline:hover {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
    box-shadow: 
        var(--shadow-lg),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Badge cliquable */
.badge--clickable {
    cursor: pointer;
    border: 2px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.5);
    padding: 10px 24px;
    font-size: var(--font-size-sm);
}

.badge--clickable:hover {
    border-color: rgba(100, 100, 100, 0.6);
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
}

/* Badge sombre */
.badge--dark {
    background: var(--glass-bg-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--color-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-md);
}

/* ============================================
   BOUTONS GLASSMORPHISM
   ============================================ */

/* Bouton de base */
.btn {
    display: inline-block;
    padding: 16px 32px;
    font-size: var(--font-size-base);
    font-weight: 400;
    font-family: var(--font-main);
    text-align: center;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Bouton primaire (noir glassmorphism) */
.btn--primary {
    background: var(--glass-bg-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--color-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn--primary:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.95);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Bouton secondaire (outline glassmorphism) */
.btn--secondary {
    background: var(--glass-bg-light);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    color: var(--color-text);
    border: 1px solid var(--glass-border);
    box-shadow: 
        var(--shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn--secondary:hover:not(:disabled) {
    background: var(--glass-bg-dark);
    color: var(--color-bg);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 28px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Modificateurs de taille */
.btn--small {
    padding: 10px 20px;
    font-size: var(--font-size-sm);
}

.btn--large {
    padding: 18px 40px;
    font-size: var(--font-size-lg);
}

/* Bouton pleine largeur */
.btn--full {
    width: 100%;
}

/* ============================================
   CARDS GLASSMORPHISM
   ============================================ */

/* Card de base */
.card {
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        var(--shadow-lg),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
}

/* Overlay gradient au hover */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

/* Card avec effet hover */
.card--hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: var(--glass-border-hover);
}

.card--hover:hover::before {
    opacity: 1;
}

/* Image de card */
.card__image {
    width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f2 100%);
    position: relative;
}

.card__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card--hover:hover .card__image::after {
    opacity: 1;
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card--hover:hover .card__image img {
    transform: scale(1.1);
}

/* Contenu de card */
.card__content {
    padding: var(--spacing-sm);
    background: var(--glass-bg-lighter);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
}

.card--hover:hover .card__content {
    background: rgba(255, 255, 255, 0.9);
}

/* Ratios d'image prédéfinis */
.card__image--product {
    aspect-ratio: 3 / 4;
}

.card__image--square {
    aspect-ratio: 1 / 1;
}

.card__image--wide {
    aspect-ratio: 16 / 9;
}

.card__image--gallery {
    aspect-ratio: 16 / 11;
}

/* ============================================
   MODALES GLASSMORPHISM
   ============================================ */

/* Overlay de fond */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Contenu de la modal */
.modal-content {
    background: #ffffff;
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--glass-border);
    padding: var(--spacing-lg);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Bouton fermer */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--color-text);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    transition: opacity 0.2s ease;
    z-index: 10001;
}

.modal-close:hover {
    opacity: 0.6;
}

/* Titre de modal */
.modal-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

/* ============================================
   FORMULAIRES
   ============================================ */

/* Input de base glassmorphism */
.form-input {
    width: 100%;
    padding: 16px 20px;
    font-size: var(--font-size-base);
    font-family: var(--font-main);
    font-weight: 400;
    color: var(--color-text);
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    box-shadow: 
        var(--shadow-lg),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.form-input:hover:not(:focus) {
    transform: translateY(-2px);
    box-shadow: 
        var(--shadow-xl),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-color: var(--glass-border-hover);
}

.form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 
        var(--shadow-xl),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.form-input::placeholder {
    color: var(--color-text-lighter);
    font-weight: 300;
}

/* Textarea */
.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .card--hover:hover {
        transform: translateY(-4px);
    }
    
    .modal-content {
        max-width: 95%;
        padding: var(--spacing-md);
    }
    
    .btn {
        padding: 14px 24px;
        font-size: var(--font-size-sm);
    }
}