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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top right, #1e1e24, #0a0a0a);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

header p {
    color: #a0a0a0;
    font-size: 1.1rem;
    font-weight: 300;
}

.card {
    background: rgba(30, 30, 35, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #818cf8;
    background: rgba(129, 140, 248, 0.1);
}

.drop-zone svg {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    color: #818cf8;
    stroke-width: 2;
}

.drop-zone h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: #fff;
}

.drop-zone p {
    color: #a0a0a0;
    margin-bottom: 16px;
}

.file-info {
    display: block;
    font-size: 0.875rem;
    color: #707070;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid #333;
}

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

.preview-item .remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.preview-item:hover .remove {
    opacity: 1;
}

.preview-item .remove:hover {
    background: #ef4444;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.resize-options {
    margin: 20px 0;
    padding: 20px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 8px;
}

.resize-options h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #888;
}

.resize-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.875rem;
    color: #888;
    margin-bottom: 6px;
}

.input-group input {
    padding: 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.resize-note {
    font-size: 0.75rem;
    color: #666;
    margin: 0;
}

.btn-secondary {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.processing-header {
    text-align: center;
    margin-bottom: 24px;
}

.processing-header h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #fff;
}

.processing-header p {
    color: #a0a0a0;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 24px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
    width: 0%;
    transition: width 0.5s;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat {
    text-align: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.results-header h3 {
    font-size: 1.5rem;
    color: #fff;
}

.results-buttons {
    display: flex;
    gap: 12px;
}

.btn-primary-small {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.btn-primary-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.result-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
}

.result-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 0;
}

.result-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
}

.result-label {
    display: block;
    font-size: 0.75rem;
    color: #a0a0a0;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ef4444;
    color: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateX(400px);
    transition: transform 0.3s;
    max-width: 400px;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.75rem;
    }

    .card {
        padding: 24px;
    }

    .preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}