body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: #1c1e21;
}

.container {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    text-align: center;
}

h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

p {
    color: #606770;
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed #ccd0d5;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.upload-area:hover {
    background-color: #f7f8fa;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-label span {
    font-weight: 600;
    color: #1877f2;
}

.preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
    justify-content: center;
}

.preview-container img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dddfe2;
}

#upload-button {
    background-color: #1877f2;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    width: 100%;
    margin-top: 1rem;
    transition: background-color 0.2s;
}

#upload-button:disabled {
    background-color: #a0bdf5;
    cursor: not-allowed;
}

#upload-button:not(:disabled):hover {
    background-color: #166fe5;
}

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

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

.result-container {
    margin-top: 2rem;
    text-align: left;
    background-color: #f7f8fa;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    padding: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
        margin: 1rem;
        box-shadow: none;
    }

    h1 {
        font-size: 1.5rem;
    }

    .preview-container img {
        width: 80px;
        height: 80px;
    }
}
