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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 1rem;
}

header h1 {
    font-size: 2rem;
    color: #1c1e21;
}

header p {
    font-size: 1rem;
    color: #606770;
}

#drop-zone {
    border: 2px dashed #ccd0d5;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    background-color: #f7f8fa;
    transition: background-color 0.2s, border-color 0.2s;
}

#drop-zone.dragover {
    background-color: #e7f3ff;
    border-color: #1877f2;
}

#drop-zone p {
    font-size: 1.1rem;
    color: #606770;
}

.file-input-label {
    color: #1877f2;
    font-weight: 600;
    cursor: pointer;
}

#file-input {
    display: none;
}

.controls {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

button {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    font-weight: 600;
}

button.button-primary {
    background-color: #1877f2;
    color: #fff;
}

button:disabled {
    background-color: #e4e6eb;
    color: #bcc0c4;
    cursor: not-allowed;
}

button:not(:disabled):hover {
    opacity: 0.9;
}

#clear-all {
    background-color: #f5f6f7;
    color: #4b4f56;
    border: 1px solid #ccd0d5;
}

#preview-area {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.thumbnail {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    height: 120px;
    cursor: grab;
    background-color: #f0f0f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.thumbnail.dragging {
    opacity: 0.5;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

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

.thumbnail .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 20px;
    opacity: 0;
    transition: opacity 0.2s;
}

.thumbnail:hover .remove-btn {
    opacity: 1;
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#loader.hidden {
    display: none;
}

.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #1877f2;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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