/* GLOBAL STYLES
-------------------------------------------------- */
/* Padding below the footer and lighter body text */

body {
    padding-bottom: 40px;
    color: #5a5a5a;
    background-image: linear-gradient(to bottom, #FFFFF3 0%, #FFFFEA 100%);
}

/* CUSTOMIZE THE NAVBAR
-------------------------------------------------- */

.navbar-wrapper > .container {
    padding-right: 0;
    padding-left: 0;
}
.navbar-wrapper .navbar {
    padding-right: 15px;
    padding-left: 15px;
}
.navbar-wrapper .navbar .container {
    width: auto;
}

/* Private navbar (tan/default) */
.navbar-private {
    background-color: #DDDFBE;
    border-bottom: 2px solid #8C241F;
}

.navbar-private .navbar-brand {
    color: #8C241F;
}

.navbar-logo-private {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.navbar-private .navbar-text {
    color: #8C241F;
}

.navbar-private .navbar-nav .nav-link {
    color: #8C241F;
}

/* Public navbar (dark red/inverse) */
.navbar-dark {
    background-color: #8C241F;
    border-color: #8C241F;
}
.navbar-dark .navbar-brand {
    color: #DDDFBE;
}
.navbar-dark .navbar-text {
    color: #DDDFBE;
}
.navbar-dark .navbar-nav .nav-link {
    color: #DDDFBE;
}

/* Public pages: offset for fixed-top navbar */
body.public-page {
    padding-top: 56px;
}

/* SIDEBAR NAVIGATION
-------------------------------------------------- */

.sidebar {
    width: 260px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
}

.sidebar .offcanvas-header {
    background-color: #8C241F;
    color: #DDDFBE;
}

.sidebar .nav-section-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8C241F;
    padding: 0.75rem 1rem 0.25rem;
    margin-top: 0.5rem;
}

.sidebar .accordion-button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background-color: transparent;
    color: #333;
}

.sidebar .accordion-button:not(.collapsed) {
    background-color: rgba(140, 36, 31, 0.08);
    color: #8C241F;
    box-shadow: none;
}

.sidebar .accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.sidebar .accordion-body {
    padding: 0;
}

.sidebar .accordion-body a {
    display: block;
    padding: 0.35rem 1rem 0.35rem 2rem;
    font-size: 0.85rem;
    color: #555;
    text-decoration: none;
}

.sidebar .accordion-body a:hover {
    background-color: rgba(140, 36, 31, 0.08);
    color: #8C241F;
}

.sidebar .nav-link-single {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: #333;
    text-decoration: none;
}

.sidebar .nav-link-single:hover {
    background-color: rgba(140, 36, 31, 0.08);
    color: #8C241F;
}

.sidebar .accordion-body a.active,
.sidebar .nav-link-single.active {
    background-color: rgba(140, 36, 31, 0.12);
    color: #8C241F;
    font-weight: 600;
}

/* Desktop: pin sidebar fixed, offset content */
@media (min-width: 992px) {
    .sidebar.offcanvas-lg {
        position: fixed !important;
        top: 56px;
        bottom: 0;
        left: 0;
        width: 260px !important;
        background-color: #f8f9fa !important;
        border-right: 1px solid #dee2e6;
        z-index: 1019;
        visibility: visible !important;
        transform: none !important;
    }

    .sidebar.offcanvas-lg .offcanvas-body {
        display: block !important;
        background-color: transparent !important;
        overflow-y: auto !important;
        height: 100%;
        padding: 0 !important;
    }

    .page-with-sidebar {
        margin-left: 260px;
        width: auto;
    }
}

/* Carousel and marketing content styles moved to avfd-modern.css */

/* Featurettes - Keep for About Us page */

.featurette-divider {
    margin: 80px 0;
}

.featurette-heading {
    font-weight: 300;
    line-height: 1;
    letter-spacing: -1px;
    color: #D91408;
}

.text-muted {
    color: #8295A6 !important;
}

@media (min-width: 768px) {
    .featurette-heading {
        font-size: 50px;
    }
}

@media (min-width: 992px) {
    .featurette-heading {
        margin-top: 120px;
    }
}

/* Heading colors */
h1 {
    color: #D91408;
}

h2 {
    color: #8295A6;
}

.no-padding {
    padding: 0;
}

.green{
  color: green;
}

.red{
    color:red;
}

.orange{
    color:orange;
}

.blue{
    color:blue;
}

.lightblue{
    color:#4B9CD3
}

/* Form validation feedback */
.invalid-feedback {
    font-size: 0.875rem;
}

/* Heading consistency for private pages */
h3 {
    color: #5a5a5a;
}

/* Enabling prettier tables */
.table td.no_left_border {
    border-left: none;
}

.table td.no_right_border {
    border-right: none;
}

.table td.thick_left_border {
    border-left: 1px solid black;
}

.table td.thick_right_border {
    border-right: 1px solid black;
}

.table th.thick_left_border {
    border-left: 1px solid black;
}

.table th.thick_right_border {
    border-right: 1px solid black;
}

.table th.thick_top_border {
    border-top: 1px solid grey;
}

.table td.thick_top_border {
    border-top: 1px solid grey;
}

.table td.thin_left_border {
    border-left: 1px solid #ddd;
}

.table th.thin_left_border {
    border-left: .5px solid #ddd;
}

/* ── Today column highlight ── */
.duty-calendar th.today-col,
.duty-calendar td.today-col {
    background-color: rgba(26, 35, 50, 0.06);
}
.duty-calendar thead th.today-col {
    font-weight: 700;
}
/* Preserve staffing colors over today highlight */
.duty-calendar td.today-col.staffing-threshold-met { background-color: #d4edda; }
.duty-calendar td.today-col.staffing-objective-met { background-color: #28a745; color: white; }

/* ── Mini month calendar ── */
.mini-cal {
    min-width: 240px;
    user-select: none;
}
.mini-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}
.mini-cal-title {
    font-weight: 600;
    font-size: 0.85rem;
}
.mini-cal-nav {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    color: #555;
    border-radius: 0.25rem;
}
.mini-cal-nav:hover {
    background-color: #e9ecef;
}
.mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1;
}
.mini-cal-dow {
    font-weight: 600;
    color: #888;
    padding: 0.2rem 0;
    font-size: 0.65rem;
    text-transform: uppercase;
}
.mini-cal-day {
    padding: 0.3rem 0.15rem;
    cursor: pointer;
    border-radius: 0.2rem;
    color: #333;
}
.mini-cal-day:hover {
    background-color: #e9ecef;
}
.mini-cal-blank {
    cursor: default;
}
.mini-cal-blank:hover {
    background: none;
}
.mini-cal-active {
    background-color: #CC3333;
    color: #fff;
    font-weight: 600;
}
.mini-cal-active:hover {
    background-color: #a82a2a;
    color: #fff;
}
.mini-cal-today {
    outline: 2px solid #333;
    outline-offset: -2px;
}

/* ── Empty cell indicator ── */
.duty-calendar td .cell-empty {
    color: #ccc;
    font-size: 0.85em;
}

/* ── Legend ── */
.schedule-legend {
    font-size: 0.75rem;
    color: #666;
}
.schedule-legend .legend-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.schedule-legend .legend-item {
    white-space: nowrap;
}

/* ── Collapsible shift group headers ── */
.shift-group-header {
    cursor: pointer;
    user-select: none;
    background-color: #f8f9fa;
}
.shift-group-header:hover {
    background-color: #e9ecef;
}
.shift-group-header td {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    border-top: 2px solid #dee2e6;
}
.shift-group-header .toggle-icon {
    transition: transform 0.2s;
    display: inline-block;
}
.shift-group-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}
.shift-row.hidden-by-group,
.shift-row.hidden-by-filter {
    display: none;
}

/* ── Schedule header layout ── */
.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.schedule-header-left {
    flex: 1;
    min-width: 0;
}
.schedule-header-left h4 {
    font-size: 1.25rem;
    font-weight: 600;
}
.schedule-header-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
@media (max-width: 767.98px) {
    .schedule-header {
        flex-direction: column;
        align-items: stretch;
    }
    .schedule-header-right {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ── Role filter bar ── */
.role-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.role-filter-bar .btn {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
}
.role-filter-bar .btn.active {
    font-weight: 600;
}
.role-filter-bar .dropdown-item.active {
    background-color: transparent;
    color: inherit;
    font-weight: 600;
}
.role-filter-bar .dropdown-item {
    font-size: 0.85rem;
    padding: 0.3rem 1rem;
}

/* ── Inline sign-up button ── */
.signup-inline-btn {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #0d6efd;
    background: none;
    border: 1px dashed #0d6efd;
    border-radius: 0.25rem;
    cursor: pointer;
    line-height: 1.3;
}
.signup-inline-btn:hover {
    background-color: #0d6efd;
    color: #fff;
    border-style: solid;
}

/* ── Officer Mode ── */
.officer-action-queue {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}
.action-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0;
    border-bottom: 1px solid #fff3cd;
}
.action-queue-item:last-child { border-bottom: none; }

.officer-readiness-bar {
    display: flex;
    align-items: center;
    gap: 2px;
}
.readiness-label { white-space: nowrap; }
.readiness-segment {
    flex: 1;
    text-align: center;
    padding: 0.2rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.2rem;
    color: #fff;
    cursor: default;
}
.readiness-green { background-color: #28a745; }
.readiness-amber { background-color: #e67e22; }
.readiness-red { background-color: #dc3545; }
.readiness-gray { background-color: #adb5bd; }

/* Gap dots hidden by default, visible only in officer view */
.officer-only-indicator { display: none; }
.officer-view .officer-only-indicator { display: inline; }

/* Officer view enhanced gap indicators */
.officer-view .staffing-threshold-met { background-color: rgba(212, 237, 218, 0.8); }
.officer-view td:not(.staffing-threshold-met):not(.staffing-objective-met) {
    border-left: 3px solid #e67e22;
}
.officer-view td.staffing-threshold-met,
.officer-view td.staffing-objective-met {
    border-left: none;
}

/* ── Gap Filler Panel ── */
.gap-filler-panel {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #fff;
    margin-bottom: 0.75rem;
}
.gap-filler-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    background: #f8f9fa;
    border-radius: 0.375rem 0.375rem 0 0;
    border-bottom: 1px solid #dee2e6;
}
.gap-filler-panel.collapsed .gap-filler-body {
    display: none;
}
.gap-filler-panel.collapsed .gap-filler-header {
    border-bottom: none;
    border-radius: 0.375rem;
}
.gap-filler-panel.collapsed .gap-filler-toggle i {
    transform: rotate(-90deg);
}
.gap-filler-toggle i {
    transition: transform 0.15s ease;
}
.gap-filler-body {
    max-height: 400px;
    overflow-y: auto;
}
.gap-filler-slot {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
}
.gap-filler-slot:last-child { border-bottom: none; }
.gap-filler-slot-header {
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    color: #495057;
}
.gap-filler-position {
    margin-left: 0.5rem;
    margin-bottom: 0.35rem;
}
.gap-filler-position-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.15rem;
}
.gap-filler-member {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0;
    font-size: 0.8rem;
}
.gap-filler-member-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gap-filler-member-count {
    white-space: nowrap;
}
.gap-filler-invite-btn {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    white-space: nowrap;
}

/* ── Crew Card View ── */
.crew-shift-heading {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    padding: 0.3rem 0.5rem;
    background: #f8f9fa;
    border-radius: 0.25rem;
}
.crew-card-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.crew-card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.4rem;
    font-size: 0.8rem;
    min-height: 60px;
    display: flex;
    flex-direction: column;
}
.crew-card-today {
    border-color: #0d6efd;
    border-width: 2px;
}
.crew-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid #eee;
}
.crew-card-header .badge { font-size: 0.65rem; }
.crew-card-body {
    flex: 1;
}
.crew-member {
    padding: 0.1rem 0;
    line-height: 1.3;
}
.crew-member-pending { opacity: 0.6; font-style: italic; }
.crew-section { margin-bottom: 0.25rem; }
.crew-section:last-child { margin-bottom: 0; }
.crew-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    margin-bottom: 0.1rem;
}
.crew-section-label .fa-fire { color: #dc3545; }
.crew-section-label .fa-ambulance { color: #0d6efd; }
.crew-card-footer {
    margin-top: auto;
    padding-top: 0.2rem;
}
.crew-card-signup {
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}
.crew-signup-labeled {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.crew-signup-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #6c757d;
}
.crew-card-signup .signup-inline-btn,
.crew-card-signup .signup-urgent {
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
}

@media (max-width: 767px) {
    .crew-card-row {
        grid-template-columns: 1fr;
    }
    .crew-card-header { font-size: 0.82rem; }
}

/* ── Gap indicator dot ── */
.gap-dot {
    color: #e67e22;
    font-size: 0.7rem;
    vertical-align: middle;
    margin-left: 0.25rem;
    cursor: default;
}

/* ── My Shifts summary bar ── */
.my-shifts-bar {
    background: #f0f4f8;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.4rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
}
.my-shifts-label { font-weight: 600; }
.my-shifts-divider {
    color: #adb5bd;
    margin: 0 0.4rem;
}
.my-shifts-bar-desktop { display: block; }
.my-shifts-bar-mobile { display: none; cursor: pointer; }
.my-shifts-bar-expanded { display: none; }
.my-shifts-expand-icon {
    margin-left: 0.3rem;
    transition: transform 0.2s;
}
.my-shifts-bar.expanded .my-shifts-expand-icon {
    transform: rotate(180deg);
}
.my-shifts-bar.expanded .my-shifts-bar-expanded {
    display: block;
    padding-top: 0.4rem;
    border-top: 1px solid #dee2e6;
    margin-top: 0.4rem;
    font-size: 0.82rem;
}

@media (max-width: 767px) {
    .my-shifts-bar-desktop { display: none; }
    .my-shifts-bar-mobile { display: block; }
}

/* ── Gamification: streak badge + hours progress ── */
.my-streak-badge {
    color: #e67e22;
    font-weight: 600;
    white-space: nowrap;
}
.my-streak-badge i { color: #e67e22; }
.my-hours-progress { white-space: nowrap; }

/* ── Urgent sign-up styling ── */
.signup-urgent {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background-color: #e67e22;
    border: 1px solid #e67e22;
    border-radius: 0.25rem;
    cursor: pointer;
}
.signup-urgent:hover {
    background-color: #d35400;
    border-color: #d35400;
    color: #fff;
}

/* ── Sign-up modal ── */
.signup-modal-info {
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
}
#signupModal .modal-sm { max-width: 360px; }

/* ── Invite autocomplete ── */
.invite-search-wrapper { position: relative; }
.invite-search-results {
    position: absolute;
    z-index: 1050;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    max-height: 150px;
    overflow-y: auto;
    width: 100%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.invite-result-item {
    padding: 0.3rem 0.5rem;
    font-size: 0.82rem;
    cursor: pointer;
}
.invite-result-item:hover { background-color: #f0f4f8; }
.invite-tag {
    display: inline-block;
    background: #e9ecef;
    border-radius: 1rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.78rem;
    margin: 0.15rem 0.15rem 0 0;
}
.invite-tag-remove {
    cursor: pointer;
    margin-left: 0.2rem;
    font-weight: bold;
    color: #6c757d;
}
.invite-tag-remove:hover { color: #dc3545; }

/* ── Consistent cell formatting ── */
.shift-entry { margin-bottom: 0.15rem; }
.shift-entry + .shift-entry { padding-top: 0.15rem; border-top: 1px dotted #eee; }
.shift-member { font-weight: 500; }
.shift-badges { font-size: 0.8em; opacity: 0.85; }
.shift-notes { display: block; font-size: 0.8em; color: #888; font-style: italic; }

/* ── Staffing summary dots (inline in table headers & mobile tabs) ── */
.summary-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.2rem;
    vertical-align: middle;
}
.summary-dot.status-green { background-color: #28a745; }
.summary-dot.status-yellow { background-color: #ffc107; }
.summary-dot.status-red { background-color: #dc3545; }
.summary-dot.status-gray { background-color: #ccc; }

/* ── Staffing indicator borders (column headers & mobile tabs) ── */
.staffing-border-faint { border-top: 4px solid #c8e6c9 !important; }
.staffing-border-light { border-top: 4px solid #81c784 !important; }
.staffing-border-full { border-top: 4px solid #28a745 !important; }
.staffing-border-gray { border-top: 4px solid #ccc !important; }

/* ── Mobile card view ── */
.mobile-schedule { display: none; }
.mobile-day-tabs {
    display: flex;
    overflow-x: auto;
    gap: 0;
    border-bottom: 2px solid #dee2e6;
    -webkit-overflow-scrolling: touch;
}
.mobile-day-tabs .day-tab {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    color: #666;
}
.mobile-day-tabs .day-tab.active {
    color: #CC3333;
    border-bottom-color: #CC3333;
    font-weight: 700;
}
.mobile-day-panel { display: none; }
.mobile-day-panel.active { display: block; }
.mobile-shift-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.mobile-shift-card-header {
    background-color: #f8f9fa;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid #dee2e6;
}
.mobile-shift-card-body { padding: 0; }
.mobile-position-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    gap: 0.5rem;
}
.mobile-position-row:last-child { border-bottom: none; }
.mobile-position-label {
    font-weight: 500;
    font-size: 0.85rem;
    min-width: 110px;
    flex-shrink: 0;
    color: #555;
}
.mobile-position-content {
    flex: 1;
    font-size: 0.85rem;
    text-align: right;
}
.mobile-position-content .cell-empty { color: #ccc; }

/* ── Responsive: hide desktop table, show mobile on small screens ── */
@media (max-width: 991.98px) {
    .desktop-schedule { display: none !important; }
    .mobile-schedule { display: block !important; }
}
@media (min-width: 992px) {
    .desktop-schedule { display: block; }
    .mobile-schedule { display: none; }
}

/* Duty schedule calendar desktop responsive */
@media (max-width: 768px) {
    .duty-calendar td, .duty-calendar th {
        font-size: 0.75rem;
        padding: 0.25rem;
    }
}

/* Staffing standard highlighting - positive reinforcement only (reduced ~20% to not compete with gap indicators) */
.staffing-threshold-met,
.table td.staffing-threshold-met {
    background-color: rgba(212, 237, 218, 0.8);
}

.staffing-objective-met,
.table td.staffing-objective-met {
    background-color: rgba(40, 167, 69, 0.8);
    color: white;
}

.table td.staffing-objective-met a {
    color: white;
}
