body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #2e4153;
    color: #fff;
    padding: 1rem 0;
    text-align: center; /* center all content inside the header */

    background-image: linear-gradient(
        180deg, 
        rgba(255, 255, 255, 0.08) 0%, 
        rgba(0, 0, 0, 0.15) 100% 
    );
    
    box-shadow: 
        inset 0 0 12px rgba(255, 255, 255, 0.07), 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.4);
}

header a {
    display: flex; /* use flex to align logo and title in one row */
    align-items: center; /* vertically center logo and title */
    justify-content: center; /* horizontally center the link content */
    text-decoration: none; /* remove underline from the link */
    color: inherit; /* inherit text color from the header */
}

header img {
    margin-right: 10px; /* add space between logo and title */
}

header h1 {
    margin: 0; /* reset default browser margins for h1 */
}

main {
    flex: 1;
    padding: 1rem;
    max-width: 100%;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.form-section {
    text-align: center;
    margin-bottom: 30px;
}

.form-section label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.form-section input[type="text"] {
    width: 80%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.form-section button {
    background-color: #6B99C3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.form-section button:hover:not(:disabled) {
    background-color: #0056b3;
}

.form-section button:disabled,
.form-section button.btn-disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.7;
}

.progress-section {
    text-align: center;
    margin-top: 20px;
    display: none; /* Hidden by default */
}

.progress-bar-container {
    width: 80%;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin: 10px auto;
}

.progress-bar {
    width: 0%;
    height: 20px;
    background-color: #28a745;
    border-radius: 5px;
    text-align: center;
    color: white;
    line-height: 20px;
    transition: width 0.5s ease-in-out;
}

.results-header {
    display: flex;
    justify-content: center;
}

.results-header button {
       background-color: #6B99C3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

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

.results-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
    justify-content: center;
}

.results-section .left-panel {
    flex: 1;
    min-width: 300px;
    max-width: 50%;
    text-align: center;
}

.results-section .left-panel img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.results-section .left-panel .download-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.results-section .left-panel .download-link a:hover {
    text-decoration: underline;
}

.results-section .right-panel {
    flex: 1;
    min-width: 300px;
    max-width: 50%;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: flex-start;
    gap: 15px;
    text-align: center;
}

.results-section .right-panel .action-buttons button,
.results-section .right-panel .action-buttons a {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    text-decoration: none;
    color: white;
}

.results-section .right-panel .action-buttons .btn-feedback {
    background-color: #6B99C3;
}

.results-section .right-panel .action-buttons .btn-feedback:hover {
    background-color: #2f7dc7;
}

.results-section .right-panel .action-buttons .btn-api {
    background-color: #ffcc31;
    color: #333;
}

.results-section .right-panel .action-buttons .btn-api:hover {
    background-color: #ffc107;
}

.social-share-links {
    margin-top: 20px;
    text-align: center;
}

.social-share-links a {
    display: inline-block;
    margin: 0 10px;
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}

.social-share-links a:hover {
    text-decoration: underline;
}

.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 100px;
    box-sizing: border-box; /* Include padding in width */
}

.modal-content .checkbox-container {
    margin-bottom: 15px;
}

.modal-content button {
    background-color: #6B99C3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

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

.flash-messages {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: center;
}

.flash-messages li {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-weight: bold;
}

.flash-messages li.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-messages li.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-messages li.fade-out {
    opacity: 0;
    transition: opacity 1s ease-out;
}

.flash-messages:empty {
    display: none;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 10px;
    background-color: #2e4153;
    color: #fff;

    background-image: linear-gradient(
        180deg, 
        rgba(255, 255, 255, 0.08) 0%, 
        rgba(0, 0, 0, 0.15) 100% 
    );
    
    box-shadow: 
        inset 0 0 12px rgba(255, 255, 255, 0.07), 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.4);
}

footer p {
    margin: 5px 0;
}

footer a {
    color: #007bff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.terms-title-section {
    text-align: center;
    line-height: 1.6;
    max-width: 80%;
    margin: 0 auto;
}

.terms-section {
    text-align: justify;
    line-height: 1.6;
    max-width: 80%;
    margin: 0 auto;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .results-section {
        flex-direction: column;
    }
    .results-section .left-panel,
    .results-section .right-panel {
        max-width: 100%;
    }
    .form-section input[type="text"] {
        width: 95%;
    }
    .terms-title-section,
    .terms-section {
        max-width: 100%;
    }
}
