/* Resize Image to 100KB Tool - Custom Styles */

/* Custom slider styling for emerald theme */
.slider-emerald {
    background: linear-gradient(to right, #d1fae5, #10b981);
}

.slider-emerald::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #059669;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease-in-out;
}

.slider-emerald::-webkit-slider-thumb:hover {
    background: #047857;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.slider-emerald::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #059669;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease-in-out;
}

.slider-emerald::-moz-range-thumb:hover {
    background: #047857;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Drag and drop area styling */
.drag-over {
    border-color: #10b981 !important;
    background-color: #d1fae5;
    transform: scale(1.02);
    transition: all 0.3s ease-in-out;
}

/* Queue item styling */
.queue-item {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease-in-out;
}

.queue-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.queue-item.processing {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #10b981;
    animation: pulse-green 2s infinite;
}

.queue-item.completed {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #22c55e;
}

.queue-item.error {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    border-color: #ef4444;
}

@keyframes pulse-green {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

/* Result card styling */
.result-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.result-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #10b981;
}

/* Image preview styling */
.image-preview {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.image-preview img {
    transition: all 0.3s ease-in-out;
}

.image-preview:hover img {
    transform: scale(1.05);
}

/* Progress bar animations */
.progress-bar-animated {
    background: linear-gradient(90deg, #10b981, #059669, #047857, #059669, #10b981);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* File info badges */
.file-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
}

.file-badge.size {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

.file-badge.format {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.file-badge.compression {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

/* Responsive image grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Download button styling */
.download-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.download-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.download-btn:active {
    transform: translateY(0);
}

/* Loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f1f5f9, #e2e8f0, #f1f5f9);
    background-size: 200% 100%;
    animation: loading-pulse 1.5s infinite;
}

@keyframes loading-pulse {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Success/Error indicators */
.success-indicator {
    color: #10b981;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.error-indicator {
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Quality comparison slider */
.quality-comparison {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
}

.quality-comparison .before,
.quality-comparison .after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.quality-comparison .after {
    clip-path: inset(0 0 0 50%);
    transition: clip-path 0.3s ease-in-out;
}

/* Tooltip styling */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #374151;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.tooltip:hover::before {
    content: "";
    position: absolute;
    bottom: 94%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #374151;
    z-index: 10;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .queue-item {
        padding: 12px;
    }

    .result-card {
        margin-bottom: 16px;
    }

    .file-badge {
        font-size: 0.625rem;
        padding: 2px 6px;
    }

    .download-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

/* Print styles */
@media print {
    .drag-over,
    .queue-item.processing,
    .progress-bar-animated,
    .loading-skeleton {
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .queue-item,
    .result-card,
    .file-badge {
        border-width: 2px;
    }

    .slider-emerald::-webkit-slider-thumb {
        border-width: 4px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
