:root {
    --bg-dark: #0f0f1a;
    --bg-light: #1a1a2e;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b5;
    --accent-glow: rgba(45, 130, 255, 0.6);
    --accent-gradient: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top for longer content */
    min-height: 100vh;
    background-image: radial-gradient(circle at top left, var(--bg-light) 0%, var(--bg-dark) 40%);
}

.converter-tool {
    width: 100%;
    max-width: 700px;
    background: var(--bg-light);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

h1, h2 {
    margin: 0;
}

.tool-header h1 {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tool-header p, .instructions {
    color: var(--text-secondary);
    margin-top: 5px;
    font-size: 0.9rem;
    text-align: center;
}

.tool-section {
    margin-bottom: 25px;
}

.tool-section h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    border-left: 3px solid #2575fc;
    padding-left: 10px;
}

input[type="file"], select, input[type="number"] {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    box-sizing: border-box;
}

input[type="file"] {
    border-style: dashed;
    color: var(--text-secondary);
    cursor: pointer;
}

#previewContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    min-height: 100px;
    background-color: var(--bg-dark);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    transition: transform 0.2s ease;
}

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

.preview-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

button {
    display: block;
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    background: var(--accent-gradient);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

#status {
    text-align: center;
    margin-top: 15px;
    color: var(--text-secondary);
}

@media (max-width: 600px) {
    body { padding: 10px; }
    .converter-tool { padding: 15px; }
    .options-grid { grid-template-columns: 1fr; }
    .tool-header h1 { font-size: 1.8rem; }
    button { font-size: 1rem; }
}