/* Leighton Buzzard Men's Shed - Main Stylesheet */
/* Brand Color: #F16F21, Font: Roboto */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --primary-color: #F16F21;
    --primary-dark: #d45a13;
    --primary-light: #ff8e4a;
    --secondary-color: #2c3e50;
    --background: #f8f9fa;
    --white: #ffffff;
    --gray-light: #e9ecef;
    --gray: #6c757d;
    --gray-dark: #343a40;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--secondary-color);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ==========================================================================
   Layout & Container
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* Page content wrapper - consistent padding for main content areas */
.page-content {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* Narrow container variations */
.container-narrow {
    max-width: 700px;
    margin: 0 auto;
}

.container-xs {
    max-width: 450px;
    margin: 0 auto;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Green header variant for Training Manager */
.site-header.trainer-header {
    background: #4AA728;
}

.site-header.trainer-header .main-nav button:not(.hamburger) {
    background: #3d8a21;
}

.site-header.trainer-header .main-nav button:not(.hamburger):hover {
    background: #306d1a;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-image {
    height: 65px;
    width: 65px;
    /* background: white; */
    padding: 8px;
    border-radius: 4px;
}

.logo h1 {
    color: var(--white);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.2;
}

.logo p {
    color: var(--white);
    margin: 0;
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1.2;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 0;
    margin: 0;
    align-items: center;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    color: var(--white);
    font-weight: 400;
    padding: 0.75rem 1.25rem;
    border-radius: 0;
    transition: var(--transition);
    display: block;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.main-nav a.active {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 500;
}

.main-nav button:not(.hamburger) {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.main-nav button:not(.hamburger):hover {
    background: #1a252f;
}

/* Hamburger button - hidden on desktop */
.main-nav .hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
    z-index: 100;
    border-radius: 0;
}

.main-nav .hamburger:hover {
    background: rgba(255, 255, 255, 0.15);
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: 0.3s;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 1.5rem 0;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    color: var(--secondary-color);
    margin: 0;
}

.card-body {
    padding: 0;
}

.card-subtitle {
    margin: 0.5rem 0 0 0;
    color: var(--gray);
    font-size: 0.9rem;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary-color);
}

label.required::after {
    content: " *";
    color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(241, 111, 33, 0.1);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--gray);
}

.form-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

input.error,
select.error,
textarea.error {
    border-color: var(--danger);
}

/* Color input styling */
input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

/* Readonly input styling */
input[readonly] {
    background: #f8f9fa;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(241, 111, 33, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-dark);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Small button */
.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

/* Nav button (smaller padding for navigation) */
.btn-nav {
    padding: 0.5rem 1rem;
}

/* Button group */
.btn-group {
    display: flex;
    gap: 0.5rem;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-container {
    overflow-x: auto;
    margin: 1rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

thead {
    background: var(--gray-light);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

th {
    font-weight: 500;
    color: var(--secondary-color);
}

tr:hover {
    background: rgba(241, 111, 33, 0.05);
}

/* Status table variant */
.status-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.status-table th,
.status-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.status-table th {
    background: #f8f9fa;
    font-weight: 500;
    color: #495057;
}

.status-table tr:hover {
    background: #f8f9fa;
}

/* Catalog table */
.catalog-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.catalog-table th,
.catalog-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.catalog-table th {
    background: #f8f9fa;
    font-weight: 500;
}

.catalog-table tr:hover {
    background: #f8f9fa;
}

/* Activity table */
.activity-table {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.activity-table table {
    width: 100%;
    border-collapse: collapse;
}

.activity-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.875rem;
}

.activity-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.875rem;
}

.activity-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-enquiry {
    background: var(--info);
    color: var(--white);
}

.badge-prospective {
    background: var(--warning);
    color: var(--secondary-color);
}

.badge-active {
    background: var(--success);
    color: var(--white);
}

.badge-inactive {
    background: var(--gray);
    color: var(--white);
}

.badge-lapsed {
    background: var(--danger);
    color: var(--white);
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Category badge */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    background: #e9ecef;
    color: #495057;
}

/* Certification badge */
.cert-badge {
    background: #d4edda;
    color: #155724;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.inactive-badge {
    background: #f8d7da;
    color: #721c24;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Activity type badges */
.activity-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.type-sent {
    background: #d4edda;
    color: #155724;
}

.type-bounce {
    background: #fff3cd;
    color: #856404;
}

.type-unsubscribed {
    background: #f8d7da;
    color: #721c24;
}

.type-failed {
    background: #f8d7da;
    color: #721c24;
}

/* ==========================================================================
   Dashboard Grid
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--gray);
    margin: 0;
}

.stat-subtitle {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Stats grid (email log variant) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-grid .stat-card {
    border: 1px solid #dee2e6;
    padding: 1.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Search & Filters
   ========================================================================== */
.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
}

/* Filter panel */
.filters {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success);
    color: #155724;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--warning);
    color: #856404;
}

.alert-danger {
    background: #f8d7da;
    border-color: var(--danger);
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border-color: var(--info);
    color: #0c5460;
}

/* Info box variant */
.info-box {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.info-box h4 {
    margin: 0 0 0.5rem 0;
    color: #004085;
}

.info-box p {
    margin: 0;
    color: #004085;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 2rem;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--gray-light);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-modal:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   Loading States
   ========================================================================== */
.spinner {
    border: 4px solid var(--gray-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

.spinner-sm {
    width: 30px;
    height: 30px;
    border-width: 3px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    min-width: 300px;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ==========================================================================
   Detail Grid (Member Details)
   ========================================================================== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
}

.detail-card h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.detail-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

.detail-label {
    font-weight: 500;
    color: #666;
    line-height: 1.3;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-value {
    color: #333;
}

.detail-value input,
.detail-value select,
.detail-value textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: inherit;
}

.detail-value textarea {
    min-height: 60px;
    resize: vertical;
}

/* View/Edit mode toggles */
/* Hide editable inputs by default (view mode) */
.editable {
    display: none;
}

/* Show editable inputs and hide readonly text in edit mode */
.edit-mode .editable {
    display: block;
}

.edit-mode .readonly {
    display: none;
}

/* Access checkboxes styling */
.edit-mode .access-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.access-checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
}

.access-checkboxes input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   Training Section
   ========================================================================== */
.training-section {
    margin-top: 2rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
}

.training-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.training-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.training-category {
    margin-bottom: 1.5rem;
}

.training-category h4 {
    color: #333;
    font-size: 1rem;
    margin: 0 0 0.75rem 0;
    padding: 0.5rem;
    background: #f8f9fa;
    border-left: 3px solid var(--primary-color);
}

.training-category-header {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.training-item {
    background: #f8f9fa;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

.training-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.training-name {
    font-weight: 600;
    color: #212529;
    font-size: 1rem;
}

.training-details {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.training-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.training-expiry {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.expiry-warning,
.training-expiry.warning,
.training-expiry.urgent {
    background: #fff3cd;
    color: #856404;
}

.expiry-ok,
.training-expiry.valid {
    background: #d4edda;
    color: #155724;
}

.training-expiry.expired {
    background: #f8d7da;
    color: #721c24;
}

.training-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.training-actions button {
    padding: 4px 12px;
    font-size: 0.875rem;
}

/* Training Modal */
.training-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.training-modal.active {
    display: flex;
}

.training-modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.training-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.training-modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.close-training-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-training-modal:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   Login/Auth Pages
   ========================================================================== */
.login-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
}

.login-box h1 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-box .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

.login-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover {
    background: var(--primary-dark);
}

.login-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.links {
    margin-top: 1.5rem;
    text-align: center;
}

.links a {
    color: var(--primary-color);
    text-decoration: none;
}

.links a:hover {
    text-decoration: underline;
}

.divider {
    margin: 1.5rem 0;
    text-align: center;
    color: #999;
    position: relative;
}

.divider::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #ddd;
}

.divider::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #ddd;
}

.password-requirements {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.password-requirements ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

/* ==========================================================================
   Assessment Page
   ========================================================================== */
.page-header-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.page-header-banner h1 {
    color: white;
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.page-header-banner p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.95;
}

.assessment-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.assessment-card {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    text-align: center;
}

.assessment-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(241, 111, 33, 0.15);
    transform: translateY(-2px);
}

.assessment-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.assessment-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.assessment-card p {
    color: var(--gray);
    margin-bottom: 1rem;
}

.assessment-meta {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.test-area {
    display: none;
}

.test-area.active {
    display: block;
}

.question-card {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

.question-card.answered {
    border-color: var(--gray);
}

.question-card.correct {
    border-color: var(--success);
    background: #e8f5e9;
}

.question-card.incorrect {
    border-color: var(--danger);
    background: #ffebee;
}

.question-header {
    margin-bottom: 1.25rem;
}

.question-number {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--secondary-color);
    line-height: 1.5;
    margin: 0;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.question-option {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
}

.question-option:hover {
    background: var(--gray-light);
    border-color: var(--gray);
}

.question-option input[type="radio"] {
    margin-right: 1rem;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--primary-color);
}

.question-option label {
    flex: 1;
    cursor: pointer;
    margin: 0;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.4;
}

.question-option.selected {
    background: rgba(241, 111, 33, 0.1);
    border-color: var(--primary-color);
}

.question-option.correct {
    background: #e8f5e9;
    border-color: var(--success);
}

.question-option.incorrect {
    background: #ffebee;
    border-color: var(--danger);
}

.question-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    display: none;
    line-height: 1.5;
}

.question-feedback.show {
    display: block;
}

.question-feedback.correct {
    background: #e8f5e9;
    color: var(--secondary-color);
    border: 2px solid var(--success);
}

.question-feedback.incorrect {
    background: #ffebee;
    color: var(--secondary-color);
    border: 2px solid var(--danger);
}

.assessment-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.assessment-buttons .btn {
    min-width: 180px;
}

.assessment-results {
    display: none;
    margin-top: 2rem;
}

.assessment-results.show {
    display: block;
}

.results-header {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.results-header h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.score-display {
    font-size: 4rem;
    font-weight: 700;
    margin: 1.5rem 0;
}

.score-display.pass {
    color: var(--success);
}

.score-display.fail {
    color: var(--danger);
}

.result-message {
    font-size: 1.5rem;
    font-weight: 500;
}

.result-message.pass {
    color: var(--success);
}

.result-message.fail {
    color: var(--danger);
}

.certificate {
    background: var(--white);
    border: 4px double var(--success);
    padding: 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.certificate-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.certificate h3 {
    font-size: 1.75rem;
    margin: 0 0 1rem 0;
    color: var(--secondary-color);
}

.certificate p {
    margin: 0.75rem 0;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.candidate-name {
    font-size: 2.25rem;
    font-weight: 500;
    color: var(--success);
    margin: 1.25rem 0;
}

.certificate-date {
    margin-top: 1.5rem !important;
    font-weight: 500;
}

.retry-message {
    text-align: center;
    font-size: 1.1rem;
    margin: 2rem 0;
    color: var(--gray);
}

@media print {
    .site-header,
    .site-footer,
    .assessment-selector,
    .assessment-buttons,
    .question-card,
    .results-header {
        display: none !important;
    }

    .certificate {
        page-break-inside: avoid;
        border: 4px double var(--success) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body {
        padding: 0;
        background: white;
    }
}

/* ==========================================================================
   Member Home / Welcome Banner
   ========================================================================== */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.welcome-banner h1 {
    color: white;
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
}

.welcome-banner p {
    margin: 0;
    font-size: 1.25rem;
    opacity: 0.95;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.quick-link-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.quick-link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.quick-link-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.quick-link-card h3 {
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
}

.quick-link-card p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

.info-section {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.info-section h2 {
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* ==========================================================================
   Email Composer
   ========================================================================== */
.email-composer {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 968px) {
    .email-composer {
        grid-template-columns: 1fr;
    }
}

.composer-panel {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
}

.composer-panel h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.form-help {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.recipient-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem;
}

.recipient-item {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recipient-item:last-child {
    border-bottom: none;
}

.recipient-info {
    flex: 1;
}

.recipient-name {
    font-weight: 500;
    color: #333;
}

.recipient-email {
    font-size: 0.875rem;
    color: #666;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
}

.recipient-count {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

/* ==========================================================================
   Map Page
   ========================================================================== */
#map {
    height: calc(100vh - 200px);
    min-height: 500px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.map-stat {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.map-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.map-stat-label {
    font-size: 0.875rem;
    color: #666;
}

.legend {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.legend-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #333;
}

/* Map popup styles */
.leaflet-popup-content {
    margin: 0.5rem;
}

.popup-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.popup-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.popup-postcode {
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Drag and Drop
   ========================================================================== */
.drag-handle {
    cursor: move;
    color: #999;
    margin-right: 0.5rem;
}

.dragging {
    opacity: 0.5;
}

/* ==========================================================================
   Preview Modal
   ========================================================================== */
.preview-modal {
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
}

.preview-modal.active {
    display: block;
}

.modal-wide {
    max-width: 800px;
}

.modal-body {
    padding: 30px;
}

.preview-content-box {
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
/* Text alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Text colors */
.text-muted { color: var(--gray); }
.text-primary { color: var(--primary-color); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* Margins */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Flexbox */
.d-flex { display: flex; }
.d-none { display: none; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Visibility */
.hidden { display: none; }

/* Whitespace */
.pre-wrap { white-space: pre-wrap; }

/* Position */
.relative { position: relative; }

/* Page header with actions */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0;
}

.page-header-content h1 {
    margin: 0;
}

.page-header-content p {
    margin: 0.5rem 0 0 0;
    color: var(--gray);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .site-header .container {
        flex-wrap: wrap;
    }

    .main-nav .hamburger {
        display: flex;
    }

    .main-nav {
        display: flex;
        align-items: center;
    }

    .main-nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--primary-color);
        padding: 0.5rem 0;
    }

    .site-header.trainer-header .main-nav ul {
        background: #4AA728;
    }

    .main-nav.open ul {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 99;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .site-header {
        position: relative;
    }

    .main-nav ul li {
        text-align: center;
    }

    .main-nav a {
        padding: 0.75rem 1.25rem;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .logo p {
        font-size: 1.25rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-input {
        min-width: 100%;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }

    .card {
        padding: 1.5rem;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.75rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .container,
    .container-fluid {
        padding: 0 15px;
    }

    .card {
        padding: 1rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    .login-box {
        padding: 2rem 1.5rem;
    }
}
