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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7fa;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 900px;
}

#inputDiv {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

input[type="file"] {
    width: 100%;
    max-width: 400px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    font-size: 16px;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #5c6bc0;
}

button {
    background-color: #5c6bc0;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #3f4e8c;
}

#resultAndPreview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

#result, #preview {
    flex: 1;
    min-width: 300px;
    max-width: 450px;
}

#result {
    background-color: #e9f5ff;
    padding: 15px;
    border-radius: 5px;
}

#preview {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f1f6fa;
    border-radius: 5px;
    min-height: 300px;
}

#preview img, #preview .pdf-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 5px;
    object-fit: contain;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid #ddd;
    text-align: left;
}

th, td {
    padding: 10px;
}

th {
    background-color: #f1f1f1;
}

#loader {
    display: none;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
}

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

@media (max-width: 680px) {
    .container {
        padding: 20px;
    }

    #resultAndPreview {
        flex-direction: column;
        align-items: center;
    }

    #result, #preview {
        width: 100%;
        max-width: none;
    }

    h1 {
        font-size: 20px;
    }

    input[type="file"] {
        padding: 12px;
    }

    button {
        padding: 10px 20px;
    }
}