/**
 * Drive Ooblik Upload - Frontend Styles
 * Style "Cartouche d'architecte"
 */

/* Container principal */
.ooblik-upload-wrapper {
    border: 1px solid #000;
    padding: 20px;
    margin: 30px 0;
    background: #fff;
    font-family: Arial, sans-serif;
}

/* Header */
.ooblik-upload-header {
    border-bottom: 1px solid #000;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.ooblik-upload-header h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: bold;
    color: #000;
}

.ooblik-product-title {
    margin: 0 0 5px 0 !important;
    font-size: 18px !important;
    font-weight: bold !important;
    color: #000 !important;
}

.ooblik-product-name {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: normal;
    color: #dc2626;
}

.ooblik-upload-description {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* Sélecteur de mode (1 fichier vs 2 fichiers) */
.ooblik-mode-selector {
    border: 1px solid #000;
    border-top: 1px solid #000;
    padding: 15px;
    margin: 20px 0;
    background: #f9f9f9;
}

.ooblik-mode-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: bold;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ooblik-mode-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ooblik-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #000;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ooblik-mode-option:hover {
    background: #f0f0f0;
}

.ooblik-mode-option input[type="radio"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #dc2626;
}

.ooblik-mode-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.ooblik-mode-label strong {
    font-size: 14px;
    color: #000;
    font-weight: bold;
}

.ooblik-mode-label small {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

/* Zones d'upload (visibilité selon mode) */
.ooblik-upload-zone {
    margin-top: 20px;
}

.ooblik-mode-single,
.ooblik-mode-dual {
    display: none;
}

.ooblik-mode-single.active,
.ooblik-mode-dual.active {
    display: block;
}

/* Grille pour mode dual (2 fichiers) */
.ooblik-dual-zones-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ooblik-dual-zone-item {
    border: 1px solid #000;
    padding: 15px;
    background: #fff;
}

.ooblik-zone-label {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: bold;
    color: #000;
    border-bottom: 1px solid #000;
    padding-bottom: 10px;
}

/* Zone de drag & drop */
.ooblik-dropzone {
    border: 2px dashed #000;
    padding: 40px 20px;
    text-align: center;
    background: #f9f9f9;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ooblik-dropzone:hover,
.ooblik-dropzone.dragover {
    background: #f0f0f0;
}

/* Zones doubles plus compactes */
.ooblik-dual-zone-item .ooblik-dropzone {
    padding: 30px 15px;
}

.ooblik-dual-zone-item .ooblik-upload-icon {
    width: 40px;
    height: 40px;
}

.ooblik-dual-zone-item .ooblik-dropzone-text {
    font-size: 14px;
}

.ooblik-dual-zone-item .ooblik-dropzone-subtext {
    font-size: 12px;
}

.ooblik-dual-zone-item .ooblik-browse-button {
    padding: 8px 15px;
    font-size: 12px;
}

.ooblik-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ooblik-upload-icon {
    color: #000;
    margin-bottom: 10px;
}

.ooblik-dropzone-text {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: #000;
}

.ooblik-dropzone-subtext {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.ooblik-browse-button {
    background: #dc2626;
    color: #fff;
    border: 1px solid #000;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s ease;
}

.ooblik-browse-button:hover {
    background: #b91c1c;
}

/* Messages d'erreur */
.ooblik-error-message {
    border: 1px solid #dc2626;
    background: #fef2f2;
    color: #dc2626;
    padding: 15px;
    margin-top: 15px;
    font-size: 14px;
}

/* Message de succès */
.ooblik-success-message {
    border: 1px solid #22c55e;
    background: #f0fdf4;
    color: #15803d;
    padding: 15px;
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.6;
}

/* Liste des fichiers */
.ooblik-file-list {
    margin-top: 20px;
    border-top: 1px solid #000;
    padding-top: 15px;
}

.ooblik-file-list h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: bold;
    color: #000;
}

.ooblik-file-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ooblik-file-item {
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ooblik-file-item:last-child {
    border-bottom: none;
}

.ooblik-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0; /* Permet au flex item de rétrécir en dessous de sa taille naturelle */
}

.ooblik-file-icon {
    width: 24px;
    height: 24px;
    color: #dc2626;
    flex-shrink: 0; /* Empêche l'icône de rétrécir */
}

.ooblik-file-details {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Permet au contenu de rétrécir */
    flex: 1;
}

.ooblik-file-name {
    font-size: 14px;
    font-weight: bold;
    color: #000;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ooblik-file-size {
    font-size: 12px;
    color: #666;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ooblik-file-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0; /* Empêche le bouton de rétrécir */
    margin-left: 10px; /* Espace entre le nom de fichier et le bouton */
}

.ooblik-delete-button {
    background: transparent;
    border: 1px solid #dc2626;
    color: #dc2626;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ooblik-delete-button:hover {
    background: #dc2626;
    color: #fff;
}

/* Barre de progression */
.ooblik-progress-wrapper {
    margin-top: 20px;
    border-top: 1px solid #000;
    padding-top: 15px;
}

.ooblik-progress-bar {
    width: 100%;
    height: 30px;
    border: 1px solid #000;
    background: #f9f9f9;
    position: relative;
    overflow: hidden;
}

.ooblik-progress-fill {
    height: 100%;
    background: #dc2626;
    transition: width 0.3s ease;
}

.ooblik-progress-text {
    text-align: center;
    margin: 10px 0 0 0;
    font-size: 14px;
    font-weight: bold;
    color: #000;
}

/* Affichage dans le panier */
.ooblik-cart-files {
    margin-top: 10px;
    padding: 15px; /* Augmenté de 10px à 15px pour plus d'aération */
    border: 1px solid #000;
    background: #f9f9f9;
}

.ooblik-cart-files strong {
    display: block;
    margin-bottom: 8px; /* Augmenté de 5px à 8px pour plus d'espace sous le titre */
    font-size: 12px;
    color: #000;
}

.ooblik-cart-files ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ooblik-cart-files li {
    font-size: 12px;
    color: #666;
    padding: 5px 0; /* Augmenté de 3px à 5px pour plus d'espace entre les lignes */
    border-bottom: 1px solid #e0e0e0;
}

.ooblik-cart-files li:last-child {
    border-bottom: none;
}

.ooblik-file-size {
    color: #999;
    font-size: 11px;
}

/* États de chargement */
.ooblik-loading {
    opacity: 0.6;
    pointer-events: none;
}

.ooblik-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #dc2626;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: ooblik-spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

@keyframes ooblik-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .ooblik-upload-wrapper {
        padding: 15px;
        margin: 20px 0;
    }

    .ooblik-dropzone {
        padding: 30px 15px;
    }

    .ooblik-file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ooblik-file-actions {
        width: 100%;
    }

    .ooblik-delete-button {
        width: 100%;
    }

    /* Mode dual sur mobile : grille 1 colonne */
    .ooblik-dual-zones-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .ooblik-mode-options {
        gap: 8px;
    }

    .ooblik-mode-option {
        padding: 10px;
    }

    .ooblik-mode-label strong {
        font-size: 13px;
    }

    .ooblik-mode-label small {
        font-size: 11px;
    }
}
