/* Custom styles for better aesthetics and responsiveness */
body {
    font-family: 'Comic Sans MS', cursive, sans-serif; /* Updated font to something cute */
    background-color: #89cff0; /* Updated background color to light blue */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to start to allow scrolling */
    min-height: 100vh;
    padding: 2rem; /* Add some padding around the content */
    box-sizing: border-box;
}
.container {
    background-color: #e0f2f7; /* Changed background color to a tinted blue */
    border-radius: 1rem; /* Rounded corners for the container */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Soft shadow */
    padding: 2.5rem; /* Ample padding inside the container */
    width: 100%;
    max-width: 960px; /* Max width for larger screens */
    text-align: center;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    border-radius: 0.75rem; /* Rounded corners for the table */
    overflow: hidden; /* Ensures rounded corners apply to content */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
th, td {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb; /* Light gray border */
    text-align: left;
}
th {
    background-color: #eef2ff; /* Light indigo for header */
    font-weight: 600;
    color: #374151; /* Darker text for header */
    text-transform: uppercase;
    font-size: 0.875rem;
    cursor: pointer; /* Indicate sortable columns */
    position: relative; /* For sort indicator */
    padding-right: 2rem; /* Make space for sort indicator */
}
th:hover {
    background-color: #e0e7ff; /* Slightly darker on hover */
}
.sort-indicator {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #6b7280;
}
td {
    background-color: #ffffff; /* White background for cells */
    color: #4b5563; /* Gray text for cells */
}
tr:nth-child(even) td {
    background-color: #f9fafb; /* Slightly darker background for even rows */
}
.message-box {
    background-color: #fee2e2; /* Light red for errors */
    color: #991b1b; /* Dark red text */
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    text-align: left;
    display: none; /* Hidden by default */
}
.message-box.show {
    display: block;
}
.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem; /* Added margin for separation */
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    color: #374151;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
/* Loading spinner styles */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #4f46e5;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: none; /* Hidden by default */
    margin: 1rem auto; /* Center the spinner */
}
.spinner.show {
    display: block;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.header-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: block; /* Ensures it behaves as a block element for margin auto */
    margin-left: auto; /* Center horizontally */
    margin-right: auto; /* Center horizontally */
}
.main-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    gap: 1.5rem; /* Space between nav items */
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb; /* Subtle separator */
}
.main-nav a {
    color: #4f46e5; /* Indigo link color */
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.main-nav a:hover {
    background-color: #eef2ff; /* Light indigo background on hover */
    color: #3730a3; /* Darker indigo text on hover */
}
.main-nav a.current-page {
    background-color: #4f46e5; /* Solid indigo background for current page */
    color: white; /* White text for current page */
}
.footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Dropdown specific styles */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 0.5rem;
    left: 50%; /* Center dropdown below button */
    transform: translateX(-50%); /* Adjust for centering */
    top: 100%; /* Position below the button */
    padding: 0.5rem 0; /* Padding inside dropdown */
}
.dropdown-content a {
    color: #4b5563; /* Dark gray text for dropdown links */
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    text-align: left;
    font-weight: normal; /* Reset font weight for dropdown items */
}
.dropdown-content a:hover {
    background-color: #eef2ff; /* Light indigo on hover for dropdown items */
    color: #3730a3;
}
.dropdown:hover .dropdown-content,
.dropdown.active .dropdown-content { /* 'active' class for click toggle */
    display: block;
}
.dropbtn {
    display: inline-flex; /* Use flex to align text and icon */
    align-items: center;
    gap: 0.25rem; /* Space between text and icon */
}
/* Pagination styles */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #eef2ff; /* Light indigo background */
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
.pagination-controls button {
    background-color: #6366f1; /* Indigo button */
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* Subtle shadow for buttons */
}
.pagination-controls button:hover:not(:disabled) {
    background-color: #4f46e5; /* Darker indigo on hover */
}
.pagination-controls button:disabled {
    background-color: #cbd5e1; /* Light gray when disabled */
    cursor: not-allowed;
    box-shadow: none; /* Remove shadow when disabled */
}
.pagination-info {
    font-size: 0.9rem;
    color: #374151;
}
.items-per-page-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: #374151;
    background-color: #ffffff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); /* Inner shadow for select */
}
