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

/* Success toast (after submit) */
.success-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px 14px 18px;
    background: #0d652d;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    font-family: 'ABeeZee', sans-serif;
    font-weight: 500;
    font-size: 15px;
    animation: successToastIn 0.35s ease-out;
    max-width: calc(100vw - 32px);
}
.success-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}
.success-toast-text {
    flex: 1;
}
.success-toast-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    padding: 0 4px;
}
.success-toast-close:hover {
    opacity: 1;
}
.success-toast.hiding {
    animation: successToastOut 0.25s ease-in forwards;
}
@keyframes successToastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
@keyframes successToastOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-12px);
    }
}

/* Body Styling */
body {
    font-family: 'ABeeZee', sans-serif;
    line-height: 1.6;
    color: #ffffff;
}

/* Header Styling */
.header-container {
    display: flex;
    justify-content: center; /* Centered the logo */
    padding: 10px; /* Add padding for better spacing */
    background-color: #ffffff;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
}

.logo {
    max-width: 100%; /* Ensure the logo does not overflow */
    height: auto; /* Maintain aspect ratio */
}

/* Ensure the logo does not exceed a certain size on large screens */
@media (min-width: 1200px) {
    .logo {
        max-width: 500px; /* Maximum width for larger screens */
    }
}

/* Main Content Styling */
.main-content {
    display: flex;
    justify-content: space-between;
    padding: 100px;
    background-color: #0D652D;
    background-size: cover;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
}

.form-section {
    width: 25%;
    min-width: 300px; /* Ensure minimum width for smaller screens */
}

.table-section {
    width: 65%;
    min-width: 300px; /* Ensure minimum width for smaller screens */
}

h2, h3 {
    margin-bottom: 20px;
}

form label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

form input[type="text"],
form input[type="tel"],
form input[type="file"],
form input[type="submit"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-family: 'ABeeZee', sans-serif;
}

/* File Input Styling */
form input[type="file"]::file-selector-button {
  border-radius: 4px;
  padding: 0 16px;
  height: 40px;
  cursor: pointer;
  background-color: white;
  border: 1px solid rgba(0, 0, 0, 0.16);
  box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.05);
  margin-right: 16px;
  transition: background-color 200ms;
}

/* file upload button hover state */
input[type="file"]::file-selector-button:hover {
  background-color: #f3f4f6;
}

/* file upload button active state */
input[type="file"]::file-selector-button:active {
  background-color: #e5e7eb;
}

/* Button Styles */
input[type="submit"] {
    background-color: #ffffff;
    color: #333;
    border: 2px solid #000000;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

input[type="submit"]:hover {
    background-color: #f0f0f0; /* Slightly grey */
    color: #000000;
}

/* Table Section Styling */
.table-section h3 {
    margin-bottom: 20px;
    color: #ffffff;
}

.sort-menu {
    margin-bottom: 20px;
    color: #ffffff;
}

.sort-menu label {
    font-weight: bold;
    margin-right: 10px;
}

.sort-menu select {
    padding: 5px;
    font-family: 'ABeeZee', sans-serif;
}

.table-section table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
}

.table-section th, 
.table-section td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dddddd;
    color: #333333;
}

.table-section th {
    background-color: #0D652D;
    color: #ffffff;
    font-weight: bold;
    text-transform: uppercase;
}

.table-section tr:hover {
    background-color: #f1f1f1;
}

.table-section td a {
    color: #0D652D;
    text-decoration: none;
    font-weight: bold;
}

.table-section td a:hover {
    text-decoration: underline;
}

/* Pagination Styling */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    color: #0D652D;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #dddddd;
    margin: 0 5px;
    font-weight: bold;
}

.pagination a.active {
    background-color: #0D652D;
    color: white;
    border: 1px solid #0D652D;
}

.pagination a:hover {
    background-color: #f1f1f1;
    color: #0D652D;
}

/* Footer Styling */
footer {
    padding: 10px;
    background-color: #ffffff;
    box-shadow: 0px -2px 4px rgba(0, 0, 0, 0.1);
}

.footer-container {
    display: flex;
    justify-content: center; /* Center the content horizontally */
    align-items: center; /* Center the content vertically */
}

.footer-container p {
    margin: 0;
    color: #333;
    text-align: center;
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    .header-container {
        padding: 10px; /* Adjust padding for mobile */
        justify-content: center; /* Center logo horizontally */
    }

    .logo {
        max-width: 80%; /* Adjust max-width for mobile */
        height: auto; /* Ensure the aspect ratio is maintained */
    }

    .main-content {
        flex-direction: column; /* Stack the form and table vertically */
        padding: 20px; /* Reduce padding for smaller screens */
    }

    .form-section,
    .table-section {
        width: 100%; /* Full width for both sections */
    }

    .form-section {
        margin-bottom: 20px; /* Add space between form and table */
    }
}

/* Modal overlay and box */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay[aria-hidden="false"] {
    display: flex;
}
.modal-box {
    background: #fff;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}
.modal-verify {
    width: 100%;
    max-width: 400px;
    padding: 24px;
}
.modal-verify h2 {
    margin-bottom: 12px;
    color: #333;
}
.modal-hint {
    margin-bottom: 16px;
    color: #555;
}
.modal-error {
    color: #c00;
    margin-bottom: 12px;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
}
.modal-close:hover {
    color: #000;
}
.modal-viewer {
    width: 90vw;
    height: 85vh;
    padding: 0;
    overflow: hidden;
}
.modal-viewer .modal-close-viewer {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    font-size: 24px;
    padding: 4px 8px;
    line-height: 1;
}
.modal-viewer #fileFrame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
