/**
 * Joyn Resources - File Upload & Drag and Drop
 * Design System: Solapi v4.0
 * 
 * 파일 첨부 드래그앤드롭 영역
 * 
 * @location assets/css/upload.css
 */

/* ========================================
   Drop Zone (Solapi)
   ======================================== */
.joyn-drop-zone {
    min-height: 110px;
    border: 2px dashed var(--joyn-gray-200);
    border-radius: var(--joyn-radius-sm);
    padding: var(--joyn-spacing-5);
    background-color: var(--joyn-gray-50);
    transition: var(--joyn-transition);
    position: relative;
    cursor: pointer;
}

.joyn-drop-zone:hover {
    border-color: var(--joyn-gray-300);
    background-color: var(--joyn-bg-white);
}

.joyn-drop-zone.drag-over {
    border-color: var(--joyn-primary);
    background-color: var(--joyn-primary-light);
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(var(--joyn-primary-rgb, 69, 65, 255), 0.08);
    transform: scale(1.01);
}

/* ========================================
   Drop Zone Placeholder
   ======================================== */
.joyn-drop-zone-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--joyn-spacing-3);
}

.joyn-drop-zone-icon-wrapper {
    width: 48px;
    height: 48px;
    background: var(--joyn-bg-white);
    border-radius: var(--joyn-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--joyn-spacing-3);
    box-shadow: var(--joyn-shadow-xs);
    transition: var(--joyn-transition);
}

.joyn-drop-zone:hover .joyn-drop-zone-icon-wrapper {
    box-shadow: var(--joyn-shadow-sm);
}

.joyn-drop-zone.drag-over .joyn-drop-zone-icon-wrapper {
    background: var(--joyn-primary);
    box-shadow: var(--joyn-shadow-primary);
    transform: scale(1.08);
}

.joyn-drop-zone-placeholder i,
.joyn-drop-zone-icon {
    font-size: 22px;
    color: var(--joyn-gray-400);
    transition: var(--joyn-transition);
}

.joyn-drop-zone.drag-over .joyn-drop-zone-placeholder i,
.joyn-drop-zone.drag-over .joyn-drop-zone-icon {
    color: var(--joyn-bg-white);
}

.joyn-drop-zone-text {
    font-size: var(--joyn-font-size-sm);
    font-weight: 600;
    color: var(--joyn-gray-700);
    margin: 0 0 var(--joyn-spacing-1) 0;
    line-height: 1.4;
}

.joyn-drop-zone-text strong {
    color: var(--joyn-gray-800);
}

.joyn-drop-zone.drag-over .joyn-drop-zone-text,
.joyn-drop-zone.drag-over .joyn-drop-zone-text strong {
    color: var(--joyn-primary);
}

.joyn-drop-zone-hint {
    font-size: var(--joyn-font-size-xs);
    color: var(--joyn-gray-500);
    margin: 0;
    line-height: 1.5;
}

.joyn-drop-zone.drag-over .joyn-drop-zone-hint {
    color: var(--joyn-primary);
}

.joyn-drop-zone-hint-small {
    font-size: 11px;
    color: var(--joyn-gray-400);
    margin: 4px 0 0 0;
    line-height: 1.4;
}

/* ========================================
   Files List
   ======================================== */
.joyn-files-list {
    min-height: 70px;
    position: relative;
}

.joyn-files-list:has(.joyn-file-item) .joyn-drop-zone-placeholder {
    display: none !important;
}

.joyn-files-list .joyn-file-item ~ .joyn-drop-zone-placeholder {
    display: none !important;
}

/* ========================================
   File Item (Solapi)
   ======================================== */
.joyn-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background-color: var(--joyn-bg-white);
    border: 1px solid var(--joyn-gray-100);
    border-radius: var(--joyn-radius-sm);
    margin-bottom: 6px;
    transition: var(--joyn-transition);
}

.joyn-file-item:hover {
    border-color: var(--joyn-primary);
    box-shadow: var(--joyn-shadow-xs);
}

.joyn-file-item .file-icon {
    width: 40px;
    height: 40px;
    background: var(--joyn-primary-light);
    border-radius: var(--joyn-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.joyn-file-item .file-icon i {
    font-size: 20px;
    color: var(--joyn-primary);
}

.joyn-file-item .file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.joyn-file-item .file-name {
    font-weight: 500;
    color: var(--joyn-gray-900);
    font-size: var(--joyn-font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.joyn-file-item .file-size {
    font-size: var(--joyn-font-size-xs);
    color: var(--joyn-gray-500);
}

/* Progress Bar (Solapi Gradient) */
.joyn-file-item .file-progress {
    width: 100%;
    height: 3px;
    background-color: var(--joyn-gray-200);
    border-radius: var(--joyn-radius-full);
    overflow: hidden;
    margin-top: 6px;
}

.joyn-file-item .file-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--joyn-primary) 0%, var(--joyn-accent, #A788FF) 100%);
    border-radius: var(--joyn-radius-full);
    transition: width 0.3s ease;
}

/* ========================================
   Remove File Button
   ======================================== */
.joyn-remove-file {
    background: none;
    border: none;
    color: var(--joyn-gray-400);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--joyn-radius-sm);
    transition: var(--joyn-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.joyn-remove-file i {
    font-size: 18px;
}

.joyn-remove-file:hover {
    color: var(--joyn-error);
    background-color: var(--joyn-error-light);
}

/* ========================================
   File Type Icons (Solapi Colors)
   ======================================== */
.joyn-file-item[data-type="image"] .file-icon { background: #FFF8E1; }
.joyn-file-item[data-type="image"] .file-icon i { color: #F2994A; }

.joyn-file-item[data-type="document"] .file-icon { background: var(--joyn-info-light, #EFF4FF); }
.joyn-file-item[data-type="document"] .file-icon i { color: var(--joyn-info, #518CFF); }

.joyn-file-item[data-type="spreadsheet"] .file-icon { background: #ECFDF5; }
.joyn-file-item[data-type="spreadsheet"] .file-icon i { color: #10b981; }

.joyn-file-item[data-type="presentation"] .file-icon { background: #FDF2F8; }
.joyn-file-item[data-type="presentation"] .file-icon i { color: #ec4899; }

.joyn-file-item[data-type="audio"] .file-icon { background: var(--joyn-accent-light, #F0EBFF); }
.joyn-file-item[data-type="audio"] .file-icon i { color: var(--joyn-accent, #A788FF); }

.joyn-file-item[data-type="archive"] .file-icon { background: var(--joyn-warning-light, #FFF8F0); }
.joyn-file-item[data-type="archive"] .file-icon i { color: var(--joyn-warning, #F2994A); }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 639px) {
    .joyn-drop-zone {
        padding: var(--joyn-spacing-4);
    }

    .joyn-drop-zone-icon-wrapper {
        width: 42px;
        height: 42px;
    }

    .joyn-drop-zone-placeholder i,
    .joyn-drop-zone-icon {
        font-size: 20px;
    }

    .joyn-file-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .joyn-file-item .file-icon {
        width: 36px;
        height: 36px;
    }

    .joyn-file-item .file-icon i {
        font-size: 18px;
    }
}
