/* Universal Box-Sizing for consistent layout */
*, *::before, *::after {
    box-sizing: border-box;
}

/* General Body Styles */
html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

h1 {
    color: #003366; /* Dark blue from the model site's theme */
    text-align: center;
}

/* New: User Info Header */
#user-info-header {
    width: 100%;
    background-color: #ffffff;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: flex-end; /* Align items to the right */
    align-items: center;
    gap: 15px; /* Space between email and button */
    position: fixed; /* Fix it to the top */
    inset: 0 0 auto 0; /* Shorthand for top:0; right:0; bottom:auto; left:0; */
    z-index: 1000; /* Ensure it's above other content */
}

#logged-in-email {
    font-weight: bold;
    color: #003366;
    font-size: 0.95rem;
}

/* Updated Logout Button Style */
#logout-button {
    background: transparent;
    border: 2px solid #003366;
    color: #003366;
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Make it circular */
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

h2 {
    color: #333;
    text-align: center;
    margin-top: 0;
}

/* Authentication Forms Container */
#auth-section {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 100px; /* Add margin to push content down from fixed header */
    width: 100%;
    max-width: 400px;
}

#login-form, #register-form {
    display: flex;
    flex-direction: column;
}

/* Input Fields */
input[type="email"],
input[type="password"] {
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #005a9e; /* A nice blue for focus */
    box-shadow: 0 0 0 2px rgba(0, 90, 158, 0.2);
}

/* Buttons */
button {
    background: linear-gradient(to right, #005a9e, #003366); /* Gradient like the model site */
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s ease-in-out;
}

button:hover {
    opacity: 0.9;
}

/* Form Messages and Links */
#signup-message,
#login-message {
    text-align: center;
    margin-top: 1rem;
    min-height: 1.2em; /* Reserve space to prevent layout shift */
    font-weight: bold;
}

p {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

a {
    color: #005a9e;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Protected Content Section */
#protected-content {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%; /* Full width within its container */
    max-width: 800px; /* Max width for content */
    margin-top: 100px; /* Push content down from fixed header */
}


/* Records Table Styling */
.record-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
}

.record-table th,
.record-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.record-table th {
    background-color: #f8f8f8;
    font-weight: bold;
    width: 30%;
}

.record-card {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden; /* Ensures the border-radius is applied to the table */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.record-card .record-table {
    margin-bottom: 0;
    border: none;
}