/* Define the color palette based on the login page design */
:root {
    --bg-color: #1a2e1a; /* Dark green background */
    --header-bg-color: #027f01; /* Slightly brighter green for header */
    --card-color: #005000; /* Darker green for card background (readable green, used for table) */
    --text-color: #e0e0e0; /* Light text */
    --input-bg: #0f610f; /* Darker green for inputs/headers */
    --input-border: #0a1128; /* Dark blue-ish border */
    --button-bg: #b40003; /* Red accent button color */
    --button-hover-bg: #ff6681; /* Pink button hover color */
    --link-color: #00bcd4; /* Light blue link color */

    /* New variables for the redesigned layout to be white */
    --main-card-bg: #ffffff; /* White background for the main content card */
    --main-card-text: #333; /* Dark text for the main card */
    --main-card-border: #ccc; /* Light gray border for the main card */
    
    /* Table-specific variables */
    --table-header-bg: #f0f0f0; /* Light gray table header */
    --table-row-bg: #ffffff; /* White background for table rows */
    --table-row-hover-bg: #f9f9f9; /* Lighter gray on hover */
    --table-border-color: #ddd; /* Light gray border color */
    --action-button-color: #ffffff;
    --action-view-bg: #0d6efd;
    --action-edit-bg: #ffc107;
    --action-delete-bg: #dc3545;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1400px;
    padding: 20px;
    box-sizing: border-box;
}

.main-card {
    background-color: var(--main-card-bg);
    color: var(--main-card-text);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--main-card-border);
    margin-top: 20px;
}

.header {
    background-color: var(--header-bg-color);
    color: var(--text-color);
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header h1 {
    margin: 0;
    font-weight: 700;
    font-size: 1.5rem;
}

.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.search-container input[type="search"] {
    flex-grow: 1;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--main-card-border);
    background-color: #f8f9fa;
    color: var(--main-card-text);
}

.search-container button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    color: var(--action-button-color);
}

.search-container .search-button {
    background-color: #0d6efd;
}

.search-container .clear-button {
    background-color: #6c757d;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    table-layout: auto;
}

table thead {
    background-color: var(--table-header-bg);
    color: var(--main-card-text);
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid var(--table-border-color);
    white-space: nowrap; /* Prevent text wrapping in cells */
}

table tbody tr {
    border-bottom: 1px solid var(--table-border-color);
    background-color: var(--table-row-bg);
    color: var(--main-card-text);
}

table tbody tr:nth-of-type(even) {
    background-color: #f3f3f3;
}

table tbody tr:hover {
    background-color: var(--table-row-hover-bg);
}

.action-buttons button {
    padding: 5px 10px;
    margin-right: 5px;
    border: none;
    border-radius: 5px;
    color: var(--action-button-color);
    cursor: pointer;
}

.action-buttons .view-btn { background-color: var(--action-view-bg); }
.action-buttons .edit-btn { background-color: var(--action-edit-bg); }
.action-buttons .delete-btn { background-color: var(--action-delete-bg); }

.clear-button {
    display: none;
    background-color: #6c757d;
    color: #fff;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 100; /* 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 */
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 5% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 600px;
    border-radius: 8px;
    color: var(--main-card-text);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-header h2 {
    margin: 0;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover, .close:focus {
    color: #000;
    text-decoration: none;
}

.modal-form label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

.modal-form input[type="text"], .modal-form input[type="date"] {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.modal-form button {
    margin-top: 20px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: var(--button-bg);
    color: #fff;
    cursor: pointer;
    font-weight: bold;
}
