/* Resize Image to 50KB Tool Styles */

/* Custom Upload Area */
.upload-area {
    border: 2px dashed #d1d5db;
    transition: all 0.3s ease;
    min-height: 200px;
}

.upload-area:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.upload-area.drag-over {
    border-color: #2563eb;
    background-color: #eff6ff;
    transform: scale(1.02);
}

/* Settings Panel */
.settings-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #e2e8f0;
}

.settings-panel .setting-group {
    transition: all 0.2s ease;
}

.settings-panel .setting-group:hover {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
}

/* Custom Range Slider */
.quality-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: linear-gradient(to right, #ef4444 0%, #f59e0b 50%, #10b981 100%);
    border-radius: 3px;
    outline: none;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.quality-slider::-webkit-slider-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.quality-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.quality-slider::-moz-range-thumb:hover {
    background: #2563eb;
    transform: scale(1.1);
}

/* Queue Items */
.queue-item {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.queue-item:hover {
    background-color: #f1f5f9;
    border-left-color: #3b82f6;
    transform: translateX(4px);
}

.queue-item.processing {
    border-left-color: #f59e0b;
    background-color: #fef3c7;
}

.queue-item.completed {
    border-left-color: #10b981;
    background-color: #d1fae5;
}

.queue-item.error {
    border-left-color: #ef4444;
    background-color: #fee2e2;
}

/* Progress Bar Animation */
.progress-bar {
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8, #3b82f6);
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Result Cards */
.result-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.result-card img {
    transition: transform 0.3s ease;
}

.result-card:hover img {
    transform: scale(1.05);
}

/* Compression Progress Indicator */
.compression-indicator {
    position: relative;
    overflow: hidden;
}

.compression-indicator::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: scan 2s infinite;
}

@keyframes scan {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Loading Modal */
.loading-modal {
    backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.5);
}

.loading-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    width: 90%;
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Success Toast Animation */
.toast {
    animation: slideInRight 0.3s ease-out;
}

.toast.hide {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Button Effects */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::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.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .upload-area {
        min-height: 150px;
    }

    .queue-item {
        padding: 12px;
    }

    .queue-item .w-16.h-16 {
        width: 48px;
        height: 48px;
    }

    .result-card {
        margin-bottom: 16px;
    }

    .settings-panel {
        margin-bottom: 20px;
    }

    .loading-content {
        margin: 20px;
    }
}

@media (max-width: 640px) {
    .upload-area {
        min-height: 120px;
        padding: 20px;
    }

    .upload-area h3 {
        font-size: 18px;
    }

    .upload-area p {
        font-size: 14px;
    }

    .queue-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .queue-item .flex-1 {
        width: 100%;
    }

    .result-card .flex {
        flex-direction: column;
        gap: 8px;
    }

    .result-card .flex-1,
    .result-card .px-3 {
        flex: none;
        width: 100%;
    }
}

/* Advanced Features Panel */
.advanced-settings {
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.advanced-settings.expanded {
    max-height: 500px;
    padding: 20px;
}

.advanced-settings.collapsed {
    max-height: 60px;
    padding: 15px 20px;
    overflow: hidden;
}

.toggle-advanced {
    transition: transform 0.3s ease;
}

.toggle-advanced.rotated {
    transform: rotate(180deg);
}

/* File Format Icons */
.format-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.format-icon.jpeg {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f59e0b'%3E%3Cpath d='M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z'/%3E%3C/svg%3E");
}

.format-icon.png {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'%3E%3Cpath d='M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z'/%3E%3C/svg%3E");
}

.format-icon.webp {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%233b82f6'%3E%3Cpath d='M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z'/%3E%3C/svg%3E");
}

/* Batch Processing Indicators */
.batch-progress {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
}

.batch-item {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.batch-item:last-child {
    border-bottom: none;
}

.batch-item.processing {
    background-color: #fef3c7;
}

.batch-item.completed {
    background-color: #d1fae5;
}

.batch-item.error {
    background-color: #fee2e2;
}

/* Comparison Modal Styles */
.comparison-modal {
    backdrop-filter: blur(12px);
    background-color: rgba(0, 0, 0, 0.7);
}

.comparison-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.image-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.image-comparison img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .image-comparison {
        grid-template-columns: 1fr;
    }
}

/* Drag and Drop Visual Feedback */
.drop-zone-active {
    border-color: #3b82f6 !important;
    background-color: #eff6ff !important;
    transform: scale(1.02);
}

.drop-zone-active::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px dashed #3b82f6;
    border-radius: inherit;
    background: linear-gradient(45deg, transparent 25%, rgba(59, 130, 246, 0.1) 25%, rgba(59, 130, 246, 0.1) 50%, transparent 50%, transparent 75%, rgba(59, 130, 246, 0.1) 75%);
    background-size: 20px 20px;
    animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 20px;
    }
}

/* Enhanced Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}
