
.upload-area {
    transition: all 0.3s ease;
    cursor: pointer;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6 !important;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,123,255,0.1), transparent);
    transition: left 0.5s ease;
}

.upload-area:hover {
    border-color: var(--bs-primary) !important;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,123,255,0.15);
}

.upload-area:hover::before {
    left: 100%;
}

.upload-area.dragover {
    border-color: var(--bs-success) !important;
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(76,175,80,0.2);
}

.image-preview {
    position: relative;
    display: inline-block;
    margin: 10px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: white;
    border: 1px solid #f0f0f0;
}

.image-preview:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.image-preview img {
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
}

.image-preview:hover img {
    filter: brightness(1.05);
}

.image-preview .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.image-preview .remove-btn:hover {
    background: rgba(220, 53, 69, 1);
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 8px;
    font-size: 12px;
}

.result-item {
    border: 1px solid #e3f2fd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--bs-primary), var(--bs-success));
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.12);
    border-color: var(--bs-primary);
}

.result-item .original-info,
.result-item .converted-info {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.result-item .file-size {
    font-size: 0.9em;
    color: #6c757d;
}

.result-item .size-reduction {
    font-weight: bold;
}

.result-item .size-reduction.positive {
    color: #28a745;
}

.result-item .size-reduction.negative {
    color: #dc3545;
}

.conversion-settings {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.conversion-settings::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bs-primary), var(--bs-info), var(--bs-success));
}

.conversion-settings h5 {
    color: var(--bs-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.conversion-settings .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.75rem;
}

/* Quality Slider Enhancement */
.quality-slider-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.quality-labels {
    margin-bottom: 8px;
}

.quality-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.quality-label.active {
    opacity: 1;
}

.quality-slider-wrapper {
    margin: 15px 0;
}

.quality-slider {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #dc3545 0%, #ffc107 50%, #28a745 100%);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    z-index: 2;
}

.quality-slider::-webkit-slider-track {
    height: 8px;
    background: transparent;
    border-radius: 4px;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--bs-primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.quality-slider::-moz-range-track {
    height: 8px;
    background: linear-gradient(to right, #dc3545 0%, #ffc107 50%, #28a745 100%);
    border-radius: 4px;
    border: none;
}

.quality-slider::-moz-range-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--bs-primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.quality-value-display {
    margin: 15px 0;
}

.quality-badge {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--bs-primary);
    background: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--bs-primary);
    min-width: 60px;
    transition: all 0.3s ease;
}

.quality-description {
    margin-top: 5px;
}

.quality-presets {
    margin-top: 15px;
}

.quality-preset {
    transition: all 0.2s ease;
    border-radius: 6px !important;
}

.quality-preset.active {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #0d6efd 100%);
    border-color: var(--bs-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(13,110,253,0.4);
    position: relative;
}

.quality-preset.active::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--bs-success);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.quality-preset:hover:not(.active) {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Color coding for quality levels */
.quality-low .quality-badge {
    border-color: #dc3545;
    color: #dc3545;
}

.quality-medium .quality-badge {
    border-color: #ffc107;
    color: #ffc107;
}

.quality-high .quality-badge {
    border-color: #28a745;
    color: #28a745;
}

.form-range::-webkit-slider-thumb {
    background: var(--bs-primary);
}

.form-range::-moz-range-thumb {
    background: var(--bs-primary);
    border: none;
}

#resizeOptions {
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-top: 10px;
}

.progress {
    height: 12px;
    border-radius: 20px;
    overflow: hidden;
    background: #e9ecef;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
    background: linear-gradient(90deg, var(--bs-primary) 0%, var(--bs-info) 50%, var(--bs-success) 100%);
    background-size: 200% 100%;
    animation: progressGradient 2s ease-in-out infinite;
    border-radius: 20px;
    transition: width 0.3s ease;
}

@keyframes progressGradient {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.conversion-progress {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.conversion-progress h5 {
    color: var(--bs-primary);
    font-weight: 600;
}

.results-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

/* 광고 모달 스타일 */
.ad-placeholder {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: 2px dashed #dee2e6 !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    transition: all 0.3s ease;
}

.ad-placeholder:hover {
    border-color: var(--bs-primary) !important;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
}

.ad-placeholder h5 {
    color: var(--bs-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ad-placeholder .placeholder {
    opacity: 0.7;
    animation: pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    100% { opacity: 0.3; }
}

.download-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 1rem 0;
}

.download-countdown #countdown {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--bs-primary);
    min-width: 20px;
    text-align: center;
}

/* 광고 모달 반응형 */
@media (max-width: 576px) {
    .ad-placeholder {
        min-height: 150px;
        padding: 1rem !important;
    }
    
    .ad-placeholder h5 {
        font-size: 1rem;
    }
    
    .download-countdown {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .download-countdown #countdown {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .image-preview {
        margin: 8px;
        width: calc(50% - 16px);
    }
    
    .image-preview img {
        max-width: 100%;
        max-height: 120px;
        width: 100%;
    }
    
    .result-item {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .result-item .original-info,
    .result-item .converted-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .conversion-settings,
    .conversion-progress {
        padding: 20px;
        margin: 15px 0;
    }
    
    .quality-slider-container {
        padding: 15px;
    }
    
    .upload-area {
        padding: 2rem 1rem !important;
    }
    
    .upload-area h5 {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .image-preview {
        width: calc(100% - 16px);
        margin: 8px;
    }
    
    .quality-presets .btn-group {
        flex-direction: column;
    }
    
    .quality-preset {
        margin-bottom: 5px;
        border-radius: 8px !important;
    }
}
