﻿/* ========================================
   BRAND INFO SECTION
   ======================================== */
.brand-info-section {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brand-info-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    border: 1px solid #e9ecef;
}

    .brand-info-badge .brand-link {
        color: #1976D2;
        text-decoration: none;
        transition: color 0.2s;
    }

        .brand-info-badge .brand-link:hover {
            color: #1565C0;
            text-decoration: underline;
        }

.description-group {
    flex-direction: column;
    align-items: stretch;
}

.description-field {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.info-grid-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ========================================
   MODEL CONTENT
   ======================================== */
.model-content {
    display: grid;
    grid-template-columns: minmax(300px, 400px) 1fr;
    gap: 30px;
    align-items: start;
}

.model-image-section {
    position: sticky;
    top: 20px;
}

/* ========================================
   IMAGE CONTAINER
   ======================================== */
.model-image-container {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    position: relative;
    cursor: default;
    transition: all 0.3s ease;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .model-image-container:hover {
        border-color: #1976D2;
        box-shadow: 0 4px 12px rgba(25, 118, 210, 0.15);
    }

.model-main-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.model-image-container:hover .model-main-image {
    transform: scale(1.02);
}

/* ========================================
   IMAGE PLACEHOLDER
   ======================================== */
.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    height: 100%;
    color: #9e9e9e;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    transition: all 0.3s ease;
}

.model-image-container:hover .image-placeholder {
    color: #1976D2;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.image-placeholder svg {
    transition: transform 0.3s ease;
}

.model-image-container:hover .image-placeholder svg {
    transform: scale(1.1);
}

.image-placeholder span {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    padding: 0 20px;
}

/* ========================================
   MODEL REFERENCE
   ======================================== */
.model-reference {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* ========================================
   MODEL DETAILS
   ======================================== */
.model-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   FIELDS STYLING
   ======================================== */
.inline-edit-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

    .inline-edit-field-group:hover {
        background-color: #f9fafb;
    }

    .inline-edit-field-group:last-child {
        border-bottom: none;
    }

.field-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-value {
    color: #1f2937;
    font-size: 15px;
    line-height: 1.6;
}

.description-text {
    line-height: 1.7;
    margin: 0;
    white-space: pre-wrap;
    color: #374151;
}

/* ========================================
   CUSTOM FIELDS SECTION
   ======================================== */
.custom-fields-divider {
    margin: 32px 0 16px 0;
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.template-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #4b5563;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    padding: 6px 16px;
    border-radius: 16px;
    border: 1px solid #d1d5db;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .template-label::before {
        content: "📋";
        font-size: 14px;
    }

/* ✅ Styles pour valeurs multiples (multiselect) */
.field-value-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.field-value-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

/* ========================================
   LOADING & ERROR STATES
   ======================================== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1976D2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.alert {
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #fee2e2;
    background-color: #fef2f2;
}

.alert-danger {
    color: #991b1b;
}

.alert-heading {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.alert p {
    margin: 0;
}

.text-muted {
    color: #6b7280;
}

.small {
    font-size: 0.875rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .model-content {
        grid-template-columns: 1fr;
    }

    .model-image-section {
        position: relative;
        top: 0;
    }

    .inline-edit-field-group {
        padding: 12px 0;
    }

    .custom-fields-divider {
        margin: 24px 0 12px 0;
        padding-top: 16px;
    }

    .template-label {
        font-size: 12px;
        padding: 5px 12px;
    }

    .field-value-tag {
        font-size: 12px;
        padding: 3px 10px;
    }
}

@media (max-width: 480px) {
    .brand-info-section {
        padding: 20px;
    }

    .field-label {
        font-size: 11px;
    }

    .field-value {
        font-size: 14px;
    }

    .field-value-list {
        gap: 6px;
    }
}
/* =====================================================
   URL FIELD DISPLAY - Affichage public des URLs
   ===================================================== */

.url-field-display {
    display: flex;
    align-items: center;
}

.url-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

    .url-link:hover {
        background: linear-gradient(135deg, #1976D2, #1565C0);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
        color: white;
        text-decoration: none;
    }

    .url-link:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
    }

    .url-link svg {
        flex-shrink: 0;
    }

    .url-link span {
        max-width: 300px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* =====================================================
   RESPONSIVE - URL FIELD DISPLAY
   ===================================================== */

@media (max-width: 768px) {
    .url-link {
        padding: 6px 12px;
        font-size: 13px;
    }

        .url-link span {
            max-width: 200px;
        }
}

@media (max-width: 480px) {
    .url-link {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
    }

        .url-link span {
            max-width: 150px;
        }
}

/* =====================================================
   VARIANTE ALTERNATIVE - URL comme texte avec icône
   ===================================================== */

.url-field-display.text-style {
    display: block;
}

    .url-field-display.text-style .url-link {
        background: transparent;
        color: #2196F3;
        padding: 0;
        box-shadow: none;
        border-bottom: 1px solid transparent;
    }

        .url-field-display.text-style .url-link:hover {
            background: transparent;
            color: #1565C0;
            border-bottom-color: #1565C0;
            transform: none;
            box-shadow: none;
        }

```

## Fonctionnalités du champ URL en affichage public :

✅ **Lien cliquable** : S'ouvre dans un nouvel onglet
✅ **Icône externe** : Indique clairement que le lien s'ouvre ailleurs
✅ **Affichage du domaine** : Montre uniquement le nom de domaine pour plus de clarté
✅ **Design moderne** : Bouton bleu gradient cohérent avec votre interface
✅ **Sécurité** : Attribut `rel="noopener noreferrer"`
✅ **Validation** : Affiche comme texte simple si l'URL est invalide
✅ **Responsive** : S'adapte aux petits écrans
✅ **Truncation** : Évite les URLs trop longues avec `text-overflow: ellipsis`

## Exemple de rendu :

Pour une URL comme `https://www.exemple.com/page/produit`, le site affichera :
```
Site web
┌─────────────────────────────┐
│ 🔗 exemple.com │
└─────────────────────────────┘