/* Import modern font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #F3F4F6; /* Light gray background */
    color: #374151; /* Dark gray text */
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 96px auto 24px; /* Space for fixed header */
    padding: 0 24px;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #FFFFFF; /* White background */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap; /* Prevent wrapping */
    padding: 12px 24px;
    outline: none; /* For :focus */
}

header .container {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 1280px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937; /* Darker gray for logo */
    white-space: nowrap; /* Prevent logo wrap */
    max-width: 200px; /* Limit logo width */
}

nav {
    display: flex;
    align-items: center;
    margin-left: auto; /* Right-align nav */
    gap: 12px; /* Spacing between links */
    white-space: nowrap; /* Prevent nav wrap */
}

nav a {
    color: #4B5563; /* Medium gray */
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #3B82F6; /* Blue on hover */
}

.login-container {
    max-width: 448px;
    margin: 120px auto; /* Space after header */
    padding: 40px; /* Content spacing */
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.content {
    background-color: #FFFFFF; /* White content area */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 32px; /* Content spacing */
    margin-top: 24px; /* Extra spacing */
}

h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 24px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-align: left;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #D1D5DB; /* Light gray border */
    border-radius: 8px;
    font-size: 16px;
    background-color: #F9FAFB;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus, select:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Select2 Styling */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    padding: 11px 16px !important;
    border: 1px solid #D1D5DB !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    background-color: #F9FAFB !important;
    height: auto !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 24px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
}

button {
    width: 100%;
    padding: 12px;
    background-color: #3B82F6;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: #2563EB;
    transform: translateY(-2px);
}

/* Table container for scrollable tables */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 24px;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #E5E7EB;
    min-width: 100px; /* Prevent compression */
}

th {
    background-color: #F9FAFB;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #F9FAFB;
    transition: background-color 0.3s ease;
}

td a {
    color: #3B82F6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

td a:hover {
    color: #2563EB;
    text-decoration: underline;
}

.error {
    color: #EF4444; /* Red */
    font-size: 14px;
    margin-bottom: 16px;
}

.success {
    color: #10B981; /* Green */
    font-size: 14px;
    margin-bottom: 16px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .container, .login-container {
        margin: 30px 16px 16px; /* Further reduced top margin */
        padding: 16px;
    }

    header {
        padding: 12px 16px;
    }

    header .container {
        padding: 0 16px;
    }

    /* Hamburger icon via pseudo-element */
    header::before {
        content: '☰';
        display: block;
        font-size: 24px;
        color: #1F2937;
        cursor: pointer;
        padding: 8px;
        z-index: 1001;
    }

    .logo {
        font-size: 22px;
    }

    nav {
        display: none; /* Hidden by default */
        position: fixed;
        top: 60px; /* Below header */
        left: 0;
        right: 0;
        background-color: #FFFFFF;
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    /* Show nav when header is focused or hovered */
    header:focus nav,
    header:hover nav {
        display: flex;
    }

    nav a {
        font-size: 16px;
        padding: 8px 16px;
        width: 100%;
        text-align: left;
    }

    .content, .login-container {
        padding: 24px;
    }

    /* Form adjustments */
    input, select, button {
        padding: 10px 14px;
        font-size: 15px;
    }

    .select2-container--default .select2-selection--single {
        padding: 9px 14px !important;
        font-size: 15px !important;
    }

    label {
        font-size: 13px;
    }

    /* Table adjustments */
    th, td {
        padding: 14px; /* Increased padding */
        font-size: 14px; /* Larger font */
        min-width: 80px; /* Adjusted for mobile */
    }

    th {
        font-size: 14px;
    }

    .table-container table {
        table-layout: fixed; /* Even column widths */
        width: 100%; /* Fill container */
    }
}

@media (max-width: 480px) {
    .container, .login-container {
        margin: 30px 12px 12px; /* Further reduced top margin */
        padding: 12px;
    }

    .logo {
        font-size: 20px;
    }

    nav a {
        font-size: 15px;
    }

    .content, .login-container {
        padding: 20px;
    }

    h2 {
        font-size: 20px;
        margin-bottom: 16px;
    }

    /* Table adjustments */
    table {
        display: block;
        overflow-x: auto;
    }

    thead {
        display: table; /* Keep headers for scrolling */
    }

    tr {
        display: table-row;
    }

    th, td {
        padding: 12px; /* More padding */
        font-size: 13px;
        text-align: left; /* Align left to fill space */
        min-width: 70px;
    }

    /* Form adjustments */
    input, select, button {
        padding: 8px 12px;
        font-size: 14px;
    }

    .select2-container--default .select2-selection--single {
        padding: 8px 12px !important;
        font-size: 14px !important;
    }

    label {
        font-size: 12px;
    }
}

/* Search Form Styling */
.search-form {
    margin-bottom: 20px;
    display: block;
    flex-wrap: nowrap;
    gap: 6px; /* Tighter spacing */
    align-items: left;
}
.search-form label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
    max-width: 120px; /* Limit label width */
    white-space: nowrap;
}
.search-form input[type="text"] {
    min-width: 200px; /* Keep smaller input */
    max-width: 250px;
    padding: 8px 10px; /* Smaller padding */
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 13px; /* Smaller font */
    background-color: #F9FAFB;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.search-form input[type="text"]:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}
.search-form button, .search-form a.button {
    padding: 8px 12px; /* Smaller button */
    background-color: #3B82F6;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 13px; /* Smaller font */
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
    max-width: 80px ; /* Prevent stretching */
}
.search-form button:hover, .search-form a.button:hover {
    background-color: #2563EB;
    transform: translateY(-2px);
}
@media (max-width: 768px) {
    .search-form {
        gap: 5px;
    }
    .search-form label {
        font-size: 13px;
        max-width: 100px;
    }
        .search-form input[type="text"] {
        width: 60px; /* Smaller input */
        padding: 6px 8px;
        font-size: 12px;
    }
    .search-form button, .search-form a.button {
        padding: 6px 10px; /* Smaller button */
        font-size: 14px;
    }
}
@media (max-width: 480px) {
    .search-form {
        gap: 4px;
    }
    .search-form label {
        font-size: 12px;
        max-width: 80px;
    }
    .search-form input[type="text"] {
        width: 40px; /* Smallest input */
        padding: 4px 6px;
        font-size: 12px;
    }
    .search-form button, .search-form a.button {
        padding: 4px 8px; /* Smallest button */
        font-size: 14px;
    }
}