/* style.css */
:root {
    --primary-color: #005a9c; /* A professional blue */
    --secondary-color: #e0e0e0;
    --accent-color: #f0ad4e; /* An orange accent */
    --text-color: #333;
    --bg-color: #f4f7fa;
    --card-bg: #ffffff;
    --border-color: #d1d9e0;
    --success-color: #5cb85c;
    --danger-color: #d9534f;
    --font-family: 'Roboto', sans-serif;
    --border-radius: 6px;
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Login Section */
#loginSection {
    max-width: 450px;
    margin: 50px auto;
    text-align: center;
}

.logo {
    max-width: 150px;
    margin-bottom: 15px;
    /* Make sure you have a placeholder-logo.png or remove/change this */
    background-color: #ccc; /* Placeholder background */
    padding: 10px;
    border-radius: var(--border-radius);
    display: inline-block; /* Center the placeholder */
    height: 50px; /* Placeholder height */
    width: 150px; /* Placeholder width */
    color: #666;
    text-align: center;
    line-height: 50px;
    font-size: 12px;
    font-style: italic;
}
.logo-small {
    height: 30px;
    margin-right: 10px;
    vertical-align: middle;
     /* Placeholder styles if no image */
    background-color: #ccc;
    padding: 5px;
    border-radius: 4px;
    width: auto; /* Adjust as needed */
    display: inline-block;
}


/* Card Styling */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden; /* Ensures header/footer backgrounds don't bleed */
}

.card-header {
    background-color: #f8f9fa; /* Lighter header */
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h1, .card-header h2, .card-header h3 {
    margin: 0;
    font-weight: 400;
     color: var(--primary-color);
}
.card-header h1 { font-size: 1.8em; }
.card-header h2 { font-size: 1.5em; }
.card-header h3 { font-size: 1.2em; }

.card-content {
    padding: 20px;
}
.card-content ul {
    list-style: disc;
    padding-left: 20px;
}
.card-content li {
    margin-bottom: 8px;
}

.card-footer {
    background-color: #f8f9fa;
    padding: 10px 20px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

/* Forms */
form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

form input[type="text"],
form input[type="date"],
form input[type="time"],
form input[type="number"],
form select,
form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-sizing: border-box; /* Include padding in width */
    font-family: var(--font-family);
    font-size: 1em;
}
form input[readonly] {
    background-color: #eee;
    cursor: not-allowed;
}

form textarea {
    resize: vertical; /* Allow vertical resize only */
    min-height: 60px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}
.full-width {
    grid-column: 1 / -1; /* Make textarea span full width in grid */
     margin-bottom: 15px;
}


/* Buttons */
.button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
    margin-left: 5px; /* Spacing between buttons */
}

.button:hover {
    background-color: #004175; /* Darker blue on hover */
}

.button-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}
.button-outline:hover {
    background-color: rgba(0, 90, 156, 0.1); /* Light blue background on hover */
    color: #004175;
}

.button-danger {
    background-color: var(--danger-color);
}
.button-danger:hover {
    background-color: #c9302c;
}

/* Main Application Layout */
.main-nav {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}
.nav-left, .nav-right {
    display: flex;
    align-items: center;
}
.nav-right span {
    margin-right: 15px;
}

.main-content {
    display: flex;
    gap: 20px; /* Space between sidebar and content */
}

.sidebar {
    flex: 0 0 220px; /* Fixed width sidebar */
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    height: fit-content; /* Make sidebar only as tall as needed */
    position: sticky; /* Make sidebar stick on scroll */
    top: 20px; /* Adjust based on desired spacing from top */
}

.sidebar h2 {
    margin-top: 0;
     border-bottom: 1px solid var(--border-color);
     padding-bottom: 10px;
     margin-bottom: 15px;
     color: var(--primary-color);
     font-weight: 400;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.nav-menu li {
     margin-bottom: 10px;
}

.nav-button {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 10px 15px;
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-size: 1em;
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-button:hover {
    background-color: #e9ecef;
}

.nav-button.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

.sidebar-footer {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8em;
    color: #6c757d;
    text-align: center;
}


.content-section {
    flex-grow: 1; /* Takes remaining space */
}

/* Grid Layout for Dashboard */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Table Styling */
#logbookTableContainer table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
#logbookTableContainer th, #logbookTableContainer td {
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9em;
}
#logbookTableContainer th {
    background-color: #e9ecef; /* Light gray header */
    font-weight: bold;
}
#logbookTableContainer tr:nth-child(even) {
    background-color: #f8f9fa; /* Slightly different background for alternate rows */
}
#logbookTableContainer td.notes-col {
    max-width: 250px; /* Limit width of notes */
    white-space: normal; /* Allow text wrapping */
    word-break: break-word;
}


/* Utility Classes */
.hidden {
    display: none !important; /* Use !important to override potential conflicts */
}
.active-section {
    display: block !important;
}
.small-note {
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 15px;
}
.error-message {
    color: var(--danger-color);
    font-size: 0.9em;
    margin-top: 10px;
}

/* Responsive Adjustments (Basic) */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        margin-bottom: 20px;
        position: static; /* Don't stick on smaller screens */
    }
    .form-grid {
        grid-template-columns: 1fr; /* Stack form fields */
    }
}

@media (max-width: 576px) {
    .main-nav {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-right {
        margin-top: 10px;
        width: 100%;
        justify-content: space-between; /* Space out welcome and logout */
    }
    .card-header h1 { font-size: 1.5em; }
    .card-header h2 { font-size: 1.3em; }
    .card-header h3 { font-size: 1.1em; }

    .grid-container {
        grid-template-columns: 1fr; /* Single column grid */
    }
     #logbookTableContainer {
        overflow-x: auto; /* Allow horizontal scrolling for table on small screens */
    }
}