/**
 * Image Resizer Styles
 * 이미지 리사이즈 전용 스타일 (2컬럼 레이아웃)
 *
 * @package Zipper
 */

/* ===== 2컬럼 레이아웃 (데스크탑) ===== */
.resize-main-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    align-items: start;
}

.resize-input-col {
    position: sticky;
    top: 20px;
}

.resize-result-col {
    min-width: 0;
}

/* ===== 입력 섹션 ===== */
.resize-input-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
}

.resize-input-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.resize-input-title i {
    color: #d4af37;
}

/* 이미지 업로드 영역 */
.resize-upload-area {
    border: 2px dashed #e8e4dc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #faf9f7;
}

.resize-upload-area:hover {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

.resize-upload-area.dragover {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
}

.resize-upload-icon {
    font-size: 32px;
    color: #d4af37;
    margin-bottom: 8px;
}

.resize-upload-text {
    font-size: 13px;
    color: #5f5a56;
    margin-bottom: 4px;
}

.resize-upload-hint {
    font-size: 11px;
    color: #a09a94;
}

.resize-upload-input {
    display: none;
}

/* ===== 파일 리스트 (카드 그리드) ===== */
.resize-file-list-container {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.resize-file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.resize-file-list-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 6px;
}

.resize-file-list-title i {
    color: #d4af37;
}

.resize-file-count {
    font-size: 11px;
    color: #5f5a56;
    background: #f5f3f0;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 컴팩트 파일 그리드 - 가로형 리스트 */
.resize-file-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

/* 컴팩트 파일 카드 - 가로형 */
.resize-file-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    padding: 4px 28px 4px 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.resize-file-card:hover {
    border-color: #d4af37;
    background: #fff;
}

.resize-file-card.active {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

/* 작은 썸네일 */
.resize-file-card-thumb {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: repeating-conic-gradient(#e8e4dc 0% 25%, #fff 0% 50%) 50% / 6px 6px;
    border-radius: 4px;
    overflow: hidden;
}

.resize-file-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 인덱스 번호 */
.resize-file-card-index {
    position: absolute;
    top: -2px;
    left: -2px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #d4af37;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    border-radius: 7px;
}

/* 파일 정보 */
.resize-file-card-info {
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}

.resize-file-card-name {
    font-size: 11px;
    font-weight: 500;
    color: #2d2a26;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.resize-file-card-size {
    font-size: 10px;
    color: #a09a94;
}

/* 삭제 버튼 */
.resize-file-card-remove {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #a09a94;
    cursor: pointer;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.15s;
    font-size: 12px;
}

.resize-file-card:hover .resize-file-card-remove {
    opacity: 1;
}

.resize-file-card-remove:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* 기존 파일 리스트 스타일 (호환성) */
.resize-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
}

.resize-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    font-size: 12px;
}

.resize-file-item.active {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.08);
}

.resize-file-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    background: #e8e4dc;
}

.resize-file-info {
    flex: 1;
    min-width: 0;
}

.resize-file-name {
    font-weight: 500;
    color: #2d2a26;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resize-file-size {
    font-size: 11px;
    color: #a09a94;
}

.resize-file-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #a09a94;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.resize-file-remove:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* 리사이즈 모드 탭 */
.resize-mode-tabs {
    display: flex;
    gap: 4px;
    background: #f5f3f0;
    padding: 4px;
    border-radius: 8px;
}

.resize-mode-tab {
    flex: 1;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.resize-mode-tab:hover {
    color: #2d2a26;
}

.resize-mode-tab.active {
    background: #fff;
    color: #d4af37;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 모드별 패널 */
.resize-mode-panel {
    display: none;
}

.resize-mode-panel.active {
    display: block;
}

/* 픽셀 입력 그룹 */
.resize-dimension-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: end;
}

.resize-dimension-input {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resize-dimension-label {
    font-size: 11px;
    font-weight: 600;
    color: #5f5a56;
}

.resize-dimension-field {
    display: flex;
    align-items: center;
}

.resize-dimension-field input {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    text-align: center;
    transition: border-color 0.2s;
}

.resize-dimension-field input:focus {
    outline: none;
    border-color: #d4af37;
}

.resize-link-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 50%;
    color: #d4af37;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1px;
}

.resize-link-btn:hover {
    background: rgba(212, 175, 55, 0.1);
}

.resize-link-btn.unlinked {
    color: #a09a94;
}

.resize-link-btn.unlinked:hover {
    color: #d4af37;
}

/* 퍼센트 입력 */
.resize-percent-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resize-percent-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.resize-percent-input {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.resize-percent-input input {
    width: 80px;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    text-align: center;
}

.resize-percent-input input:focus {
    outline: none;
    border-color: #d4af37;
}

.resize-percent-input span {
    font-size: 14px;
    color: #5f5a56;
}

.resize-percent-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.resize-percent-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
}

.resize-percent-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.resize-percent-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border-color: #d4af37;
    color: #fff;
}

/* 원본 크기 표시 */
.resize-original-size {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: #faf9f7;
    border-radius: 6px;
    font-size: 12px;
    color: #5f5a56;
}

.resize-original-size i {
    color: #d4af37;
}

.resize-original-size strong {
    color: #2d2a26;
}

/* 출력 설정 */
.resize-output-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resize-format-row {
    display: flex;
    gap: 6px;
}

.resize-format-btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.resize-format-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.resize-format-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border-color: #d4af37;
    color: #fff;
}

/* 품질 슬라이더 */
.resize-quality-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resize-quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resize-quality-label {
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
}

.resize-quality-value {
    font-size: 12px;
    font-weight: 600;
    color: #d4af37;
}

.resize-quality-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #e8e4dc;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.resize-quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.resize-quality-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* 예상 파일 크기 */
.resize-estimate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(212, 175, 55, 0.08);
    border-radius: 6px;
    font-size: 12px;
}

.resize-estimate-label {
    color: #5f5a56;
}

.resize-estimate-value {
    font-weight: 600;
    color: #d4af37;
}

/* 액션 버튼 */
.resize-actions {
    display: flex;
    gap: 8px;
}

.resize-btn {
    flex: 1;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.resize-btn-primary {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #fff;
}

.resize-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.resize-btn-primary:disabled {
    background: #e8e4dc;
    color: #a09a94;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.resize-btn-secondary {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    color: #5f5a56;
}

.resize-btn-secondary:hover {
    border-color: #d4af37;
    color: #d4af37;
}

/* ===== 결과 영역 ===== */

/* 대기 상태 */
.resize-waiting {
    text-align: center;
    padding: 60px 20px;
    color: #a09a94;
    background: #faf9f7;
    border: 1px dashed #e8e4dc;
    border-radius: 10px;
}

.resize-waiting i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.resize-waiting p {
    font-size: 14px;
}

/* 결과 섹션 */
.resize-result-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 결과 요약 */
.resize-result-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
}

.resize-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: #faf9f7;
    border-radius: 8px;
}

.resize-summary-item .label {
    font-size: 11px;
    color: #a09a94;
}

.resize-summary-item .value {
    font-size: 15px;
    font-weight: 600;
    color: #2d2a26;
}

.resize-summary-item .value.positive {
    color: #28a745;
}

.resize-summary-item .value.negative {
    color: #dc3545;
}

.resize-summary-item.highlight {
    background: rgba(212, 175, 55, 0.1);
}

.resize-summary-item.highlight .label {
    color: #b8860b;
}

.resize-summary-item.highlight .value {
    color: #d4af37;
    font-size: 16px;
}

/* 결과 그리드 */
.resize-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding: 4px;
}

/* 결과 카드 */
.resize-result-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    transition: all 0.2s;
}

.resize-result-card:hover {
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 결과 썸네일 */
.resize-result-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-conic-gradient(#e8e4dc 0% 25%, #fff 0% 50%) 50% / 8px 8px;
    border-radius: 8px;
    overflow: hidden;
}

.resize-result-thumb canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* 결과 정보 */
.resize-result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resize-result-name {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resize-result-dimensions {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #5f5a56;
}

.resize-result-dimensions .old {
    color: #a09a94;
    text-decoration: line-through;
}

.resize-result-dimensions .new {
    color: #2d2a26;
    font-weight: 500;
}

.resize-result-dimensions i {
    font-size: 10px;
    color: #d4af37;
}

.resize-result-size {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.resize-result-size .old {
    color: #a09a94;
}

.resize-result-size .new {
    color: #2d2a26;
    font-weight: 500;
}

.resize-result-size i {
    font-size: 10px;
    color: #d4af37;
}

.resize-result-reduction {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.resize-result-reduction.positive {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.resize-result-reduction.negative {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* 개별 다운로드 버튼 */
.resize-result-download {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.resize-result-download:hover {
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
    transform: translateY(-1px);
}

.resize-result-download i {
    font-size: 16px;
}

/* 다운로드 버튼 영역 */
.resize-download-actions {
    display: flex;
    gap: 8px;
}

.resize-download-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #fff;
}

.resize-download-btn:hover {
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.resize-download-btn:disabled {
    background: #e8e4dc;
    color: #a09a94;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.resize-download-all-btn {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    color: #5f5a56;
}

.resize-download-all-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
    box-shadow: none;
    transform: none;
}

/* 면책조항 */
.resize-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: rgba(108, 117, 125, 0.08);
    border-radius: 8px;
    margin-top: 12px;
}

.resize-disclaimer i {
    color: #6c757d;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.resize-disclaimer-text {
    font-size: 12px;
    color: #5f5a56;
    line-height: 1.5;
}

.resize-disclaimer-text strong {
    color: #2d2a26;
}

/* 숨김 */
.resize-hidden {
    display: none !important;
}

/* ===== 반응형 - 태블릿 ===== */
@media (max-width: 900px) {
    .resize-main-layout {
        grid-template-columns: 300px 1fr;
        gap: 16px;
    }

    .resize-file-card-name {
        max-width: 80px;
    }

    .resize-result-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .resize-result-grid {
        grid-template-columns: 1fr;
        max-height: 400px;
    }
}

/* ===== 반응형 - 모바일 ===== */
@media (max-width: 768px) {
    .resize-main-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .resize-input-col {
        position: static;
    }

    .resize-input-section {
        padding: 14px;
    }

    .resize-dimension-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .resize-link-btn {
        margin: 0 auto;
    }

    .resize-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .resize-download-actions {
        flex-direction: column;
    }

    .resize-file-card-thumb {
        width: 32px;
        height: 32px;
    }

    .resize-file-card-name {
        max-width: 70px;
        font-size: 10px;
    }

    .resize-file-card-size {
        font-size: 9px;
    }

    .resize-result-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }

    .resize-summary-item {
        padding: 8px 6px;
    }

    .resize-summary-item .label {
        font-size: 10px;
    }

    .resize-summary-item .value {
        font-size: 14px;
    }

    .resize-result-grid {
        max-height: 350px;
    }

    .resize-result-card {
        padding: 10px;
        gap: 10px;
    }

    .resize-result-thumb {
        width: 60px;
        height: 60px;
    }

    .resize-result-name {
        font-size: 12px;
    }

    .resize-result-dimensions,
    .resize-result-size {
        font-size: 10px;
    }

    .resize-result-download {
        width: 32px;
        height: 32px;
    }

    .resize-result-download i {
        font-size: 14px;
    }
}

/* ===== 반응형 - 작은 모바일 ===== */
@media (max-width: 480px) {
    .resize-upload-area {
        padding: 16px;
    }

    .resize-upload-icon {
        font-size: 28px;
    }

    .resize-mode-tabs {
        flex-direction: column;
    }

    .resize-format-row {
        flex-wrap: wrap;
    }

    .resize-format-btn {
        min-width: 60px;
    }

    .resize-percent-presets {
        justify-content: center;
    }

    .resize-file-card {
        padding: 3px 24px 3px 3px;
        gap: 6px;
    }

    .resize-file-card-thumb {
        width: 28px;
        height: 28px;
    }

    .resize-file-card-index {
        min-width: 12px;
        height: 12px;
        font-size: 8px;
    }

    .resize-file-card-name {
        max-width: 60px;
        font-size: 10px;
    }

    .resize-file-card-size {
        font-size: 9px;
    }

    .resize-result-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 10px;
    }

    .resize-summary-item {
        padding: 6px 4px;
    }

    .resize-summary-item .label {
        font-size: 9px;
    }

    .resize-summary-item .value {
        font-size: 13px;
    }

    .resize-result-grid {
        max-height: 300px;
        gap: 8px;
    }

    .resize-result-card {
        flex-wrap: wrap;
        padding: 8px;
    }

    .resize-result-thumb {
        width: 50px;
        height: 50px;
    }

    .resize-result-info {
        flex: 1;
        min-width: calc(100% - 100px);
    }

    .resize-result-download {
        width: 28px;
        height: 28px;
    }

    .resize-result-download i {
        font-size: 12px;
    }
}
