@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

.converter-wrapper {
    font-family: 'Poppins', sans-serif;
    background: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 900px; /* Increased max-width for grid */
    text-align: center;
    margin: 40px auto;
    color: #333;
}

/* --- Upload and Controls styling (largely unchanged) --- */
.converter-wrapper h1 { color: #1a237e; margin-bottom: 10px; }
.converter-wrapper p { color: #555; margin-bottom: 25px; }
.upload-area { border: 2px dashed #90a4ae; border-radius: 10px; padding: 40px 20px; cursor: pointer; transition: background-color 0.3s, border-color 0.3s; }
.upload-area.highlight { background-color: #e8eaf6; border-color: #3f51b5; }
.upload-area p { margin: 0; font-size: 1rem; color: #555; }
.controls { margin-top: 20px; display: flex; justify-content: center; align-items: center; gap: 20px; margin-bottom: 30px; }
.format-selection label { font-weight: 600; margin-right: 10px; }
.converter-wrapper select, .converter-wrapper button { font-family: 'Poppins', sans-serif; padding: 10px 20px; border-radius: 8px; border: 1px solid #ccc; font-size: 1rem; cursor: pointer; transition: all 0.3s ease; }
.converter-wrapper button { background-color: #3f51b5; color: white; border: none; font-weight: 600; }
.converter-wrapper button:hover { background-color: #303f9f; }


/* --- New styles for the results grid --- */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.result-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.result-item .image-preview {
    width: 100%;
    height: 150px;
    object-fit: contain; /* Use contain to see the whole image */
    margin-bottom: 10px;
    border-radius: 4px;
}

.result-item .file-info {
    font-size: 0.9em;
    color: #555;
    word-break: break-all;
    margin-bottom: 10px;
}

.result-item .download-link {
    display: block;
    padding: 8px 15px;
    background-color: #43a047;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9em;
    transition: background-color 0.3s;
    margin-top: auto; /* Pushes the button to the bottom */
}

.result-item .download-link:hover {
    background-color: #388e3c;
}