﻿/* ========================================
   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: pointer;
    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 (Icône par défaut)
   ======================================== */
.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;
}

/* ========================================
   IMAGE UPLOAD OVERLAY (Hover sur image existante)
   ======================================== */
.image-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.model-image-container:hover .image-upload-overlay {
    opacity: 1;
}

.image-upload-overlay svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.image-upload-overlay span {
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ========================================
   IMAGE LOADER & ERROR
   ======================================== */
.image-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.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);
    }
}

.image-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #d32f2f;
    padding: 20px;
}

    .image-error span {
        font-size: 14px;
        font-weight: 500;
    }

/* ========================================
   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;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .inline-edit-field-group {
        flex-direction: column;
        align-items: stretch;
    }

    .field-label {
        min-width: unset;
        padding-top: 0;
    }

    .model-content {
        grid-template-columns: 1fr;
    }

    .model-image-section {
        position: relative;
        top: 0;
    }


}

/* ========================================
   QR CODE SECTION
   ======================================== */

.qr-code-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: var(--spacing-xl);
    border: 1px solid var(--border-color);
    margin-top: var(--spacing-xl);
}

.qr-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}

    .qr-code-header h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-primary);
    }

.qr-code-display {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.qr-code-image-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--border-color);
    background: var(--white);
}

.qr-code-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--spacing-sm);
}

.qr-code-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.qr-code-image-wrapper:hover .qr-code-overlay {
    opacity: 1;
}

.qr-code-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.qr-code-info-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--secondary-color);
}

.qr-code-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

.qr-code-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-all;
}

.qr-code-slug-text {
    font-family: monospace;
    font-weight: 500;
    color: var(--primary-blue);
}

.qr-code-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
    gap: var(--spacing-md);
    background: var(--gray-50);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
}

    .qr-code-empty svg {
        color: var(--text-muted);
    }

    .qr-code-empty p {
        margin: 0;
        text-align: center;
    }

.qr-preview {
    display: flex;
    justify-content: center;
    padding: var(--spacing-lg);
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

    .qr-preview img {
        width: 200px;
        height: 200px;
        object-fit: contain;
    }

.input-with-button {
    display: flex;
    gap: var(--spacing-sm);
}

    .input-with-button .inline-edit-field {
        flex: 1;
    }

/* ========================================
   RESPONSIVE QR CODE
   ======================================== */

@media (max-width: 768px) {
    .qr-code-display {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .qr-code-image-wrapper {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .qr-code-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }

        .qr-code-header .btn {
            width: 100%;
        }
}

@media (max-width: 480px) {
    .qr-code-section {
        padding: var(--spacing-md);
    }

    .qr-code-empty {
        padding: var(--spacing-xl);
    }

        .qr-code-empty svg {
            width: 48px;
            height: 48px;
        }
}
/* =====================================================
   MODAL CRÉATION RAPIDE DE TEMPLATE - Composant
   ===================================================== */

.template-creation-info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid #3b82f6;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

    .template-creation-info svg {
        color: #3b82f6;
        margin: 0 auto var(--spacing-md);
    }

    .template-creation-info p {
        margin: var(--spacing-sm) 0;
        font-size: 14px;
        color: var(--text-primary);
    }

    .template-creation-info .text-muted {
        font-size: 13px;
        color: var(--text-secondary);
    }

/* Animation spécifique pour la modal-sm */
.modal-sm {
    max-width: 500px;
    animation: modalSlideInSmall 0.3s ease-out;
}

@keyframes modalSlideInSmall {
    from {
        transform: scale(0.9) translateY(-30px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Spinner pour le bouton de soumission */
.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .modal-sm {
        width: 95%;
        max-width: none;
    }

    .template-creation-info {
        padding: var(--spacing-lg);
    }

        .template-creation-info svg {
            width: 40px;
            height: 40px;
        }
}
/* =====================================================
   SECTION CHAMPS PERSONNALISÉS
   ===================================================== */

.custom-fields-section {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
}

.custom-fields-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

    .custom-fields-header h3 {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0;
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
    }

        .custom-fields-header h3::before {
            content: "";
            width: 4px;
            height: 24px;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            border-radius: 2px;
        }

/* Template Badge */
.template-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid #3b82f6;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
}

    .template-badge svg {
        color: #3b82f6;
        flex-shrink: 0;
    }

    .template-badge span {
        flex: 1;
    }

.btn-change-template {
    background: transparent;
    border: none;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

    .btn-change-template:hover {
        background: rgba(59, 130, 246, 0.1);
        text-decoration: underline;
    }

/* Liste des champs personnalisés */
.custom-fields-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.custom-field-item {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

    .custom-field-item:hover {
        background: var(--white);
        border-color: var(--secondary-color);
        box-shadow: var(--shadow-sm);
    }

    .custom-field-item .field-label {
        font-weight: 600;
        color: var(--text-primary);
        font-size: 14px;
    }

    .custom-field-item .inline-edit-field {
        width: 100%;
        padding: 10px 12px;
        border: 2px solid var(--border-color);
        border-radius: var(--radius-sm);
        font-size: 14px;
        transition: var(--transition-fast);
        background: var(--white);
    }

        .custom-field-item .inline-edit-field:focus {
            outline: none;
            border-color: var(--secondary-color);
            box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
        }

    .custom-field-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
        cursor: pointer;
        accent-color: var(--secondary-color);
    }

.btn-remove-field {
    background: var(--danger-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

    .btn-remove-field:hover {
        background: #c82333;
        transform: scale(1.1);
    }

    .btn-remove-field svg {
        width: 16px;
        height: 16px;
    }

/* État vide des champs personnalisés */
.custom-fields-empty {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-lg);
    background: linear-gradient(135deg, var(--gray-50), var(--white));
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--gray-500);
}

    .custom-fields-empty svg {
        color: var(--gray-400);
        margin: 0 auto var(--spacing-md);
    }

    .custom-fields-empty p {
        margin: var(--spacing-sm) 0;
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .custom-fields-empty .text-muted {
        font-size: 14px;
        color: var(--text-secondary);
        font-weight: 400;
    }

/* =====================================================
   MODAL CHANGEMENT DE TEMPLATE
   ===================================================== */

.template-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-height: 400px;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.template-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

    .template-card:hover {
        border-color: var(--secondary-color);
        background: var(--gray-50);
        transform: translateX(4px);
        box-shadow: var(--shadow-md);
    }

    .template-card.selected {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
        border-color: var(--success-color);
        border-width: 3px;
    }

.template-card-content {
    flex: 1;
}

    .template-card-content h4 {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0 0 var(--spacing-xs) 0;
    }

    .template-card-content p {
        font-size: 14px;
        color: var(--text-secondary);
        margin: 0;
        line-height: 1.4;
    }

.template-card-check {
    background: var(--success-color);
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1024px) {
    .custom-field-item {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

        .custom-field-item .field-label {
            padding-bottom: var(--spacing-xs);
            border-bottom: 1px solid var(--border-color);
        }

    .btn-remove-field {
        position: absolute;
        top: var(--spacing-md);
        right: var(--spacing-md);
    }

    .template-badge {
        flex-wrap: wrap;
        padding: 8px 12px;
    }
}

@media (max-width: 768px) {
    .custom-fields-section {
        padding: var(--spacing-lg);
        margin-top: var(--spacing-lg);
    }

    .custom-fields-header {
        flex-direction: column;
        align-items: stretch;
    }

        .custom-fields-header h3 {
            font-size: 1.1rem;
        }

        .custom-fields-header .btn {
            width: 100%;
            justify-content: center;
        }

    .template-badge {
        width: 100%;
        justify-content: space-between;
    }

    .custom-field-item {
        padding: var(--spacing-md);
    }

    .custom-fields-empty {
        padding: var(--spacing-xl) var(--spacing-md);
    }

        .custom-fields-empty svg {
            width: 40px;
            height: 40px;
        }

        .custom-fields-empty p {
            font-size: 15px;
        }

        .custom-fields-empty .text-muted {
            font-size: 13px;
        }

    .template-list {
        max-height: 300px;
    }

    .template-card {
        padding: var(--spacing-md);
    }

    .template-card-content h4 {
        font-size: 1rem;
    }

    .template-card-content p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .custom-fields-section {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .custom-fields-header h3 {
        font-size: 1rem;
    }

        .custom-fields-header h3::before {
            width: 3px;
            height: 20px;
        }

    .template-badge {
        font-size: 13px;
        padding: 6px 10px;
    }

        .template-badge svg {
            width: 14px;
            height: 14px;
        }

    .btn-change-template {
        font-size: 12px;
        padding: 3px 6px;
    }

    .custom-field-item {
        padding: var(--spacing-sm);
        gap: var(--spacing-xs);
    }

        .custom-field-item .field-label {
            font-size: 13px;
        }

        .custom-field-item .inline-edit-field {
            padding: 8px 10px;
            font-size: 13px;
        }

    .btn-remove-field {
        width: 28px;
        height: 28px;
        top: var(--spacing-sm);
        right: var(--spacing-sm);
    }

        .btn-remove-field svg {
            width: 14px;
            height: 14px;
        }

    .custom-fields-empty {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

        .custom-fields-empty svg {
            width: 36px;
            height: 36px;
        }

        .custom-fields-empty p {
            font-size: 14px;
        }

        .custom-fields-empty .text-muted {
            font-size: 12px;
        }

    .template-card {
        padding: var(--spacing-sm);
    }

    .template-card-content h4 {
        font-size: 0.95rem;
    }

    .template-card-content p {
        font-size: 12px;
    }

    .template-card-check {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.custom-field-item {
    animation: slideInRight 0.3s ease-out;
}

.template-card {
    animation: slideInRight 0.3s ease-out;
}

/* Délai progressif pour les items */
.custom-field-item:nth-child(1) {
    animation-delay: 0s;
}

.custom-field-item:nth-child(2) {
    animation-delay: 0.05s;
}

.custom-field-item:nth-child(3) {
    animation-delay: 0.1s;
}

.custom-field-item:nth-child(4) {
    animation-delay: 0.15s;
}

.custom-field-item:nth-child(n+5) {
    animation-delay: 0.2s;
}

/* =====================================================
   SCROLLBAR POUR LA LISTE DES TEMPLATES
   ===================================================== */

.template-list::-webkit-scrollbar {
    width: 8px;
}

.template-list::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.template-list::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

    .template-list::-webkit-scrollbar-thumb:hover {
        background: var(--gray-400);
    }
.checkbox-tags-placeholder {
    padding: 20px;
    text-align: center;
    color: #adb5bd;
    font-size: 13px;
    font-style: italic;
}

.checkbox-tags-wrapper:empty::before {
    content: "Chargement...";
    display: block;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 13px;
}

/* =====================================================
   URL FIELD - Champ URL avec bouton d'ouverture
   ===================================================== */

.url-field-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.url-input {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.url-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .url-open-btn:hover {
        background: linear-gradient(135deg, #1976D2, #1565C0);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
    }

    .url-open-btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
    }

    .url-open-btn svg {
        flex-shrink: 0;
    }

/* État d'erreur pour URL invalide */
.url-input:invalid {
    border-color: #dc3545;
}

    .url-input:invalid:focus {
        border-color: #dc3545;
        box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
    }

/* =====================================================
   RESPONSIVE - URL FIELD
   ===================================================== */

@media (max-width: 768px) {
    .url-field-container {
        flex-direction: row;
    }

    .url-input {
        font-size: 13px;
    }

    .url-open-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .url-input {
        font-size: 12px;
    }

    .url-open-btn {
        width: 36px;
        height: 36px;
    }
    /* =====================================================
   URL FIELD - Champ URL avec bouton d'ouverture
   ===================================================== */

    .url-field-container {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .url-input {
        flex: 1;
        font-family: 'Courier New', monospace;
        font-size: 14px;
    }

    .url-open-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: linear-gradient(135deg, #2196F3, #1976D2);
        border: none;
        border-radius: 6px;
        color: white;
        cursor: pointer;
        transition: all 0.2s ease;
        flex-shrink: 0;
    }

        .url-open-btn:hover {
            background: linear-gradient(135deg, #1976D2, #1565C0);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
        }

        .url-open-btn:active {
            transform: translateY(0);
            box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
        }

        .url-open-btn svg {
            flex-shrink: 0;
        }

    /* État d'erreur pour URL invalide */
    .url-input:invalid {
        border-color: #dc3545;
    }

        .url-input:invalid:focus {
            border-color: #dc3545;
            box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
        }

    /* =====================================================
   RESPONSIVE - URL FIELD
   ===================================================== */

    @media (max-width: 768px) {
        .url-field-container {
            flex-direction: row;
        }

        .url-input {
            font-size: 13px;
        }

        .url-open-btn {
            width: 40px;
            height: 40px;
        }
    }

    @media (max-width: 480px) {
        .url-input {
            font-size: 12px;
        }

        .url-open-btn {
            width: 36px;
            height: 36px;
        }
    }
}

/* ═══════════════════════════════════════════════════════════
   TEMPLATE FIELDS MANAGER
   ═══════════════════════════════════════════════════════ */

.template-fields-manager {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.fields-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}

    .fields-manager-header p {
        margin: 0;
        font-size: 15px;
        color: var(--text-secondary);
    }

/* Liste des champs */
.fields-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 400px;
    overflow-y: auto;
    padding: var(--spacing-sm);
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.field-item {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: var(--transition-fast);
}

    .field-item:hover {
        border-color: var(--secondary-color);
        box-shadow: var(--shadow);
    }

.field-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .field-item-icon svg {
        color: white;
    }

.field-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .field-item-info strong {
        font-size: 14px;
        color: var(--text-primary);
    }

    .field-item-info small {
        font-size: 12px;
        color: var(--text-secondary);
    }

.field-required-badge {
    background: var(--danger-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-icon-danger {
    background: transparent;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

    .btn-icon-danger:hover {
        background: rgba(239, 68, 68, 0.1);
    }

/* Formulaire d'ajout de champ */
.add-field-form {
    background: linear-gradient(135deg, var(--gray-50), var(--white));
    border: 2px solid var(--secondary-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
}

    .add-field-form h4 {
        margin: 0 0 var(--spacing-md) 0;
        font-size: 16px;
        font-weight: 700;
        color: var(--primary-color);
    }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.no-fields {
    text-align: center;
    padding: var(--spacing-3xl);
    color: var(--gray-500);
}

    .no-fields svg {
        margin-bottom: var(--spacing-md);
    }

    .no-fields p {
        margin: var(--spacing-xs) 0;
    }

/* Spinner petit */
.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .fields-manager-header {
        flex-direction: column;
        align-items: stretch;
    }
}   