/* HEIC to PNG Converter - Custom Styles */

/* Enhanced Drop Zone Animations */
#dropZone {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#dropZone.drag-over {
    border-color: rgb(99 102 241);
    background-color: rgb(238 242 255);
    transform: scale(1.02);
}

#dropZone.drag-over .group-hover\:scale-105 {
    transform: scale(1.1);
}

/* File Item Styling */
.file-item {
    transition: all 0.2s ease;
    border: 1px solid rgb(229 231 235);
}

.file-item:hover {
    border-color: rgb(99 102 241);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.file-item.processing {
    border-color: rgb(251 191 36);
    background-color: rgb(255 251 235);
}

.file-item.completed {
    border-color: rgb(34 197 94);
    background-color: rgb(240 253 244);
}

.file-item.error {
    border-color: rgb(239 68 68);
    background-color: rgb(254 242 242);
}

/* Progress Bar Styling */
.progress-bar {
    height: 4px;
    background-color: rgb(229 231 235);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgb(99 102 241), rgb(139 92 246));
    border-radius: 2px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Preset Button Styling */
.preset-btn {
    position: relative;
    overflow: hidden;
}

.preset-btn.active {
    border-color: rgb(99 102 241);
    background-color: rgb(238 242 255);
    color: rgb(67 56 202);
}

.preset-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.3s ease;
}

.preset-btn:hover::before {
    left: 100%;
}

/* Advanced Settings Toggle Animation */
#advancedIcon {
    transition: transform 0.2s ease;
}

#advancedIcon.rotated {
    transform: rotate(180deg);
}

/* Custom Checkbox Styling */
input[type="checkbox"]:checked {
    background-color: rgb(99 102 241);
    border-color: rgb(99 102 241);
}

input[type="checkbox"]:focus {
    ring-color: rgb(99 102 241);
    ring-opacity: 0.5;
}

/* Result Item Styling */
.result-item {
    transition: all 0.2s ease;
    border: 1px solid rgb(229 231 235);
}

.result-item:hover {
    border-color: rgb(99 102 241);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Download Button Hover Effects */
.download-btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.3s ease;
}

.download-btn:hover::before {
    left: 100%;
}

/* Image Preview Styling */
.image-preview {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.image-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* File Size Badge */
.file-size-badge {
    background: linear-gradient(135deg, rgb(99 102 241), rgb(139 92 246));
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

/* Quality Indicator */
.quality-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: rgb(107 114 128);
}

.quality-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgb(34 197 94);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Compression Info Styling */
.compression-info {
    font-size: 0.875rem;
    color: rgb(107 114 128);
    font-style: italic;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .file-item {
        padding: 12px;
    }

    .result-item {
        padding: 12px;
    }

    .preset-btn {
        padding: 8px 12px;
    }

    #dropZone {
        padding: 24px 16px;
    }
}

/* High DPI Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
    .image-preview {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Focus States for Accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid rgb(99 102 241);
    outline-offset: 2px;
}

/* Loading Spinner */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgb(229 231 235);
    border-top: 2px solid rgb(99 102 241);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* File Format Badge */
.format-badge {
    background: linear-gradient(135deg, rgb(16 185 129), rgb(5 150 105));
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Error Message Styling */
.error-message {
    color: rgb(239 68 68);
    background-color: rgb(254 242 242);
    border: 1px solid rgb(252 165 165);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.875rem;
    margin-top: 8px;
}

/* Success Message Styling */
.success-message {
    color: rgb(34 197 94);
    background-color: rgb(240 253 244);
    border: 1px solid rgb(134 239 172);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.875rem;
    margin-top: 8px;
}

/* Watermark Preview */
.watermark-preview {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
}

.watermark-text-overlay {
    position: absolute;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    font-size: 0.875rem;
}

/* Smooth transitions for all interactive elements */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}
