/*
 * 파일명: style.css
 * 위치: /p/compress-image/assets/css/style.css
 * 기능: 이미지 압축기 전용 스타일 (index.php inline <style>에서 분리)
 * 작성일: 2025-07-23
 * 수정일: 2026-05-26 (외부 파일로 추출, 캐시 효율화)
 */

/* 이미지 압축기 히어로 섹션 특별 스타일 */
.compress-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.compress-hero::before {
    content: '🖼️';
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    opacity: 0.3;
    animation: compress-bounce 2s ease-in-out infinite;
}

.compress-hero::after {
    content: '⚡';
    position: absolute;
    bottom: 20px;
    left: 30px;
    font-size: 2.5rem;
    opacity: 0.3;
    animation: compress-flash 2s ease-in-out infinite alternate;
}

@keyframes compress-bounce {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-8px) scale(1.05); }
}

@keyframes compress-flash {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.6; transform: scale(1.2); }
}

/* 이미지 압축기 슬림 디자인 */
.compress-upload-zone {
    border: 2px dashed #e5e8ec;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem 0;
}

.compress-upload-zone:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e3f2fd 0%, #e1f5fe 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.15);
}

.compress-upload-zone.drag-over {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e8f5e8 0%, #f3e5f5 100%);
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.3);
}

.compress-upload-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.compress-upload-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.compress-upload-text {
    flex: 1;
    min-width: 200px;
}

.compress-upload-text h4 {
    color: #374151;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.compress-upload-text p {
    color: #6b7280;
    margin: 0;
    font-size: 0.9rem;
}

.compress-browse-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1976d2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.compress-browse-btn:hover {
    background: linear-gradient(135deg, #1976d2 0%, var(--primary-color) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
    color: white;
}

/* 파일 목록 스타일 */
.compress-file-list {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.compress-file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.compress-file-list-title {
    color: #374151;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.compress-file-count {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.compress-file-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.compress-file-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.compress-file-item:last-child {
    margin-bottom: 0;
}

.compress-file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.compress-file-icon {
    background: linear-gradient(135deg, var(--primary-color), #1976d2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.compress-file-details h6 {
    margin: 0 0 0.25rem 0;
    color: #374151;
    font-weight: 600;
    font-size: 0.95rem;
}

.compress-file-details small {
    color: #6b7280;
    font-size: 0.875rem;
}

.compress-remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.compress-remove-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* 설정 영역 */
.compress-settings {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.compress-settings-title {
    color: #374151;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.compress-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.compress-setting-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.compress-setting-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.15);
    transform: translateY(-2px);
}

.compress-setting-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.compress-setting-icon {
    background: linear-gradient(135deg, var(--primary-color), #1976d2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.compress-setting-title {
    color: #374151;
    font-weight: 600;
    margin: 0;
    font-size: 1rem;
}

/* 품질 설정 */
.compress-quality-display {
    background: linear-gradient(135deg, var(--primary-color), #1976d2);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.compress-quality-desc {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.compress-quality-range {
    margin-bottom: 1rem;
}

.compress-range-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.compress-quality-badges {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.compress-quality-badges .badge {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 너비 설정 */
.compress-width-input {
    display: flex;
    margin-bottom: 1rem;
}

.compress-width-input input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 8px 0 0 8px;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-right: none;
}

.compress-width-input input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.compress-width-unit {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 0.75rem;
    color: #6b7280;
    font-weight: 600;
}

.compress-width-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.compress-width-preset {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.compress-width-preset:hover {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

.compress-width-preset.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.compress-width-info {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

/* 포맷 설정 */
.compress-format-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.compress-format-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.compress-format-option:hover {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

.compress-format-option.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(25, 118, 210, 0.1));
}

.compress-format-icon {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.75rem;
    min-width: 45px;
    text-align: center;
}

.compress-format-icon.original { background: #6c757d; }
.compress-format-icon.jpg { background: #fd7e14; }
.compress-format-icon.png { background: #198754; }
.compress-format-icon.webp { background: #6f42c1; }

.compress-format-info {
    flex: 1;
}

.compress-format-title {
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
}

.compress-format-desc {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

.compress-recommended {
    background: #28a745;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* 처리 상태 */
.compress-processing {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 1.5rem 0;
}

.compress-processing .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary-color);
}

.compress-processing h3 {
    color: #374151;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
}

.compress-processing p {
    color: #6b7280;
    margin: 0 0 1rem;
}

.compress-progress {
    background: #e9ecef;
    border-radius: 10px;
    height: 1rem;
    overflow: hidden;
    margin: 1rem 0;
}

.compress-progress-bar {
    background: linear-gradient(135deg, var(--primary-color), #1976d2);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ============================================================
   결과 영역 (imgslim 디자인 이식 — 2026-05-26)
   ============================================================ */

.compress-results {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f3f5;
}

/* 헤더: 큰 체크 아이콘 + 제목 + 부제목 */
.compress-result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.compress-success-icon {
    width: 66px;
    height: 66px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #16a34a;
    background: #dcfce7;
    font-size: 32px;
    margin-bottom: 1rem;
}

.compress-result-title {
    color: #1f2937;
    font-weight: 700;
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

.compress-result-subtitle {
    color: #6b7280;
    margin: 0;
    font-size: 0.95rem;
}

.compress-result-subtitle strong {
    color: #1f2937;
    font-weight: 700;
}

/* 통계 카드 3개 (총 감소율 / 원본 크기 / 압축 크기) */
.compress-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.compress-summary-grid > div {
    padding: 1.25rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background: #f8f9fa;
    text-align: center;
}

.compress-summary-grid span {
    display: block;
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.compress-summary-grid strong {
    display: block;
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 800;
}

/* 결과 테이블 */
.compress-result-table {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.compress-result-table table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.compress-result-table th {
    background: #f8f9fa;
    color: #6b7280;
    font-weight: 700;
    padding: 0.875rem 1rem;
    border: none;
    font-size: 0.85rem;
    text-align: left;
}

.compress-result-table td {
    padding: 0.875rem 1rem;
    border: none;
    border-top: 1px solid #e9ecef;
    color: #374151;
    font-size: 0.9rem;
    vertical-align: middle;
}

.compress-result-table tr:first-child td {
    border-top: none;
}

/* 뱃지 — 변환/방향보정/감소율 공통 */
.compress-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 0.78rem;
    font-weight: 700;
    margin-left: 0.25rem;
    vertical-align: middle;
    letter-spacing: -0.01em;
}

/* 다운로드 버튼 — outline 스타일 */
.compress-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #ffffff;
    color: #1f2937;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    text-decoration: none;
}

.compress-download-btn:hover {
    background: #f9fafb;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
    text-decoration: none;
}

/* 액션 버튼 영역 */
.compress-result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.compress-result-actions .btn {
    padding: 0.75rem 2rem;
    font-weight: 700;
    border-radius: 10px;
}

/* 특징 카드 */
.compress-feature-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    border: 2px solid transparent;
}

.compress-feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.15);
    border-color: rgba(33, 150, 243, 0.2);
}

.compress-feature-icon {
    background: linear-gradient(135deg, var(--primary-color), #1976d2);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.compress-feature-card h3 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.compress-feature-card p {
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
    font-size: 0.9rem;
}

/* FAQ 스타일 */
.compress-faq {
    max-width: 800px;
    margin: 0 auto;
}

.compress-faq .accordion-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.compress-faq .accordion-button {
    background: white;
    color: #374151;
    font-weight: 600;
    padding: 1.25rem;
    border: none;
    font-size: 1rem;
}

.compress-faq .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.05), rgba(25, 118, 210, 0.05));
    color: var(--primary-color);
    box-shadow: none;
}

.compress-faq .accordion-body {
    padding: 1.25rem;
    color: #6b7280;
    line-height: 1.6;
}

/* 반응형 최적화 */
@media (max-width: 768px) {
    .compress-upload-content {
        flex-direction: column;
        text-align: center;
    }

    .compress-upload-text {
        min-width: auto;
    }

    .compress-settings-grid {
        grid-template-columns: 1fr;
    }

    .compress-file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .compress-file-info {
        width: 100%;
    }

    .compress-width-presets {
        grid-template-columns: repeat(2, 1fr);
    }

    .compress-summary-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .compress-summary-grid strong {
        font-size: 1.25rem;
    }

    .compress-result-actions {
        flex-direction: column;
    }

    .compress-result-table {
        font-size: 0.8rem;
    }

    .compress-result-table th,
    .compress-result-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 576px) {
    .compress-upload-zone {
        padding: 1rem;
    }

    .compress-upload-icon {
        font-size: 1.5rem;
    }

    .compress-settings {
        padding: 1rem;
    }

    .compress-setting-card {
        padding: 1rem;
    }

    .compress-file-list {
        padding: 1rem;
    }

    .compress-file-list-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}
