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

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    font-family: 'Inter', sans-serif;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    flex-wrap: wrap;
}

.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #3b82f6;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    flex: 1;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: #94a3b8;
    /* max-width: 600px; */
    margin: 0 auto;
}

/* Main Content Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Card Styles */
.card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #f1f5f9;
}

/* Drop Area */
#drop-area {
    border: 2px dashed rgba(59, 130, 246, 0.5);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(15, 23, 42, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

#drop-area.hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

#drop-area h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

#image {
    display: none;
}

.upload-label {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s;
}

.upload-label:hover {
    transform: translateY(-2px);
}

#file-names {
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.9rem;
}

#file-names p {
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #cbd5e1;
    font-size: 0.9rem;
}

select,
input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    color: #e2e8f0;
    font-size: 1rem;
    transition: border-color 0.3s;
}

select:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
}

select option {
    background: #1e293b;
    color: #e2e8f0;
}

.dimension-inputs {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.dimension-inputs.active {
    display: grid;
}

/* Quality Slider */
.slider-container {
    position: relative;
    margin-top: 1rem;
}

.slider-value {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border-radius: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Image Preview */
.preview-container {
    display: none;
}

.preview-container.active {
    display: block;
}

#settingsDivider,
#settingsTitle {
    display: none;
}

.preview-box-single {
    position: relative;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preview-box-single img {
    max-width: 100%;
    max-height: 450px;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.preview-info {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 0.5rem;
}

.preview-info.size-increase {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.preview-info.size-excellent {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Button */
.btn-optimize {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-optimize:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-optimize:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loader */
.loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 2000;
}

.loader.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    z-index: 1999;
}

.loader-overlay.active {
    display: block;
}

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

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

    100% {
        transform: rotate(360deg);
    }
}

/* Footer */
.footer {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #3b82f6;
}

.footer-credit {
    color: #64748b;
    font-size: 0.9rem;
}

.footer-credit a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
}

.footer-credit a:hover {
    text-decoration: underline;
}