/* Enhanced CSS Reset and Modern Gradient Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: transparent;
    padding: 20px;
    min-height: 100vh;
}

.animated-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    background: linear-gradient(120deg, #667eea 0%, #f093fb 50%, #f5576c 100%);
    animation: gradientMove 8s ease-in-out infinite alternate;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}


.container {
    max-width: 800px;
    margin: 0 auto;
    background: transparent;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 8px 32px var(--shadow-color);
    position: relative;
    transition: all 0.3s ease;
}

.glass {
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 4px 32px rgba(102,126,234,0.08);
}

.container:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}


.main-header {
    text-align: center;
    margin-bottom: 36px;
    padding-top: 10px;
}

.logo-circle {
    display: inline-block;
    border-radius: 50%;
    padding: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px rgba(102,126,234,0.18);
    background: none; /* SVG now handles the gradient background */
}
.logo-circle svg {
    display: block;
    filter: drop-shadow(0 2px 8px rgba(123, 146, 248, 0.158));
}
/*
.logo-img {
  width: 48px;  adjust size
  height: auto;
}

 Dark mode version 
@media (prefers-color-scheme: dark) {
  .logo-img {
    content: url('logo-dark.svg');
  }
}
*/

h1 {
    font-size: 2.7em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    margin-bottom: 8px;
}

.subtitle {
    color: #222;
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 0;
    text-shadow: 0 2px 8px rgba(102,126,234,0.12);
}

/* Modern File Upload Area */

.file-upload-area {
    margin-bottom: 30px;
    box-shadow: 0 2px 16px rgba(89, 111, 209, 0.08);
    border-radius: 18px;
    padding: 28px;
}


.upload-zone {
    border: 2.5px dashed rgba(102,126,234,0.22);
    border-radius: 18px;
    padding: 44px 32px;
    text-align: center;
    transition: all 0.3s cubic-bezier(.4,2,.3,1);
    background: rgba(255,255,255,0.10);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(102,126,234,0.08);
}
.upload-zone:hover {
    border-color: #764ba2;
    background: rgba(118,75,162,0.12);
    transform: scale(1.03);
}
.upload-zone.drag-over {
    border-color: #f5576c;
    background: rgba(245,87,108,0.10);
    transform: scale(1.05);
}


.upload-icon {
    margin-bottom: 18px;
    color: rgba(255,255,255,0.92);
    transition: all 0.3s cubic-bezier(.4,2,.3,1);
    filter: drop-shadow(0 2px 8px rgba(102,126,234,0.12));
}
.upload-zone:hover .upload-icon {
    color: #764ba2;
    transform: scale(1.08);
}

.upload-text h2{
     font-size: 2.2rem;
  font-weight: bold;
  background: linear-gradient(90deg, #fd30f3, #695aee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text; 
    
    
}

/*.upload-text h2{
    color: #fffdfe;
    font-size: 1.8em;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(102,126,234,0.12);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-bottom: 12px;
    
     font-size: 2em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin-bottom: 8px;
}*/


.upload-text h3 {
    color: #fffdfe;
    margin-bottom: 10px;
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: 0.5px;
     text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}


.browse-text {
    color: #ec82f8;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
    font-weight: 600;
}
.browse-text:hover {
    color: #f5576c;
}

.upload-text p {
    color: rgb(255, 255, 255);
    font-size: 0.9em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* File Preview */

.file-preview {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px;
}
.file-item {
    background: rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 16px 10px 12px 10px;
    text-align: center;
    transition: all 0.3s cubic-bezier(.4,2,.3,1);
    position: relative;
    box-shadow: 0 2px 12px rgba(102,126,234,0.08);
    border: 1px solid rgba(255,255,255,0.22);
}
.file-item:hover {
    background: rgba(255,255,255,0.28);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 18px rgba(102,126,234,0.12);
}
.file-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.10);
}
.file-item .file-name {
    font-size: 0.95em;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    margin-bottom: 2px;
    text-shadow: 0 1px 4px rgba(255,255,255,0.18);
}
.file-item .remove-btn {
    position: absolute;
    top: 7px;
    right: 7px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(.4,2,.3,1);
    box-shadow: 0 2px 8px rgba(245,87,108,0.12);
}
.file-item .remove-btn:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    transform: scale(1.13);
}

/* Enhanced Buttons */

.compress-btn {
    width: 100%;
    background: var(--success-gradient);
    color: white;
    padding: 17px 32px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 19px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(.4,2,.3,1);
    box-shadow: 0 4px 18px rgba(79,172,254,0.18);
    position: relative;
    overflow: hidden;
    margin-top: 18px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.compress-btn .btn-icon {
    margin-right: 8px;
    font-size: 1.1em;
    vertical-align: middle;
}
.compress-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 28px rgba(79,172,254,0.22);
}
.compress-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1em;
}
.spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top: 2.5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Output Area */

#output {
    margin-top: 32px;
    box-shadow: 0 2px 16px rgba(102,126,234,0.08);
    border-radius: 18px;
    padding-bottom: 8px;
}
.output-item {
    background: rgba(255,255,255,0.18);
    border-radius: 15px;
    padding: 22px 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 22px;
    transition: all 0.3s cubic-bezier(.4,2,.3,1);
    box-shadow: 0 2px 12px rgba(102,126,234,0.08);
    border: 1px solid rgba(255,255,255,0.22);
}
.output-item:hover {
    background: rgba(255,255,255,0.28);
    box-shadow: 0 4px 18px rgba(102,126,234,0.12);
    transform: scale(1.03);
}
.output-item img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.10);
}
.output-info {
    flex: 1;
    min-width: 0;
}
.output-info h4 {
    color: #222;
    margin-bottom: 5px;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(255,255,255,0.18);
}
.output-info p {
    color: #333;
    font-size: 0.98em;
    margin: 2px 0;
    text-shadow: 0 1px 4px rgba(255,255,255,0.18);
}
.download-btn {
    background: var(--secondary-gradient);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 28px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(.4,2,.3,1);
    box-shadow: 0 2px 8px rgba(245,87,108,0.12);
}
.download-btn:hover {
    transform: scale(1.08);
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}


/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    h1 {
        font-size: 2em;
    }
    .upload-zone {
        padding: 30px 16px;
    }
    .file-preview {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    .output-item img {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    .container {
        padding: 10px;
    }
    .upload-zone {
        padding: 14px;
    }
    .file-preview {
        grid-template-columns: 1fr 1fr;
    }
    .output-item img {
        width: 40px;
        height: 40px;
    }
}

.footer {
    text-align: center;
    margin-top: 38px;
    color: #222;
    font-size: 1em;
    opacity: 0.92;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 4px rgba(255,255,255,0.18);
}
.footer a {
    color: #9302a3;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}
.footer a:hover {
    color: #f5576c;
}
