body {
    font-family: Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top instead of center vertically */
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    text-align: center;
}

h1 {
    color: #007bff;
    margin-bottom: 10px;
    font-size: 2.2em;
}

p {
    margin-bottom: 25px;
    line-height: 1.6;
}

.upload-area {
    margin-bottom: 25px;
    border: 2px dashed #e0e0e0;
    padding: 30px;
    border-radius: 8px;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

input[type="file"] {
    display: none; /* Hide the default input */
}

.upload-button {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

.upload-button:hover {
    background-color: #0056b3;
}

#fileCount {
    font-style: italic;
    color: #666;
}

button {
    background-color: #28a745;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    transition: background-color 0.3s ease;
    margin-bottom: 30px;
}

button:hover:not(:disabled) {
    background-color: #218838;
}

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

.results-area {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.results-area h2 {
    color: #007bff;
    margin-bottom: 20px;
    font-size: 1.8em;
}

#outputArea {
    min-height: 100px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background-color: #fdfdfd;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.placeholder-text {
    color: #999;
    font-style: italic;
}

.converted-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 180px; /* Fixed width for better layout */
    text-align: center;
    word-wrap: break-word; /* Allow long names to break */
    overflow: hidden; /* Hide overflow */
}

.converted-item a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
    display: block; /* Make the link take full width */
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis for long names */
}

.converted-item a:hover {
    text-decoration: underline;
}

.converted-item img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 4px;
    object-fit: contain; /* Ensure image fits without cropping */
    margin-bottom: 5px;
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 10px 15px;
    margin-top: 15px;
    display: none; /* Hidden by default */
}

