/**
 * InstaUpload - Styles Frontend
 * @package InstaUpload
 * @version 2.0.0
 */

/* ========================================
   WRAPPER PRINCIPAL
   ======================================== */

.instaupload-form-wrapper {
    margin: 25px 0;
    padding: 25px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.instaupload-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instaupload-title .dashicons {
    color: #2271b1;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* ========================================
   INSTRUCTIONS
   ======================================== */

.instaupload-instructions {
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #fff;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

.instaupload-instructions p {
    margin: 0;
}

.instaupload-instructions strong {
    color: #2271b1;
}

/* ========================================
   ZONE DRAG & DROP
   ======================================== */

.instaupload-dropzone {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px dashed #ccc;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.instaupload-dropzone:hover {
    border-color: #2271b1;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.1);
}

.instaupload-dropzone.dragover {
    border-color: #2271b1;
    border-style: solid;
    background: #e7f3ff;
    transform: scale(1.01);
    box-shadow: 0 6px 16px rgba(34, 113, 177, 0.2);
}

.instaupload-file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.instaupload-dropzone-content {
    text-align: center;
    pointer-events: none;
    padding: 20px;
}

.upload-icon {
    display: block;
    font-size: 72px;
    width: 72px;
    height: 72px;
    color: #2271b1;
    margin: 0 auto 15px;
    transition: transform 0.3s ease;
}

.instaupload-dropzone:hover .upload-icon {
    transform: scale(1.1);
}

.instaupload-dropzone.dragover .upload-icon {
    animation: bounce 0.6s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.upload-text {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.upload-text strong {
    display: block;
    margin-bottom: 5px;
    color: #2271b1;
    font-size: 18px;
}

.upload-subtext {
    color: #666;
    font-size: 14px;
}

/* ========================================
   INFO FICHIER SÉLECTIONNÉ
   ======================================== */

.instaupload-file-info {
    margin-top: 20px;
    padding: 15px 20px;
    background: #fff;
    border: 2px solid #46b450;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-icon {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #2271b1;
    flex-shrink: 0;
}

.file-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-weight: 600;
    color: #333;
    font-size: 15px;
    word-break: break-word;
}

.file-size {
    font-size: 13px;
    color: #666;
}

.instaupload-remove-file {
    background: none;
    border: none;
    color: #dc3232;
    cursor: pointer;
    padding: 8px;
    font-size: 24px;
    line-height: 1;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.instaupload-remove-file:hover {
    color: #a00;
    background: #ffe0e0;
    transform: rotate(90deg);
}

.instaupload-remove-file .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
}

/* ========================================
   BARRE DE PROGRESSION
   ======================================== */

.instaupload-progress-wrapper {
    margin-top: 20px;
    animation: slideInDown 0.3s ease;
}

.instaupload-progress-bar {
    height: 32px;
    background: #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.instaupload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #1a5a8a 100%);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.instaupload-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.instaupload-progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: 700;
    font-size: 16px;
    color: #2271b1;
}

/* ========================================
   MESSAGES
   ======================================== */

.instaupload-messages {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    animation: slideInDown 0.3s ease;
}

.instaupload-messages.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.instaupload-messages.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.instaupload-messages.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .instaupload-form-wrapper {
        padding: 20px 15px;
    }

    .instaupload-dropzone {
        min-height: 180px;
    }

    .upload-icon {
        font-size: 56px;
        width: 56px;
        height: 56px;
    }

    .upload-text strong {
        font-size: 16px;
    }

    .upload-subtext {
        font-size: 13px;
    }

    .file-details {
        gap: 10px;
    }

    .file-icon {
        font-size: 28px;
        width: 28px;
        height: 28px;
    }

    .file-name {
        font-size: 14px;
    }

    .file-size {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .instaupload-title {
        font-size: 16px;
    }

    .instaupload-dropzone {
        min-height: 150px;
    }

    .instaupload-file-info {
        padding: 12px 15px;
    }

    .instaupload-progress-bar {
        height: 28px;
    }

    .instaupload-progress-text {
        font-size: 14px;
    }
}

/* ========================================
   ÉTATS DÉSACTIVÉS
   ======================================== */

.instaupload-dropzone.disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

/* ========================================
   ANIMATIONS ADDITIONNELLES
   ======================================== */

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
