/* General Reset & Base */
body {
    font-family: 'Manrope', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: #ffffff;
    color: #333;
}

a {
    color: #0056b3; /* Cosive-like blue */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Container for main content */
.container {
    max-width: 1800px;
    margin: 20px auto;
    padding: 0 20px;
}


/* Navbar Styling */
.navbar {
    background-color: #0e141c;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-brand a {
    display: flex;
    align-items: center;
}

.navbar-brand img { /* Style for the logo */
    margin-right: 10px;
    display: flex;
    align-self: center; /* Ensure vertical centering */
}

.navbar-title {
    font-size: 1.4em;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-self: center; /* Ensure vertical centering */
}
.navbar-title:hover {
    text-decoration: none;
}


.navbar-links a {
    margin-left: 20px;
    color: #ffffff;
    font-weight: normal;
}

.navbar-links a:hover {
    color: #e53936; /* Cosive red on hover */
}

.navbar-button { /* Style for buttons within the navbar */
    margin-left: 20px;
    padding: 5px 10px; /* Slightly smaller padding */
    font-size: 0.9em; /* Slightly smaller font */
}

#request-help-btn {
    background-color: #e53936; /* Cosive red */
    color: #ffffff; /* White text */
}

#request-help-btn:hover {
    background-color: #c62828; /* Darker red on hover */
}


/* Main Content Area */
main.container { /* Specificity for main content padding */
     padding-top: 20px;
     padding-bottom: 40px;
     min-height: 70vh; /* Adjust as needed */
}


/* Footer Styling */
footer {
    background-color: #e9ecef; /* Lighter grey footer */
    color: #6c757d; /* Muted text color */
    margin-top: 30px;
    text-align: center;
    font-size: 0.9em;
    padding: 15px 0; /* Add padding */
}

.dashboard-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #dee2e6; /* Slightly lighter border */
    border-radius: 5px;
    background-color: #ffffff; /* White background for sections */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.dashboard-section h2, /* Added h2 */
.dashboard-section h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 20px; /* More space below headings */
}

/* Login form styling */
.login-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
}

.login-container div {
    margin-bottom: 20px;
}

/* General Button Styling */
button, .button { /* Added .button class for consistency */
    display: inline-block;
    padding: 10px 15px;
    background-color: #0056b3; /* Cosive-like blue */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-family: 'Manrope', sans-serif;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

button:hover, .button:hover {
    background-color: #003d80; /* Darker blue */
    color: white;
    text-decoration: none;
}

/* Cosive Red Button Styling */
.cosive-red-btn, 
#add-student-form button[type="submit"],
#add-trainer-form button[type="submit"],
#generate-users-form button[type="submit"],
#import-users-form button[type="submit"],
#add-task-form button[type="submit"],
#import-tasks-form button[type="submit"],
a[href="/trainer/setup/tasks/export"],
.join-chat-btn,
#help-chat-send {
    background-color: #e53936; /* Cosive red */
    color: white;
}

.cosive-red-btn:hover, 
#add-student-form button[type="submit"]:hover,
#add-trainer-form button[type="submit"]:hover,
#generate-users-form button[type="submit"]:hover,
#import-users-form button[type="submit"]:hover,
#add-task-form button[type="submit"]:hover,
#import-tasks-form button[type="submit"]:hover,
a[href="/trainer/setup/tasks/export"]:hover,
.join-chat-btn:hover,
#help-chat-send:hover {
    background-color: #c62828; /* Darker red on hover */
    color: white;
}

/* Specific button adjustments if needed */
#request-help-btn {
    /* Add specific styles if different from default button */
}


/* Student Task List Styling */
.task-list {
    list-style: none;
    padding-left: 0;
}

.task-item {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.task-item input[type="checkbox"] {
    margin-right: 10px;
    vertical-align: middle; /* Align checkbox with label text */
}

.task-label {
    display: inline-block; /* Keep label on same line as checkbox */
    vertical-align: middle;
    cursor: pointer; /* Indicate label is clickable */
}

.task-label-complete {
    text-decoration: line-through;
    color: grey;
}

.task-description {
    margin-left: 28px; /* Indent description under checkbox */
    margin-top: 5px;
    font-size: 0.9em;
    color: #555;
}

#task-update-status {
    margin-top: 15px;
    font-style: italic;
    color: #0056b3; /* Match link color */
}

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

.login-container input[type="text"],
.login-container input[type="email"],
.login-container input[type="password"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box; /* Include padding in width */
    border: 1px solid #ccc;
    border-radius: 3px;
}

.login-container button {
    width: 100%;
    padding: 10px;
    background-color: #e53936; /* Cosive red */
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1em;
}

.login-container button:hover {
    background-color: #c62828; /* Darker red on hover */
}

/* Trainer dashboard table styling */
.task-status-cell {
    text-align: center;
}

.task-complete {
    background-color: #d4edda; /* Light green */
    color: #155724;
}

.task-incomplete {
    background-color: #f8d7da; /* Light red */
    color: #721c24;
}

/* Error message styling (if using flash messages later) */
.error-message {
    color: red;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 3px;
    margin-bottom: 15px;
}

/* Help Chat Slide-out Panel */
.help-chat-panel {
    position: fixed;
    top: 0;
    right: -600px; /* Start off-screen */
    width: 580px; /* 50% wider */
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.help-chat-panel.active {
    right: 0; /* Slide in */
}

.help-chat-header {
    background-color: #0056b3;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-chat-header h3 {
    margin: 0;
    border-bottom: none;
    color: white;
}

.help-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
}

.help-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f9fa;
}

.help-chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 80%;
    word-break: break-word;
}

.help-chat-message.system {
    background-color: #e9ecef;
    color: #6c757d;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-style: italic;
    max-width: 90%;
}

.help-chat-message.sent {
    background-color: #d1ecf1;
    color: #0c5460;
    margin-left: auto;
}

.help-chat-message.received {
    background-color: #e2e3e5;
    color: #383d41;
    margin-right: auto;
}

.help-chat-input-container {
    padding: 15px;
    border-top: 1px solid #dee2e6;
    background-color: white;
}

.help-chat-form {
    display: flex;
    gap: 10px;
}

.help-chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: 'Manrope', sans-serif;
    min-height: 20px;
    max-height: 100px;
    resize: none;
    overflow-y: auto;
    transition: height 0.2s ease;
}

.help-chat-send {
    padding: 10px 15px;
}

.help-chat-status {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
    text-align: center;
}

.help-chat-initial-form {
    padding: 20px;
}

.help-chat-initial-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-bottom: 15px;
    min-height: 100px;
    font-family: 'Manrope', sans-serif;
}

/* Help Chat Actions */
.help-chat-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 15px;
    gap: 10px; /* Add gap between buttons */
}

.resolve-btn {
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.9em;
}

.resolve-btn:hover {
    background-color: #218838;
}

.resolve-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.help-chat-close {
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.9em;
}

.help-chat-close:hover {
    background-color: #5a6268;
}

/* Status badges for help requests */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.open {
    background-color: #ffc107;
    color: #212529;
}

.status-badge.in_progress {
    background-color: #17a2b8;
    color: white;
}

.status-badge.closed {
    background-color: #28a745;
    color: white;
}

/* Help request lists */
.help-request-list {
    list-style: none;
    padding-left: 0;
}

.help-request-item {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.help-request-item strong {
    color: #0056b3;
}

.help-request-item button {
    margin-left: 10px;
}

.no-requests {
    color: #6c757d;
    font-style: italic;
    padding: 10px;
}

/* Help request rows */
.help-request-row.closed {
    opacity: 0.7;
}

/* Data table for help requests */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.data-table th,
.data-table td {
    padding: 10px;
    border: 1px solid #dee2e6;
    text-align: left;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.data-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.data-table tr:hover {
    background-color: #e9ecef;
}

/* Filter controls */
.filter-controls {
    margin-bottom: 15px;
}

.filter-controls label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.filter-controls input[type="checkbox"] {
    margin-right: 5px;
}

/* Action buttons container */
.action-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Help chat reopen container */
.help-chat-reopen-container {
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.help-chat-reopen-container p {
    margin-bottom: 15px;
    font-style: italic;
    color: #6c757d;
}

.help-chat-reopen-container button {
    padding: 10px 20px;
    font-size: 1em;
}

/* Danger Zone Styling */
.danger-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
    border: 1px solid #dc3545;
}

.danger-section h4 {
    color: #dc3545;
    margin-top: 0;
    margin-bottom: 15px;
}

.warning-box {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.danger-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

.danger-btn:hover {
    background-color: #bd2130;
}
