body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

h1 {
    color: #333;
    margin-bottom: 0;
}

.drop-area {
    border: 2px dashed #a0a0a0;
    border-radius: 10px;
    padding: 40px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.drop-area:hover {
    background-color: #e9e9e9;
    border-color: #007bff;
}

.drop-area.highlight {
    background-color: #e0f7fa;
    border-color: #007bff;
}

#fileElem {
    display: none;
}

.drop-area p {
    margin: 0;
    color: #555;
    font-size: 1.1em;
}

.drop-area button {
    background-color: #6c757d;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 1em;
}

.drop-area button:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

select, .controls button {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.controls button {
    background-color: #007bff;
    color: #fff;
    border: none;
    font-weight: bold;
}

.controls button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

#clear-btn {
    background-color: #dc3545;
    color: #fff;
    border: none;
    font-weight: bold;
}

#clear-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

.preview-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 10px;
    background-color: #fdfdfd;
    min-height: 100px;
    align-items: flex-start;
}

.preview-area h2 {
    width: 100%;
    color: #444;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 1px dashed #eee;
    padding-bottom: 10px;
}

.image-card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    width: 200px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.image-card img {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    border-radius: 8px;
    margin-bottom: 10px;
    object-fit: contain;
}

.image-card p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #666;
    word-break: break-all;
}

.image-card .download-single-btn {
    display: inline-block;
    background-color: #28a745;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    margin-top: 10px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.image-card .download-single-btn:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.image-card .describe-btn {
    background-color: #ffc107;
    color: #333;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    margin-top: 10px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-weight: bold;
}

.image-card .describe-btn:hover {
    background-color: #e0a800;
    transform: translateY(-1px);
}

.image-card .description-text {
    font-size: 0.85em;
    color: #444;
    margin-top: 10px;
    text-align: left;
    padding: 5px;
    border-top: 1px dashed #eee;
    max-height: 100px;
    overflow-y: auto;
}

.image-card .loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.download-controls {
    margin-top: 20px;
    text-align: center;
}

#download-all-btn {
    background-color: #6f42c1;
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#download-all-btn:hover {
    background-color: #5a35a0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(111, 66, 193, 0.2);
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    .controls {
        flex-direction: column;
        gap: 10px;
    }
    select, .controls button {
        width: 100%;
    }
    .image-card {
        width: calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    .image-card {
        width: 100%;
    }
}
