html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
  --bs-body-bg: #f5f8fa;
}

body {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

.hero {
    background: linear-gradient(135deg, #4caf50, #2e8b57);
    color: #fff;
    padding: 6rem 1rem;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero-overlay {
    max-width: 600px;
    margin: 0 auto;
    background-color: rgba(0,0,0,0.5);
    padding: 2rem;
    border-radius: 8px;
}

html.dark-mode .hero-overlay {
    background-color: rgba(255,255,255,0.1);
}

.calendar-table {
    width: 100%;
    table-layout: fixed;
}

.calendar-day {
    height: 140px;
    vertical-align: top;
    padding: 0.25rem;
    position: relative;
    background-color: #fff;
}

.calendar-day.weekend {
    background-color: #f0f8ff;
}

.calendar-day.other-month {
    background-color: #f8f9fa;
    color: #aaa;
}

.calendar-day-number {
    font-weight: bold;
    position: absolute;
    top: 2px;
    right: 4px;
}

.calendar-task {
    background-color: #e9f5ff;
    border: 1px solid #cce5ff;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 0.8rem;
    margin-bottom: 2px;
    text-align: left;
}

.calendar-task-status-New {
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.calendar-task-status-Assigned {
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.calendar-task-status-Ongoing {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.calendar-task-status-Completed {
    background-color: #e2e3e5;
    border-color: #d6d8db;
    text-decoration: line-through;
}

/* Navbar tweaks */
.navbar-dark .navbar-brand,
.navbar-dark .nav-link {
    color: #fff;
}

.navbar-dark .nav-link:hover {
    color: #f8f9fa;
}

.marketing h2 {
    margin-top: 1rem;
}


table.table-hover tbody tr:hover {
    background-color: #e9f5ff;
}

/* Dark mode styles */
html.dark-mode {
    background-color: #121212;
    color: #e9ecef;
    --bs-body-bg: #121212;
    --bs-body-color: #e9ecef;
    color-scheme: dark;
}
html.dark-mode body {
    background-color: #121212;
    color: #e9ecef;
}

html.dark-mode .navbar {
    background-color: #1f1f1f !important;
}

html.dark-mode .nav-link,
html.dark-mode .navbar-brand {
    color: #e9ecef !important;
}

html.dark-mode table.table-hover tbody tr:hover {
    background-color: #2a2a2a;
}

html.dark-mode .calendar-day {
    background-color: #1e1e1e;
}

html.dark-mode .calendar-day.weekend {
    background-color: #252525;
}

html.dark-mode .calendar-day.other-month {
    background-color: #333;
    color: #bbb;
}

html.dark-mode .calendar-task {
    background-color: #2d2d2d;
    border-color: #444;
}

/* Ensure grey text remains readable in dark mode */
html.dark-mode .text-muted,
html.dark-mode .text-secondary {
    color: #adb5bd !important;
}

html.dark-mode .text-dark {
    color: #f8f9fa !important;
}

html.dark-mode a {
    color: #91c9ff;
}

html.dark-mode a:hover {
    color: #cce5ff;
}

/* Calendar header styling */
.calendar-header .nav-btn {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-header .month-name {
    font-size: 1.5rem;
    font-weight: bold;
}

.view-toggle .btn {
    min-width: 120px;
    border-color: #000;
    color: #000;
    transition: background-color 0.2s, color 0.2s;
}
.view-toggle .btn:hover {
    background-color: #f0f0f0;
}
.view-toggle .btn:focus,
.view-toggle .btn:active {
    box-shadow: none;
}
.view-toggle .btn:active:not(.active) {
    background-color: #e0e0e0;
    color: #000;
    border-color: #000;
}
.view-toggle .btn.active {
    background-color: #000;
    color: #fff;
    border-color: #000;
}
html.dark-mode .view-toggle .btn {
    border-color: #fff;
    color: #fff;
}
html.dark-mode .view-toggle .btn:hover {
    background-color: #333;
}
html.dark-mode .view-toggle .btn:focus,
html.dark-mode .view-toggle .btn:active {
    box-shadow: none;
}
html.dark-mode .view-toggle .btn:active:not(.active) {
    background-color: #444;
    color: #fff;
    border-color: #fff;
}
html.dark-mode .view-toggle .btn.active {
    background-color: #fff;
    color: #000;
    border-color: #fff;
}

html.dark-mode .btn-outline-primary.active {
    color: #fff;
}
.hero-frontpage {
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 6rem 1rem;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.service-boxes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}
.service-box {
    display: inline-block;
    background-color: rgba(255,255,255,0.9);
    color: #000;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s, background-color 0.2s;
    min-width: 180px;
}
.service-box:hover {
    transform: translateY(-5px);
    background-color: #fff;
}
html.dark-mode .service-box {
    background-color: rgba(0,0,0,0.6);
    color: #f8f9fa;
}
html.dark-mode .service-box:hover {
    background-color: rgba(0,0,0,0.8);
}

.feature-icon {
    width: 48px;
    height: 48px;
    fill: #00703C;
    margin-bottom: 12px;
}

.hero-alt {
    background: linear-gradient(135deg, #4caf50, #2e8b57);
    color: #fff;
    padding: 8rem 1rem;
    margin-bottom: 2rem;
}

.hero-alt .btn {
    background-color: #fff;
    color: #2e8b57;
    border: none;
}

.hero-alt .btn:hover {
    background-color: #f8f9fa;
}

html.dark-mode .hero-alt {
    background: linear-gradient(135deg, #2e8b57, #1c4a32);
}

.hero-image {
    background: linear-gradient(135deg, #4caf50, #2196f3);
    color: #fff;
    padding: 8rem 1rem;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero-buttons .btn {
    min-width: 160px;
}

html.dark-mode .hero-buttons .btn {
    background-color: #2a2a2a;
    color: #f8f9fa;
    border-color: #444;
}

html.dark-mode .hero-buttons .btn:hover {
    background-color: #444;
}

html.dark-mode .hero-image {
    background: linear-gradient(135deg, #1b5e20, #0d47a1);
}
html.dark-mode table,
html.dark-mode .table {
    color: #e9ecef;
    --bs-table-color: #e9ecef;
    --bs-table-bg: #1f1f1f;
    --bs-table-striped-bg: #2a2a2a;
    --bs-table-striped-color: #e9ecef;
    --bs-table-hover-bg: #262626;
    --bs-table-hover-color: #e9ecef;
    --bs-table-border-color: #444;
}
html.dark-mode thead,
html.dark-mode .table thead {
    color: #f8f9fa;
    background-color: #1f1f1f;
}
html.dark-mode label,
html.dark-mode .form-label,
html.dark-mode .form-check-label {
    color: #e9ecef;
}
html.dark-mode .form-control {
    background-color: #2a2a2a;
    color: #e9ecef;
    border-color: #444;
}
html.dark-mode ::placeholder {
    color: #adb5bd;
}

html.dark-mode .form-check-input {
    background-color: #2a2a2a;
    border-color: #444;
}

html.dark-mode .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

html.dark-mode .table-striped > tbody > tr:nth-of-type(odd) {
    --bs-table-accent-bg: #2a2a2a;
}

html.dark-mode .table,
html.dark-mode .table-bordered {
    border-color: #444;
}

body {
    font-family: 'Roboto', sans-serif;
}

header .nav-link {
    color: #888;
    font-weight: 500;
}

header .nav-link:hover {
    color: #000;
}

header .btn-link.nav-link {
    color: #888;
    text-decoration: none;
}

header .btn-link.nav-link:hover {
    color: #000;
    text-decoration: none;
}

header .nav-link.active {
    color: #000;
}

.language-switcher {
    width: auto;
    padding-left: 0.5rem;
    padding-right: 2rem;
}

.hero-clean {
    text-align: center;
    padding: 80px 20px 40px;
}

.hero-clean h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-clean p {
    font-size: 20px;
    color: #888;
    margin-bottom: 30px;
}

.hero-clean .btn {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 6px;
}

.video-placeholder {
    margin: 40px auto;
    width: 80%;
    max-width: 800px;
    height: 300px;
    background-color: #f2f2f2;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ccc;
}

.features-clean {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 60px 20px;
    flex-wrap: wrap;
}

.feature-clean {
    text-align: center;
    max-width: 250px;
}

.feature-clean p {
    color: #888;
}

.feature-icon {
    width: 48px;
    height: 48px;
    fill: #00703C;
    margin-bottom: 12px;
}

.signup-clean {
    text-align: center;
    padding: 60px 20px;
}

.signup-clean input {
    padding: 10px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    width: 250px;
    margin-bottom: 10px;
}

.signup-clean .btn {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 6px;
}

.footer-clean {
    background-color: #fff;
    padding: 40px 0;
    border-top: 1px solid #eee;
}

html.dark-mode .footer-clean {
    background-color: #1f1f1f;
    border-top-color: #444;
    color: #e9ecef;
}

.footer-clean a {
    text-decoration: none;
    color: #888;
    display: block;
    margin-bottom: 4px;
}

.footer-clean h4 {
    margin-bottom: 10px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

html.dark-mode header {
    border-color: #444;
}

html.dark-mode header .btn-link.nav-link {
    color: #e9ecef;
}

html.dark-mode .language-switcher {
    background-color: #2a2a2a;
    color: #e9ecef;
    border-color: #444;
}

html.dark-mode .hero-clean p,
html.dark-mode .feature-clean p,
html.dark-mode .footer-clean a {
    color: #adb5bd;
}

html.dark-mode .video-placeholder {
    background-color: #333;
    color: #666;
}

html.dark-mode .feature-icon {
    fill: #666;
}

html.dark-mode .signup-clean input {
    background-color: #2a2a2a;
    color: #e9ecef;
    border-color: #444;
}

html.dark-mode .signup-clean input::placeholder {
    color: #adb5bd;
}

/* Authentication pages */
.auth-page {
    background-color: var(--bs-body-bg);
    min-height: calc(100vh - 56px); /* account for header */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.15);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Wider variant used on the registration page */
.auth-card-wide {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.auth-description {
    font-size: 1rem;
    color: #6c757d;
}

html.dark-mode .auth-page {
    background-color: var(--bs-body-bg);
}

html.dark-mode .auth-card {
    background-color: rgba(0, 0, 0, 0.6);
}

html.dark-mode .auth-description {
    color: #adb5bd;
}

/* FullCalendar event colors based on status */
.fc-event.WorkTask-status-New {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #000;
}
.fc-event.WorkTask-status-Assigned {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #000;
}
.fc-event.WorkTask-status-Ongoing {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #000;
}
.fc-event.WorkTask-status-Completed {
    background-color: #e2e3e5;
    border-color: #d6d8db;
    color: #000;
    text-decoration: line-through;
}

#workerSelect {
    max-height: 60vh;
}

/* visual hint for additional calendar content */
.calendar-scroll-shadow {
    position: absolute;
    left: 0;
    right: 0;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}
.calendar-scroll-shadow.top {
    top: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.25), transparent);
}
.calendar-scroll-shadow.bottom {
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.25), transparent);
}
.calendar-scroll-shadow.visible { opacity: 1; }
html.dark-mode .calendar-scroll-shadow.top {
    background: linear-gradient(to bottom, rgba(255,255,255,0.25), transparent);
}
html.dark-mode .calendar-scroll-shadow.bottom {
    background: linear-gradient(to top, rgba(255,255,255,0.25), transparent);
}

/* Outlook-like calendar theme */
.calendar-outlook {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.calendar-outlook .fc-toolbar {
    background-color: #0078d4;
    padding: 0.25rem 1rem;
    border: none;
}
.calendar-outlook .fc-toolbar-title {
    color: #fff;
    font-size: 1.25rem;
    margin: 0;
}
.calendar-outlook .fc-button {
    background-color: transparent;
    border: none;
    color: #fff;
}
.calendar-outlook .fc-button:hover {
    background-color: rgba(255,255,255,0.2);
    color: #fff;
}
.calendar-outlook .fc-button-primary:not(:disabled).fc-button-active,
.calendar-outlook .fc-button-primary:not(:disabled):active {
    background-color: rgba(255,255,255,0.3);
    border: none;
}
.calendar-outlook .fc-col-header-cell-cushion {
    font-weight: 400;
    font-size: 1.2rem;
    color: #000;
    text-decoration: none;
}
.calendar-outlook .fc-day-name {
    font-size: 1.1rem;
    font-weight: 500;
    display: block;
}
.calendar-outlook .fc-day-date {
    font-size: 0.875rem;
    font-weight: 400;
    display: block;
}
.calendar-outlook .fc-daygrid-day-number {
    font-weight: normal;
    font-size: 1rem;
    color: #000;
    text-decoration: none;
}

html.dark-mode .calendar-outlook .fc-col-header-cell-cushion,
html.dark-mode .calendar-outlook .fc-daygrid-day-number {
    color: #fff;
    text-decoration: none;
}
html.dark-mode .calendar-outlook .fc-day-name,
html.dark-mode .calendar-outlook .fc-day-date {
    color: #fff;
}
.calendar-outlook .fc-daygrid-event {
    border: none;
    border-radius: 2px;
    padding: 2px 4px;
    font-size: 0.75rem;
}
.calendar-outlook .fc-timegrid-event {
    border: none;
    border-radius: 2px;
    padding: 2px 4px;
    font-size: 0.75rem;
}
.calendar-outlook .fc-timegrid-slot,
.calendar-outlook .fc-timegrid-slot-lane,
.calendar-outlook .fc-timegrid-slot-minor {
    border-color: rgba(0, 0, 0, 0.1);
}
html.dark-mode .calendar-outlook .fc-timegrid-slot,
html.dark-mode .calendar-outlook .fc-timegrid-slot-lane,
html.dark-mode .calendar-outlook .fc-timegrid-slot-minor {
    border-color: rgba(255, 255, 255, 0.15);
}
.calendar-outlook .fc-day-sat,
.calendar-outlook .fc-day-sun {
    background-color: #f8f9fa;
}
.calendar-outlook .fc-day-today {
    background-color: #fff8e1;
}
html.dark-mode .calendar-outlook .fc-day-sat,
html.dark-mode .calendar-outlook .fc-day-sun {
    background-color: #252525;
}
html.dark-mode .calendar-outlook .fc-day-today {
    background-color: #33331a;
}

/* redesigned calendar layout */
.calendar-container {
    display: flex;
    gap: 1rem;
    flex-wrap: nowrap;
}
.calendar-sidebar {
    width: 220px;
    flex: 0 0 auto;
    padding-left: 0.75rem;
}
@media (max-width: 768px) {
    .calendar-container { flex-direction: column; }
    .calendar-sidebar { width: 100%; }
}

.worker-color {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.calendar-sidebar .form-check-label {
    font-size: 0.9rem;
}
.calendar-sidebar .form-check-input {
    width: 1.1rem;
    height: 1.1rem;
}

.mini-calendar {
    display: grid;
    grid-template-columns: 1.5rem repeat(7, 1fr);
    column-gap: 0;
    row-gap: 2px;
    width: max-content;
}
.mini-calendar-header {
    font-size: 0.7rem;
    text-align: center;
    font-weight: 500;
}
.mini-calendar-header.blank {
    background: none;
}
.mini-calendar .week-number {
    font-size: 0.75rem;
    text-align: center;
    font-weight: 600;
    padding: 0;
    color: #333;
    background-color: #f8f8f8;
    border-radius: 0.25rem;
}
.mini-calendar-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: capitalize;
}
.mini-calendar .mini-day {
    width: 1.2rem;
    height: 1.2rem;
    padding: 0;
    font-size: 0.75rem;
    border: none;
    background: transparent;
    border-radius: 0.25rem;
    cursor: pointer;
    text-align: center;
}
.mini-calendar .mini-day.other {
    opacity: 0.4;
}
.mini-calendar .mini-day.today {
    font-weight: 600;
    background-color: #fff8e1;
    border-radius: 0;
}
.mini-calendar .mini-day.selected-day {
    font-weight: 700;
    background-color: #ffe2b5;
    border: 2px solid #ff9800;
    border-radius: 0;
}
html.dark-mode .mini-calendar .mini-day.selected-day {
    background-color: #4a3c1a;
    border: 2px solid #ffb74d;
}
html.dark-mode .mini-calendar .mini-day.today {
    background-color: #33331a;
    border-radius: 0;
}
.mini-calendar .week-number.selected-week,
.mini-calendar .mini-day.selected-week:not(.selected-day) {
    background-color: #dae7ff;
    border-radius: 0;
    box-shadow: none;
}
html.dark-mode .mini-calendar .week-number.selected-week,
html.dark-mode .mini-calendar .mini-day.selected-week:not(.selected-day) {
    background-color: #203354;
    border-radius: 0;
    box-shadow: none;
}
.mini-calendar .mini-day:hover {
    background-color: #f0f0f0;
}
html.dark-mode .mini-calendar .mini-day:hover {
    background-color: #333;
}
html.dark-mode .mini-calendar-header,
html.dark-mode .mini-calendar .week-number {
    color: #fff;
    background-color: #333;
}

.calendar-topbar {
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}
.calendar-topbar a {
    text-decoration: none;
}

.calendar-topbar .nav-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    color: #000;
    text-decoration: none;
}
.month-nav {
    position: relative;
    width: 16rem;
    flex: 0 0 auto;
    padding: 0 3rem;
}
.calendar-topbar .nav-btn:hover {
    background-color: #f0f0f0;
    color: #000;
}

html.dark-mode .calendar-topbar .nav-btn {
    color: #fff;
}

html.dark-mode .calendar-topbar .nav-btn:hover {
    background-color: #333;
    color: #fff;
}
.calendar-topbar .month-name {
    font-weight: 600;
    font-size: 1.25rem;
    text-transform: capitalize;
    display: block;
}
.calendar-topbar input {
    max-width: 200px;
    height: calc(1.5em + 0.75rem + 2px);
}

#calendar {
    height: calc(100vh - 200px);
    min-height: 600px;
}

.timepicker-dropdown {
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background-color: #fff;
    z-index: 1000;
}
.timepicker-dropdown div {
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}
.timepicker-dropdown div:hover {
    background-color: #e9f5ff;
}

/* Work task creation form enhancements */
.worktask-form .card-header {
    background-color: #f8f9fa;
    font-weight: 600;
}
html.dark-mode .worktask-form .card-header {
    background-color: #1f1f1f;
}

/* Generic card styling for dark mode */
html.dark-mode .card {
    background-color: #1f1f1f;
    color: #e9ecef;
}

html.dark-mode .card-header {
    background-color: #232323;
}

/* Equipment catalog collapse toggle */
.catalog-toggle i {
    transition: transform 0.2s;
}
.catalog-toggle[aria-expanded="false"] i {
    transform: rotate(-90deg);
}

/* Allow clicking entire catalog header to toggle */
.catalog-header {
    cursor: pointer;
}

/* Gradient button styles */
.btn-main {
    background: linear-gradient(135deg, #4caf50, #2e8b57);
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
}
.btn-main:hover {
    background: linear-gradient(135deg, #43a047, #276749);
    color: #fff;
}

.btn-main-outline {
    background: transparent;
    color: #2e8b57;
    border: 2px solid #2e8b57;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    transition: background-color 0.2s, color 0.2s;
}
.btn-main-outline:hover {
    background: #2e8b57;
    color: #fff;
}

/* Limit height of worker task list to keep actions visible */
.assigned-tasks-scroll {
    max-height: 60vh;
    overflow-y: auto;
}
