/*
|--------------------------------------------------------------------------
| Viartas Admin Theme - Dropzone Styles
|--------------------------------------------------------------------------
*/

/* ========================================================================
   Dropzone Container
   ======================================================================== */
.dropzone {
    min-height: 200px;
    background: var(--vt-dark-50);
    border: 2px dashed var(--vt-dark-200);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropzone:hover {
    border-color: var(--vt-primary);
    background: var(--vt-primary-light);
}

/* Drag over state */
.dropzone.dz-drag-hover {
    border-color: var(--vt-primary);
    background: var(--vt-primary-light);
    border-style: solid;
}

/* Clickable state */
.dropzone.dz-clickable {
    cursor: pointer;
}

.dropzone.dz-clickable * {
    cursor: default;
}

.dropzone.dz-clickable .dz-message,
.dropzone.dz-clickable .dz-message * {
    cursor: pointer;
}

/* ========================================================================
   Default Message
   ======================================================================== */
.dropzone .dz-message {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--vt-dark-500);
}

.dropzone .dz-message .dz-button {
    background: none;
    border: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

/* Custom message icon */
.dropzone .dz-message::before {
    content: '\f382';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    display: block;
    font-size: 48px;
    color: var(--vt-dark-300);
    margin-bottom: 16px;
    transition: color 0.3s ease;
}

.dropzone:hover .dz-message::before,
.dropzone.dz-drag-hover .dz-message::before {
    color: var(--vt-primary);
}

/* Hide message when files are added */
.dropzone.dz-started .dz-message {
    display: none;
}

/* ========================================================================
   File Preview
   ======================================================================== */
.dropzone .dz-preview {
    position: relative;
    display: inline-block;
    vertical-align: top;
    margin: 16px;
    min-height: 100px;
    background: var(--vt-card-bg);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.dropzone .dz-preview:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Image preview */
.dropzone .dz-preview .dz-image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--vt-dark-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone .dz-preview .dz-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* File icon for non-images */
.dropzone .dz-preview .dz-image::before {
    content: '\f15b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    font-size: 40px;
    color: var(--vt-dark-300);
}

.dropzone .dz-preview.dz-image-preview .dz-image::before {
    display: none;
}

/* ========================================================================
   File Details
   ======================================================================== */
.dropzone .dz-preview .dz-details {
    position: relative;
    padding: 12px 0 0;
    text-align: center;
    max-width: 120px;
}

.dropzone .dz-preview .dz-filename {
    font-size: 13px;
    font-weight: 600;
    color: var(--vt-dark-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropzone .dz-preview .dz-filename span {
    background: transparent;
    border: none;
    padding: 0;
}

.dropzone .dz-preview .dz-size {
    font-size: 12px;
    color: var(--vt-dark-400);
    margin-top: 4px;
}

.dropzone .dz-preview .dz-size span {
    background: transparent;
    border: none;
    padding: 0;
}

/* ========================================================================
   Progress Bar
   ======================================================================== */
.dropzone .dz-preview .dz-progress {
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 4px;
    background: var(--vt-dark-200);
    border-radius: 4px;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.dropzone .dz-preview.dz-complete .dz-progress {
    opacity: 0;
}

.dropzone .dz-preview .dz-progress .dz-upload {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--vt-primary), var(--vt-primary-dark));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ========================================================================
   Success State
   ======================================================================== */
.dropzone .dz-preview .dz-success-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 54px;
    height: 54px;
    background: var(--vt-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.dropzone .dz-preview .dz-success-mark svg {
    display: none;
}

.dropzone .dz-preview .dz-success-mark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 24px;
    color: white;
}

.dropzone .dz-preview.dz-success .dz-success-mark {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ========================================================================
   Error State
   ======================================================================== */
.dropzone .dz-preview .dz-error-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 54px;
    height: 54px;
    background: var(--vt-danger);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.dropzone .dz-preview .dz-error-mark svg {
    display: none;
}

.dropzone .dz-preview .dz-error-mark::after {
    content: '\f00d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 24px;
    color: white;
}

.dropzone .dz-preview.dz-error .dz-error-mark {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Error message */
.dropzone .dz-preview .dz-error-message {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--vt-danger);
    color: white;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

.dropzone .dz-preview .dz-error-message::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--vt-danger);
}

.dropzone .dz-preview:hover .dz-error-message {
    opacity: 1;
    visibility: visible;
}

/* ========================================================================
   Remove Button
   ======================================================================== */
.dropzone .dz-preview .dz-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--vt-danger);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: 5;
}

.dropzone .dz-preview .dz-remove::before {
    content: '\f00d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
}

.dropzone .dz-preview:hover .dz-remove {
    opacity: 1;
    transform: scale(1);
}

.dropzone .dz-preview .dz-remove:hover {
    background: var(--vt-danger-dark, #dc2626);
    transform: scale(1.1);
}

/* ========================================================================
   Compact/Small Variant
   ======================================================================== */
.dropzone.dropzone-sm {
    min-height: 120px;
    padding: 24px 16px;
}

.dropzone.dropzone-sm .dz-message::before {
    font-size: 32px;
    margin-bottom: 10px;
}

.dropzone.dropzone-sm .dz-message {
    font-size: 13px;
}

.dropzone.dropzone-sm .dz-preview {
    margin: 10px;
    padding: 8px;
}

.dropzone.dropzone-sm .dz-preview .dz-image {
    width: 80px;
    height: 80px;
}

.dropzone.dropzone-sm .dz-preview .dz-details {
    max-width: 80px;
    padding-top: 8px;
}

.dropzone.dropzone-sm .dz-preview .dz-filename {
    font-size: 11px;
}

.dropzone.dropzone-sm .dz-preview .dz-size {
    font-size: 10px;
}

/* ========================================================================
   List Variant (File List Style)
   ======================================================================== */
.dropzone.dropzone-list .dz-preview {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 8px 0;
    padding: 12px 16px;
    background: var(--vt-dark-50);
    border: 1px solid var(--vt-dark-200);
}

.dropzone.dropzone-list .dz-preview .dz-image {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.dropzone.dropzone-list .dz-preview .dz-details {
    flex: 1;
    text-align: left;
    padding: 0 16px;
    max-width: none;
}

.dropzone.dropzone-list .dz-preview .dz-progress {
    position: relative;
    width: 120px;
    left: 0;
    right: auto;
    bottom: auto;
    flex-shrink: 0;
}

.dropzone.dropzone-list .dz-preview .dz-remove {
    position: relative;
    top: auto;
    right: auto;
    opacity: 1;
    transform: scale(1);
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.dropzone.dropzone-list .dz-preview .dz-success-mark,
.dropzone.dropzone-list .dz-preview .dz-error-mark {
    position: relative;
    top: auto;
    left: auto;
    transform: scale(1);
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-right: 8px;
}

.dropzone.dropzone-list .dz-preview .dz-success-mark::after,
.dropzone.dropzone-list .dz-preview .dz-error-mark::after {
    font-size: 14px;
}

/* ========================================================================
   Disabled State
   ======================================================================== */
.dropzone.disabled,
.dropzone[disabled] {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

/* ========================================================================
   Single File Mode
   ======================================================================== */
.dropzone.dropzone-single .dz-preview {
    margin: 0;
}

.dropzone.dropzone-single.dz-started .dz-message {
    display: none;
}

/* ========================================================================
   Responsive
   ======================================================================== */
@media (max-width: 767px) {
    .dropzone {
        padding: 24px 16px;
        min-height: 160px;
    }

    .dropzone .dz-message::before {
        font-size: 36px;
        margin-bottom: 12px;
    }

    .dropzone .dz-message {
        font-size: 14px;
    }

    .dropzone .dz-preview {
        margin: 8px;
    }

    .dropzone .dz-preview .dz-image {
        width: 100px;
        height: 100px;
    }

    .dropzone .dz-preview .dz-details {
        max-width: 100px;
    }
}
