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

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
    padding-top: 0; /* Ensure no extra padding on top */
    overflow: hidden; /* Contain any potential overflow */
}

h1, h2, h3 {
    font-family: Arial, sans-serif;
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navigation and Top Row */
.top-row {
    background-color: #333;
    padding: 10px 20px; /* Add padding for spacing */
    font-weight: 200; /* Match the top-row text */
    color: white;
    text-align: right;
    z-index: 100; /* Ensure it's above the flash message container */
}

.top-row a {
    color: white;
    text-decoration: none;
    font-weight: 200; /* Match the top-row text */
    margin-left: 20px;
}

.top-row a:hover {
    text-decoration: underline;
}

/* New Header Bar (papercloud) */
.header-bar {
    background-color: #333; /* Same color as the menu */
    color: white;
    padding: 10px 20px; /* Add padding for spacing */
    text-align: left;
    font-size: 18px; /* Adjust the font size as needed */
    font-weight: bold;
}

/* Main container */
.container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: auto; /* Add scrolling if the content overflows */
    height: calc(100vh - 50px); /* Use full viewport height minus some space for top-row/header */
    display: flex;
    flex-direction: column; /* Ensure child elements stack vertically */
}

form {
    margin-top: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
}

input[type="text"],
input[type="password"],
input[type="submit"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

input[type="submit"] {
    background-color: #9bcce3;
    color: white;
    cursor: pointer;
}

input[type="submit"]:hover {
    background-color: #9bcce3;
}

/* Basic styles for flash messages */
.flash-messages {
    width: 100%;
    margin-top: 20px;
    padding: 10px;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    pointer-events: none; /* Prevent the flash message container from interfering with other clicks */
}

/* Styling for different message categories */
.flash-message {
    display: inline-block;
    padding: 10px;
    margin: 5px;
    border-radius: 5px;
    font-weight: bold;
    width: auto;
    min-width: 200px;
    color: white;
}

.flash-message.error {
    background-color: #e74c3c;
}

.flash-message.success {
    background-color: #9bcce3;
}

.flash-message.info {
    background-color: #3498db;
}

/* Animation for sliding in from the top */
.flash-messages .flash-message {
    animation: slideIn 0.5s ease-out, fadeOut 2s ease-out 2s forwards; /* Add fade-out after 2 seconds */
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* Ensure that the content below the flash message remains clickable */

/* Table Styles */
.table-container {
    max-width: 100%; /* Limit width of the container */
    max-height: 80vh; /* Ensure vertical scroll if content grows */
    overflow-y: auto; /* Enable vertical scrolling for large content */
    overflow-x: auto; /* Enable horizontal scrolling for wide tables */
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px; /* Smaller font size for compact layout */
}

table, th, td {
    border: 1px solid black;
}

th, td {
    padding: 5px; /* Reduced padding for compactness */
    text-align: left;
}

th {
    background-color: #f2f2f2;
    cursor: pointer; /* Indicate clickable headers */
}

th:hover {
    background-color: #ddd; /* Highlight on hover */
}

/* Editable Fields */
td[contenteditable="true"] {
    background-color: #ffffff; /* White background for editable fields */
    color: #000000; /* Black text */
    cursor: text; /* Text cursor */
}

/* Non-Editable Fields */
td[contenteditable="false"] {
    background-color: #fcfcfc; /* Very light grey for non-editable fields */
    color: #888888; /* Slightly darker grey for text */
    cursor: not-allowed; /* Pointer indicates non-editable */
}
