/* AJAX 업로드 시스템 스타일 */
.t2-ajax-upload-area {
    margin-top: 20px;
    border: 2px dashed #ddd;
    padding: 20px;
    transition: all 0.3s ease;
}

.t2-ajax-upload-area:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

.t2-upload-zone {
    text-align: center;
    padding: 40px 20px;
    position: relative;
}

.t2-upload-zone.t2-drag-over {
    border-color: #007cba;
    background: #e3f2fd;
    transform: scale(1.02);
}

.t2-upload-icon {
    margin-bottom: 20px;
}

.t2-upload-icon .material-icons {
    font-size: 48px;
    color: #666;
}

.t2-upload-text h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.t2-upload-text p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.t2-upload-hint {
    font-size: 12px !important;
    color: #999 !important;
    margin-top: 10px !important;
}

.t2-upload-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.t2-upload-btn:hover {
    background: #005a87;
}

.t2-upload-progress {
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
}

.t2-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.t2-progress-fill {
    height: 100%;
    background: #007cba;
    width: 0%;
    transition: width 0.3s ease;
}

.t2-progress-text {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.t2-uploaded-files {
    margin-top: 20px;
}

.t2-file-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.t2-select-all-btn,
.t2-unselect-all-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.t2-select-all-btn:hover,
.t2-unselect-all-btn:hover {
    background: #5a6268;
}

.t2-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.t2-file-item:hover {
    border-color: #007cba;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background: #f8f9fa;
}

.t2-file-item.t2-file-selected {
    border-color: #007cba;
    background: #e3f2fd;
    box-shadow: 0 2px 8px rgba(0,123,186,0.2);
}

.t2-file-checkbox {
    margin-right: 10px;
}

.t2-file-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #007cba;
}

.t2-file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.t2-file-icon {
    font-size: 24px;
    color: #666;
    margin-right: 10px;
}

.t2-file-details {
    flex: 1;
}

.t2-file-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    word-break: break-all;
}

.t2-file-size {
    font-size: 12px;
    color: #666;
}

.t2-file-actions {
    display: flex;
    gap: 5px;
}

.t2-insert-btn,
.t2-delete-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.t2-insert-btn {
    color: #007cba;
}

.t2-insert-btn:hover {
    background: #e3f2fd;
}

.t2-delete-btn {
    color: #f44336;
}

.t2-delete-btn:hover {
    background: #ffebee;
}

.t2-insert-btn .material-icons,
.t2-delete-btn .material-icons {
    font-size: 18px;
}

.t2-selected-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin: 10px 0;
    background: #e3f2fd;
    border: 1px solid #007cba;
    border-radius: 5px;
    font-size: 14px;
    color: #007cba;
}

.t2-insert-selected-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s ease;
}

.t2-insert-selected-btn:hover {
    background: #005a87;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .t2-ajax-upload-area {
        padding: 15px;
    }
    
    .t2-upload-zone {
        padding: 20px 10px;
    }
    
    .t2-upload-text h3 {
        font-size: 16px;
    }
    
    .t2-upload-text p {
        font-size: 13px;
    }
    
    .t2-file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .t2-file-actions {
        align-self: flex-end;
    }
}

/* 썸네일 그리드 스타일 */
.t2-files-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 8px !important;
    margin-top: 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    grid-auto-rows: 100px !important;
    box-sizing: border-box !important;
}

.t2-files-grid > * {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.t2-file-thumbnail {
    position: relative !important;
    background: white !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px !important;
    padding: 6px !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    flex: 1 1 auto !important;
    aspect-ratio: 1 / 1 !important;
}

.t2-file-thumbnail:hover {
    border-color: #007cba !important;
    box-shadow: 0 2px 8px rgba(0, 123, 186, 0.2) !important;
    transform: translateY(-2px) !important;
}

.t2-file-thumbnail.t2-file-selected {
    border-color: #007cba !important;
    background: #e3f2fd !important;
}

.t2-thumbnail-checkbox {
    position: absolute !important;
    top: 5px !important;
    left: 5px !important;
    z-index: 10 !important;
}

.t2-thumbnail-checkbox input[type="checkbox"] {
    width: 12px !important;
    height: 12px !important;
    cursor: pointer !important;
}

.t2-thumbnail-content {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 6px 0 4px 0 !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
}

.t2-thumbnail-image {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 3px !important;
    object-fit: cover !important;
    object-position: center !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    overflow: hidden !important;
}

.t2-thumbnail-icon {
    font-size: 18px !important;
    color: #666 !important;
}

.t2-thumbnail-info {
    margin-top: auto !important;
}

.t2-thumbnail-name {
    font-size: 10px !important;
    color: #333 !important;
    font-weight: 500 !important;
    margin-bottom: 2px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    line-height: 1.2 !important;
}

.t2-thumbnail-size {
    font-size: 9px !important;
    color: #999 !important;
    line-height: 1.1 !important;
}

.t2-thumbnail-actions {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    display: flex !important;
    gap: 2px !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.t2-file-thumbnail:hover .t2-thumbnail-actions {
    opacity: 1 !important;
}

.t2-thumbnail-actions button {
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    border: none !important;
    border-radius: 2px !important;
    width: 14px !important;
    height: 14px !important;
    font-size: 8px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.3s ease !important;
}

.t2-thumbnail-actions button:hover {
    background: rgba(0, 0, 0, 0.9) !important;
}

.t2-thumbnail-actions .t2-insert-btn {
    background: rgba(0, 123, 186, 0.8) !important;
}

.t2-thumbnail-actions .t2-insert-btn:hover {
    background: rgba(0, 123, 186, 1) !important;
}

.t2-thumbnail-actions .t2-delete-btn {
    background: rgba(244, 67, 54, 0.8) !important;
}

.t2-thumbnail-actions .t2-delete-btn:hover {
    background: rgba(244, 67, 54, 1) !important;
}

/* 강제 그리드 설정 */
.t2-files-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    grid-template-rows: auto !important;
    display: grid !important;
}

.t2-files-grid .t2-file-thumbnail {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex-shrink: 1 !important;
    flex-grow: 0 !important;
    overflow: hidden !important;
}

/* 업로드된 파일 컨테이너 */
.t2-uploaded-files {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.t2-uploaded-files .t2-file-controls {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.t2-upload-controls {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* 반응형 그리드 */
@media (max-width: 768px) {
    .t2-files-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .t2-files-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
} 