/* Custom CSS for Image Resizer Tool */

/* Blue/Indigo theme colors */
:root {
    --blue-primary: #2563eb;
    --blue-secondary: #3b82f6;
    --indigo-primary: #4f46e5;
    --indigo-secondary: #6366f1;
}

/* Tab Navigation */
.tab-button {
    color: #6b7280;
    border-bottom-color: transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: var(--blue-primary);
    border-bottom-color: var(--blue-primary);
}

.tab-button:hover:not(.active) {
    color: var(--blue-secondary);
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom blue slider styling */
.slider-blue::-webkit-slider-thumb {
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-primary), var(--indigo-primary));
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-blue::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-primary), var(--indigo-primary));
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Upload area enhancements */
#uploadArea.drag-over {
    border-color: var(--blue-secondary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
    transform: scale(1.02);
}

.upload-icon svg {
    transition: all 0.3s ease;
}

#uploadArea:hover .upload-icon svg {
    transform: scale(1.1);
    color: var(--blue-secondary);
}

/* Aspect Ratio Lock Button */
.aspect-lock-btn {
    padding: 8px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
    transition: all 0.3s ease;
}

.aspect-lock-btn.locked {
    background: linear-gradient(135deg, var(--blue-primary), var(--indigo-primary));
    color: white;
}

.aspect-lock-btn:hover {
    background: #e5e7eb;
}

.aspect-lock-btn.locked:hover {
    background: linear-gradient(135deg, var(--blue-secondary), var(--indigo-secondary));
}

/* Aspect Ratio Buttons */
.aspect-ratio-btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.aspect-ratio-btn:hover {
    border-color: var(--blue-secondary);
    color: var(--blue-primary);
}

.aspect-ratio-btn.active {
    background: linear-gradient(135deg, var(--blue-primary), var(--indigo-primary));
    color: white;
    border-color: transparent;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(37, 99, 235, 0.2);
    border-top: 4px solid var(--blue-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Image preview styling */
#imagePreviewContainer {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#imagePreview {
    position: relative;
    background-image: linear-gradient(45deg, #f3f4f6 25%, transparent 25%), linear-gradient(-45deg, #f3f4f6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f3f4f6 75%), linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Image info grid styling */
.info-item {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(99, 102, 241, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.info-value {
    font-size: 1.125rem;
    font-weight: bold;
    color: var(--blue-primary);
    display: block;
}

.info-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Cropper container styling */
#cropContainer {
    min-height: 400px;
}

/* Batch processing styling */
.batch-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.batch-item:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.batch-item.processing {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(16, 185, 129, 0.05));
    border-color: rgba(34, 197, 94, 0.2);
}

.batch-item.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
    border-color: rgba(34, 197, 94, 0.3);
}

.batch-item.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border-color: rgba(239, 68, 68, 0.3);
}

/* Progress bar styling */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: rgba(156, 163, 175, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-primary), var(--indigo-primary));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Result comparison styling */
.result-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.result-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(45deg, #f3f4f6 25%, transparent 25%), linear-gradient(-45deg, #f3f4f6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f3f4f6 75%), linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.result-image img {
    width: 100%;
    height: auto;
    display: block;
}

.result-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(99, 102, 241, 0.05));
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--blue-primary);
    display: block;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Download button styling */
.download-btn {
    background: linear-gradient(135deg, var(--blue-primary), var(--indigo-primary));
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    .tab-button {
        font-size: 0.75rem;
        padding: 12px 4px;
    }

    .result-comparison {
        grid-template-columns: 1fr;
    }

    .result-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .batch-item {
        padding: 12px;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--blue-primary), var(--indigo-primary));
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--blue-secondary), var(--indigo-secondary));
}

/* Tooltip styling */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    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: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.tooltip:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}
