/* Unique Modern Design System */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    z-index: -1;
}

/* Glassmorphism Container */
.glass-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Unique Animations */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(2deg); }
    66% { transform: translateY(-10px) rotate(-1deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(120, 119, 198, 0.5); }
    50% { box-shadow: 0 0 40px rgba(120, 119, 198, 0.8); }
}

@keyframes morph {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

@keyframes slideInFromTop {
    from { 
        opacity: 0; 
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInFromBottom {
    from { 
        opacity: 0; 
        transform: translateY(50px) scale(0.9);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

@keyframes bounce-in {
    0% { 
        opacity: 0; 
        transform: scale(0.3);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.05);
    }
    70% { 
        transform: scale(0.9);
    }
    100% { 
        transform: scale(1);
    }
}

/* Unique Button Styles */
.btn-glow {
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

.btn-glow:hover::before {
    left: 100%;
}

.btn-glow:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(120, 119, 198, 0.4);
}

/* Unique Drop Zone */
.dropzone-unique {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(15px);
    border: 2px dashed rgba(255, 255, 255, 0.7);
    border-radius: 32px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: white;
}

.dropzone-unique h3,
.dropzone-unique p,
.dropzone-unique button {
    position: relative;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dropzone-unique h3 {
    color: white !important;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.dropzone-unique p {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.dropzone-unique::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    animation: morph 8s ease-in-out infinite;
    z-index: 1;
}

.dropzone-unique:hover::before,
.dropzone-unique.dragover::before {
    opacity: 1;
}

.dropzone-unique:hover,
.dropzone-unique.dragover {
    border-color: rgba(255, 255, 255, 1);
    background: rgba(255, 255, 255, 0.55);
    transform: scale(1.03);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

/* Unique Card Styles */
.card-unique {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-unique:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

/* Select Dropdown Styling */
select {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    font-weight: 500;
}

select option {
    background: rgba(30, 30, 50, 0.95) !important;
    color: white !important;
    padding: 8px;
}

select:focus {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Input field styling */
input[type="number"] {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

input[type="number"]:focus {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

input[type="number"]::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Thumbnail Preview Styling */
.thumbnail-item {
    flex: 0 0 auto;
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.thumbnail-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-item .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.thumbnail-item:hover .remove-btn {
    opacity: 1;
}

.thumbnail-item .remove-btn:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

.thumbnail-item .file-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 8px;
    font-size: 11px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thumbnail-item:hover .file-info {
    opacity: 1;
}

/* Custom scrollbar for thumbnails */
#thumbnailContainer::-webkit-scrollbar {
    height: 8px;
}

#thumbnailContainer::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

#thumbnailContainer::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

#thumbnailContainer::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* Image Modal Styling */
#imageModal {
    animation: fadeIn 0.3s ease-out;
}

#imageModal .glass-container {
    animation: slideInFromBottom 0.4s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

#modalImage {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

#modalImage:hover {
    transform: scale(1.02);
}

.modal-info-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-info-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.modal-info-value {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* Modal animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Range Slider Styling */
input[type="range"] {
    background: rgba(255, 255, 255, 0.2) !important;
    height: 8px !important;
    border-radius: 10px !important;
    outline: none !important;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    border: 2px solid white !important;
}

input[type="range"]::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    border: 2px solid white !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* Text Styles */
.text-gradient {
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.text-glow {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Unique Progress Bar */
.progress-unique {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill-unique {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
    animation: gradientShift 2s linear infinite;
}

/* Floating Elements */
.floating-shapes {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

/* Ad Space Styling */
.adsbygoogle {
    display: block !important;
    min-height: 90px;
    min-width: 300px;
    width: 100%;
}

/* Ad container styling */
.ad-container {
    width: 100%;
    min-height: 90px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Hide empty ad containers until loaded */
.glass-container:has(.adsbygoogle:empty) {
    display: none;
}

/* AdSense error handling */
ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}

/* Fallback for when ads don't load */
.ad-fallback {
    display: none;
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.ad-container:has(ins.adsbygoogle[data-ad-status="unfilled"]) .ad-fallback {
    display: block;
}

/* Better spacing for sections */
section {
    scroll-margin-top: 100px;
}
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Enhanced drop zone */
#dropZone {
    /* background: #f8fafc; */
    border: 2px dashed #e2e8f0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#dropZone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    animation: slideIn 3s infinite;
}

#dropZone.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.25);
}

#dropZone:hover {
    transform: scale(1.01);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1;
}

#dropZone .fa-cloud-upload-alt {
    transition: all 0.3s ease;
}

#dropZone:hover .fa-cloud-upload-alt {
    transform: scale(1.1)
}

/* Custom range slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: linear-gradient(to right, #e2e8f0 0%, #3b82f6 100%);
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #3b82f6;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

/* Image card styles */
.image-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.image-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.image-preview {
    position: relative;
    background: #f8fafc;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.image-card:hover .image-preview img {
    transform: scale(1.05);
}

.comparison-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
    backdrop-filter: blur(10px);
    animation: fadeInScale 0.6s ease-out;
}

.compression-stats {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.stat-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.size-reduction {
    color: #10b981;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
}

/* Button enhancements */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.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);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 5px 10px rgba(59, 130, 246, 0.3);
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    border-top: 3px solid #3b82f6;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 3px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    #dropZone {
        padding: 40px 20px;
    }
    
    .compression-stats {
        padding: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: #111827;
        color: #f3f4f6;
    }
    
    .bg-white {
        background: #1f2937 !important;
    }
    
    .text-gray-800 {
        color: #f3f4f6 !important;
    }
    
    .text-gray-700 {
        color: #d1d5db !important;
    }
    
    .text-gray-600 {
        color: #9ca3af !important;
    }
}
