:root {
    --primary: #9d4edd;
    --primary-hover: #c77dff;
    --secondary: #e0aaff;
    --bg-dark: #10002b;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #ccccff;
    --success: #2ecc71;
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Animations */
.background-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: drift 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #3c096c;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: #5a189a;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes drift {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(50px, 50px);
    }
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

header h1 span {
    background: linear-gradient(135deg, var(--secondary), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Settings */
.settings {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setting-item.full-width {
    width: 100%;
}

.setting-item label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-item input {
    display: none;
    /* Hide old input if still there */
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
}

.size-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.size-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.size-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.setting-item input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(157, 78, 221, 0.2);
}

.ratio-selector {
    display: flex;
    gap: 0.5rem;
}

.ratio-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.ratio-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.ratio-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.3);
}

.setting-item .hint {
    font-size: 0.7rem;
    color: #888;
}

/* Drop Zone */
.drop-zone {
    background: var(--glass-bg);
    border: 2px dashed var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(157, 78, 221, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(157, 78, 221, 0.3);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
    /* Let clicks pass through to container */
}

.upload-icon {
    color: var(--secondary);
    transition: transform 0.3s ease;
}

.drop-zone:hover .upload-icon {
    transform: scale(1.1) translateY(-5px);
}

.drop-zone h3 {
    font-size: 1.5rem;
    font-weight: 500;
}

.drop-zone p {
    color: var(--text-muted);
}

/* Results */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #000;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: rgba(46, 204, 113, 0.2);
    color: var(--success);
    font-weight: 600;
}

.download-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.download-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.4);
}

.download-btn svg {
    width: 16px;
    height: 16px;
}