/* Contenedor principal */
.plupload-r2-container {
    max-width: 900px;
    min-height:920px;
    margin: 30px auto;
    padding: 25px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eeeeee;
}

/* Layout de dos columnas */
.upload-columns-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.upload-form-column {
    position: sticky;
    top: 20px;
    height: fit-content;
    align-self: start;
}

.gallery-column {
    height: 120vh;
    overflow-y: auto;
    padding-right: 15px;
    border-left: 1px solid #eee;
    padding-left: 20px;
}

/* Estilos para el formulario */
.plupload-r2-form-section {
    margin-bottom: 12px;
}

.plupload-r2-form-section label {
    display: block;
    margin-bottom: 8px;
    color: #2c3338;
    font-size: 14px;
}

.plupload-r2-form-section input[type="text"],
.plupload-r2-form-section select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    background-color: #fff;
    color: #2c3338;
}

.plupload-r2-form-section input[type="text"]:focus,
.plupload-r2-form-section select:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 1px #007cba;
}

/* Estilo para el select */
.plupload-r2-form-section select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232c3338' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px !important;
}

/* Áreas de upload */
.plupload-uploader-area {
    min-height: 120px;
    border: 1px dashed #c3c4c7;
    padding: 25px;
    background: #ffffff;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.plupload-uploader-area.drag-over {
    border-color: #007cba;
    background: #f0f6fc;
}

/* Botones */

.button.primary {
    border: solid 0px;
    border-radius: 6px !important;
}

.button.small {
    padding: 5px 10px;
    font-size: 13px;
}

.button.large {
    padding: 12px 25px;
    font-size: 15px;
}

.button:disabled {
    background: #a7aaad;
    cursor: not-allowed;
    transform: none;
    border: solid 0px;
    border-radius: 6px !important;
}

/* Galería de imágenes */


/* Preview de imagen destacada */
#plupload-r2-featured-preview {
    margin-top: 15px;
}

/* Barra de progreso */
.upload-progress {
    margin-top: 15px;
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: #2271b1;
    transition: width 0.5s ease;
}

/* Mensajes de estado */
#plupload-r2-status {
    padding: 12px 15px;
    border-radius: 4px;
    margin: 15px 0;
    font-size: 14px;
    display: none;
}

#plupload-r2-status.success {
    background: #edfaef;
    color: #1d2327;
    border-left: 4px solid #00a32a;
    display: block;
}

#plupload-r2-status.error {
    background: #fcf0f1;
    color: #d63638;
    border-left: 4px solid #d63638;
    display: block;
}

#plupload-r2-status.info {
    background: #f0f6ff;
    color: #1d2327;
    border-left: 4px solid #2271b1;
    display: block;
}

/* Scroll personalizado */
.gallery-column::-webkit-scrollbar {
    width: 8px;
}

.gallery-column::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
    .upload-columns-wrapper {
        grid-template-columns: 1fr;
    }
    
    .upload-form-column {
        position: static;
    }
    
    .gallery-column {
        height: auto;
        max-height: 50vh;
        border-left: none;
        border-top: 1px solid #eee;
        padding-left: 0;
        padding-top: 20px;
    }
}

@media (max-width: 768px) {
    .plupload-r2-container {
        padding: 15px;
        margin: 15px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .plupload-uploader-area {
        min-height: 120px;
        padding: 15px;
    }
}

/* Barra de progreso */
#plupload-r2-progress {
    margin: 15px 0;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
}

.progress-text {
    margin-bottom: 5px;
    font-size: 14px;
    color: #555;
}

.progress-bar-container {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #2196F3;
    width: 0%;
    transition: width 0.3s ease;
}

/* Items de galería */
.gallery-item {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #f44336;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .remove-btn {
    opacity: 1;
}

.plupload-r2-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.plupload-r2-form-column {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.plupload-r2-gallery-column {
    flex: 1;
    min-width: 300px;
    max-height: 128vh;
    overflow-y: auto;
    border: 1px solid #eeeeee;
    padding: 10px;
    border-radius: 8px;
    background: #eeeeee;
}

.plupload-r2-gallery {
    display: grid;
}

.plupload-r2-gallery img {
    width: 100%;
    height: auto;
    transition: transform 0.2s;
}

.plupload-batch-progress {
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 10px;
}

.plupload-batch-count {
    font-weight: bold;
    margin-bottom: 5px;
}

.plupload-batch-progress-bar {
    height: 20px;
    background: #0073aa;
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s;
}

.plupload-batch-status {
    margin-top: 5px;
    font-size: 0.9em;
}

.plupload-batch-status.success {
    color: #46b450;
}

.plupload-batch-status.error {
    color: #dc3232;
}

.gallery-item-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 10;
}

.gallery-item-controls button {
    background: #0000008a;
    backdrop-filter: blur(2px);
    border: none;
    width: 10px;
    display: inline-flex;
    align-items: center;
    height: 28px;
    border-radius: 6px;
    margin-left: 0px;
    cursor: pointer;
    font-size: 12px;
    line-height: 0px;
    color: white !important;
    justify-content: center;
}

.gallery-item-controls button:hover {
    background: transparent;
}

.gallery-item-position {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #0000008a;
    backdrop-filter: blur(2px);
    color: white !important;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.gallery-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sortable-gallery .gallery-item.ui-sortable-helper {
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transform: scale(1.02);
}

.gallery-rotate {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 5px;
    margin: 0 2px;
    cursor: pointer;
    font-size: 12px;
}

.gallery-rotate:hover {
    background-color: #45a049;
}

.gallery-image {
    transition: transform 0.3s ease;
}

/* Estados de subida */
.uploading {
    color: #0073aa;
}

.processing {
    color: #ff9800;
}

.success {
    color: #4CAF50;
}

.error {
    color: #f44336;
}

/* Barra de progreso para imagen destacada */
.plupload-file-progress {
    height: 20px;
    background: #0073aa;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
}

/* Barra de progreso para lote */
.plupload-batch-progress-bar {
    background: #0073aa;
    transition: width 0.3s ease, background-color 0.3s ease;
}