/* ----------------------------------------------------------
   Group weekly table layout
---------------------------------------------------------- */

/* Pending shift-change clock badge (weekly view) */
.eac-gw-shiftchange-pending{
  display:inline-block;
  margin-left: 6px;
  font-size: 0.95em;
  line-height: 1;
  opacity: 0.9;
  cursor: help;
  vertical-align: middle;
}

.eac-gw-wrapper {
    margin-top: 18px;
}

/* Reduce side padding so the weekly grid can breathe (removes left/right whitespace). */
.eac-wrapper.eac-gw-fullwidth{
    padding-left: 10px;
    padding-right: 10px;
}



/* ----------------------------------------------------------
   Weekly header TDY/Deployment filter dropdown
---------------------------------------------------------- */

.eac-wrapper.eac-gw-fullwidth .eac-header {
    flex-wrap: wrap;
    gap: 10px;
}

.eac-wrapper.eac-gw-fullwidth .eac-header-mid {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
}

.eac-wrapper.eac-gw-fullwidth .eac-gw-tdy-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 420px;
}

.eac-wrapper.eac-gw-fullwidth .eac-gw-tdy-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #1f2937;
    background-color: #020617;
    color: #e5e7eb;
    font-size: 0.9rem;
}

.eac-wrapper.eac-gw-fullwidth .eac-gw-tdy-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
}

.eac-wrapper.eac-gw-fullwidth .eac-gw-tdy-select option {
    background-color: #020617;
    color: #e5e7eb;
}

/* Light theme styling for the header dropdown */
.eac-wrapper.eac-theme-light.eac-gw-fullwidth .eac-gw-tdy-select {
    background-color: #e5f0ff;
    border-color: #cbd5f5;
    color: #0f172a;
}

.eac-wrapper.eac-theme-light.eac-gw-fullwidth .eac-gw-tdy-select option {
    background-color: #e5f0ff;
    color: #0f172a;
}

@media (max-width: 768px) {
    .eac-wrapper.eac-gw-fullwidth .eac-header-mid {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }

    .eac-wrapper.eac-gw-fullwidth .eac-gw-tdy-filter {
        max-width: 100%;
    }
}
/* Weekly toolbar: keep the Prev/Range/Next cluster centered, while actions sit far-right */
.eac-gw-toolbar {
    width: 100%;
}

.eac-gw-nav-wrap {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.eac-gw-print-wrap {
    margin-left: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile: keep both print buttons grouped on the right side of the action row */
@media (max-width: 768px) {
    .eac-weekly-mobile .eac-gw-print-wrap {
        margin-left: 0;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
    }
}

.eac-gw-table-container {
    margin-top: 12px;
    background-color: #020617;
    border-radius: 12px;
    border: 1px solid #111827;
    padding: 6px 8px;
    overflow-x: auto;
}

.eac-gw-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto; /* allow variable column widths */
    min-width: 720px;
    font-size: 0.85rem;
}

.eac-gw-table thead th {
    text-align: center;
    padding: 4px 4px;
    border: 1px solid #0b1120;
    color: #e5e7eb;
    vertical-align: top;
    white-space: normal;
    line-height: 1.05;
}

.eac-gw-name-header {
    text-align: left;
    width: 220px;
}


.eac-gw-spec-header {
    text-align: left;
    width: 70px;
}

/* Skill Level column (SL) */
.eac-gw-sl-header{
    text-align: center;
    width: 44px;
}

.eac-gw-sl-cell{
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.eac-gw-day-header {
    font-weight: 500;
}

/* Federal holidays: grey background + name under date */
.eac-gw-holiday-header,
.eac-gw-holiday {
    background: #e5e7eb;
}

.eac-theme-dark .eac-gw-holiday-header,
.eac-theme-dark .eac-gw-holiday {
    background: #1f2937;
}

.eac-gw-holiday-name {
    font-size: 0.72rem;
    line-height: 1.1;
    margin-top: 2px;
    opacity: 0.9;

    display: block;
    white-space: normal;
    word-break: break-word;
}

.eac-gw-dayhdr-top {
    font-size: 0.9rem;
    line-height: 1.1;

    display: block;
    font-weight: 700;
    white-space: normal;
}

.eac-gw-table tbody tr {
    height: 40px;
}


/* Deployment indicator (shown for members on the current deployment).
   Keep it tiny + inline so it doesn't change overall table spacing. */
.eac-gw-deploy-badge{
  display:inline-block;
  font-size: 14px;
  width: 14px;
  height: 14px;
  line-height: 14px;
  margin-right: 6px;
  vertical-align: middle;
  opacity: 0.95;
}

.eac-gw-deploy-badge.dashicons{
  font-size: 14px;
  width: 14px;
  height: 14px;
}

.eac-gw-name-cell {
    padding: 4px 6px;
    border: 1px solid #0b1120;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Alternate deployers: orange airplane icon */
.eac-gw-deploy-badge--alt{
  color: var(--eac-gw-deploy-alt-color, #f59e0b);
}



.eac-gw-spec-cell {
    padding: 4px 6px;
    border: 1px solid #0b1120;
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
}

.eac-gw-day-cell {
    padding: 2px 3px;
    border: 1px solid #0b1120;
    vertical-align: middle;
}

.eac-gw-day-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
}

/* Slightly smaller event pill for the grid cells */
.eac-gw-day-inner .eac-event-block {
    font-size: 0.7rem;
    padding: 2px 4px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    line-height: 1.05;
    white-space: normal;
}

/* Flag columns ER / IE / RX / IP */
.eac-gw-table th.eac-gw-flag-header,
.eac-gw-table td.eac-gw-flag-cell {
    width: 12px;
    min-width: 12px;
    max-width: 12px;
    text-align: center;
    font-size: 0.65rem;
    padding: 0;
}

/* Group Weekly Shift Overview */

.eac-gw-shift-overview {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.eac-gw-shift-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.eac-gw-shift-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.15rem;
}

.eac-gw-shift-label {
    font-weight: 600;
    width: 80px;
    flex-shrink: 0;
}

.eac-gw-shift-members > div {
    margin-bottom: 0.1rem;
}

/* Light theme overrides */

.eac-wrapper.eac-theme-light .eac-gw-table-container {
    background-color: #e5f0ff;
    border-color: #cbd5f5;
}

.eac-wrapper.eac-theme-light .eac-gw-table thead th {
    background-color: #dbeafe;
    color: #111827;
    border-color: #cbd5f5;
}

.eac-wrapper.eac-theme-light .eac-gw-table th,
.eac-wrapper.eac-theme-light .eac-gw-table td {
    border-color: #cbd5f5;
}

.eac-wrapper.eac-theme-light .eac-gw-name-cell {
    border-right-color: #cbd5f5;
}

.eac-wrapper.eac-theme-light .eac-gw-day-cell {
    border-left-color: #cbd5f5;
    border-bottom-color: #cbd5f5;
}

/* Responsive */

@media (max-width: 640px) {
    .eac-gw-name-header {
        width: 160px;
    }
}


/* ----------------------------------------------------------
   Shift time inputs (Managers/Supervisors) + display (Employees)
---------------------------------------------------------- */

.eac-gw-shift-time-wrap{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:4px;
    min-height: 28px;
}

.eac-gw-shift-time-input{
    width: 78px;
    min-height: 26px;
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 8px;
    border: 1px solid #0b1120;
    background: transparent;
    color: inherit;
    outline: none;
}

.eac-gw-shift-time-input:focus{
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29,78,216,0.25);
}

.eac-gw-shift-time-clear{
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid #0b1120;
    background: transparent;
    color: inherit;
    cursor: pointer;
    line-height: 1;
    display:flex;
    align-items:center;
    justify-content:center;
    padding: 0;
    opacity: 0.85;
}

.eac-gw-shift-time-clear:hover{
    opacity: 1;
}

.eac-gw-shift-time-clear.is-hidden{
    visibility: hidden;
}

.eac-gw-shift-time-display{
    width: 78px;
    min-height: 26px;
    border-radius: 8px;
    border: 1px dashed #0b1120;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size: 0.75rem;
    padding: 2px 6px;
    box-sizing: border-box;
}


/* ----------------------------------------------------------
   Physical Fitness row (weekdays only)
---------------------------------------------------------- */

.eac-gw-pf-row td{
    background: rgba(255,255,255,0.035);
}

.eac-gw-pf-label-cell{
    font-weight: 800;
}


.eac-gw-pf-label-wrap{
    display:flex;
    flex-direction:column;
    gap: 4px;
}

.eac-gw-pf-label-text{
    font-weight: 800;
    line-height: 1.1;
}

.eac-gw-pf-location-input--label{
    width: 160px;
    max-width: 100%;
}

.eac-gw-pf-location-input{
    width: 100%;
    min-height: 26px;
    padding: 2px 8px;
    font-size: 0.8rem;
    border-radius: 10px;
    border: 1px solid #0b1120;
    background: transparent;
    color: inherit;
    outline: none;
}

.eac-gw-pf-location-input:focus{
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29,78,216,0.25);
}

.eac-gw-pf-location-display{
    font-size: 0.85rem;
    opacity: 0.95;
}

.eac-gw-pf-time-wrap{
    display:flex;
    align-items:center;
    justify-content:center;
    gap: 4px;
    min-height: 28px;
}

.eac-gw-pf-time-input{
    width: 76px;
    min-height: 26px;
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 8px;
    border: 1px solid #0b1120;
    background: transparent;
    color: inherit;
    outline: none;
}

.eac-gw-pf-time-input:focus{
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29,78,216,0.25);
}

.eac-gw-pf-sep,
.eac-gw-pf-dash{
    opacity: 0.8;
    font-weight: 700;
    font-size: 0.8rem;
}

.eac-gw-pf-time-display{
    min-height: 26px;
    border-radius: 8px;
    border: 1px dashed #0b1120;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size: 0.75rem;
    padding: 2px 6px;
    box-sizing: border-box;
    opacity: 0.95;
}

.eac-gw-pf-weekend{
    opacity: 0.7;
}



/* ----------------------------------------------------------
   Shift summary row (Print Shift + availability counts)
---------------------------------------------------------- */

.eac-gw-shift-summary-row td {
    border-top: 2px solid #0b1120;
    background: rgba(255,255,255,0.05);
}

.eac-gw-shift-summary-label {
    font-weight: 700;
}

.eac-gw-shift-summary-count {
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.eac-gw-print-shift-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    border: 1px solid #0b1120;
    background: rgba(255,255,255,0.06);
    color: inherit;
    cursor: pointer;
    padding: 4px 10px;
    font-size: 0.82rem;
    font-weight: 700;
}

.eac-gw-print-shift-btn:hover {
    background: rgba(255,255,255,0.10);
}

.eac-wrapper.eac-theme-light .eac-gw-shift-summary-row td {
    background: #eff6ff;
    border-top-color: #cbd5f5;
}

.eac-wrapper.eac-theme-light .eac-gw-print-shift-btn {
    border-color: #cbd5f5;
    background: #ffffff;
}

/* ----------------------------------------------------------
   Export styling (off-screen node that gets converted to JPG)
---------------------------------------------------------- */

.eac-gw-export {
    width: 1120px; /* landscape-friendly */
    background: #ffffff;
    color: #111827;
    padding: 16px;
    box-sizing: border-box;
}

.eac-gw-export-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.eac-gw-export .eac-gw-table-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0;
    overflow: visible;
}

.eac-gw-export .eac-gw-table {
    min-width: 0;
    width: 100%;
    font-size: 0.72rem;
}

.eac-gw-export .eac-gw-table thead th {
    background-color: #f1f5f9;
    color: #111827;
    border-color: #e5e7eb;
}

.eac-gw-export .eac-gw-table td {
    border-color: #e5e7eb;
}

.eac-gw-export .eac-gw-name-header {
    width: 190px;
}

.eac-gw-export .eac-gw-spec-header {
    width: 52px;
}

.eac-gw-export .eac-gw-day-inner .eac-event-block {
    font-size: 0.62rem;
    padding: 1px 3px;
}

.eac-gw-export .eac-gw-print-shift-label {
    font-weight: 800;
}



/* Late marker (weekly-only) */
.eac-event-late {
    background-color: #b22222;
    color: #ffffff;
}


/* ----------------------------------------------------------
   Mobile view: show a dedicated container & switch to day-focus
---------------------------------------------------------- */

.eac-weekly-mobile { display: none; }

@media (max-width: 768px) {
    .eac-weekly-desktop { display: none; }
    .eac-weekly-mobile { display: block; }

    /* Mobile: FULL-BLEED weekly grid (use the full screen width) */
    .eac-weekly-mobile .eac-gw-table-container {
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;

        /* Break out of theme/content padding so the grid reaches screen edges */
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;

        /* Horizontal scrolling should apply to the grid ONLY (not the toolbar) */
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile: keep enough width so the week doesn't get crushed */
    .eac-weekly-mobile .eac-gw-table {
        min-width: 980px;
    }

    /* Mobile: make the weekly toolbar sticky and full-bleed */
    .eac-weekly-mobile .eac-gw-toolbar {
        position: sticky;
        top: 0;
        z-index: 40;

        /* Override .eac-calendar-toolbar flex row so we can stack rows cleanly */
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        margin-top: 0;
        margin-bottom: 10px;

        width: 100vw;
        max-width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        padding: 10px 12px;

        background: rgba(243, 244, 246, 0.96);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        backdrop-filter: blur(8px);
    }

    .eac-theme-dark .eac-weekly-mobile .eac-gw-toolbar {
        background: rgba(2, 6, 23, 0.94);
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    /* Mobile toolbar layout: nav row + action row */
    .eac-weekly-mobile .eac-gw-toolbar-navrow {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .eac-weekly-mobile .eac-gw-toolbar-actionrow {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 8px;
    }

    .eac-weekly-mobile .eac-gw-toolbar .eac-range-label {
        flex: 1 1 auto;
        text-align: center;
        font-weight: 800;
        line-height: 1.1;
    }

    /* Compact nav buttons (Prev/Next) on mobile */
    .eac-weekly-mobile .eac-gw-nav-icon {
        width: 44px;
        min-width: 44px;
        text-align: center;
        padding: 8px 10px;
        font-size: 1.1rem;
        font-weight: 900;
    }

    /* Mobile: remove the Spec/AFSC column to save space */
    .eac-weekly-mobile .eac-gw-spec-header,
    .eac-weekly-mobile .eac-gw-spec-cell {
        display: none !important;
    }

    /* Mobile: sticky Name column during horizontal scroll */
    .eac-weekly-mobile .eac-gw-name-header,
    .eac-weekly-mobile .eac-gw-name-cell {
        position: sticky;
        left: 0;
        z-index: 8;
        width: 140px;
        min-width: 140px;

        /* Opaque (readable while scrolling) */
        background-color: var(--eac-sticky-name-bg, #f3f4f6) !important;
        opacity: 1 !important;
        background-clip: padding-box;

        /* subtle separation from scrolled content */
        box-shadow: 8px 0 12px rgba(0,0,0,0.08);
    }

    .eac-theme-dark .eac-weekly-mobile .eac-gw-name-header,
    .eac-theme-dark .eac-weekly-mobile .eac-gw-name-cell {
        background-color: var(--eac-sticky-name-bg, #020617) !important;
        box-shadow: 8px 0 12px rgba(0,0,0,0.35);
    }

    /* Mobile: hide First Take Off row entirely */
    .eac-weekly-mobile .eac-gw-takeoff-row {
        display: none !important;
    }
}

/* Mobile day picker (injected by JS) */
.eac-gw-mobile-daypicker {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 2px 10px 2px;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.eac-gw-mobile-daybtn {
    flex: 0 0 auto;
    border: 1px solid rgba(0,0,0,.12);
    background: rgba(255,255,255,.9);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.eac-theme-dark .eac-gw-mobile-daybtn {
    border-color: rgba(255,255,255,.18);
    background: rgba(0,0,0,.25);
}

.eac-gw-mobile-daybtn.eac-gw-mobile-daybtn-active {
    font-weight: 700;
}

/* Hide non-selected day columns in mobile focus mode (JS toggles visibility) */
.eac-gw-mobile-hide {
    display: none !important;
}


/* Two-line event pill (time + title) */
.eac-gw-evt-time {
    font-weight: 700;
    font-size: 0.68rem;
    line-height: 1.05;
}

.eac-gw-evt-title {
    font-weight: 600;
    font-size: 0.68rem;
    line-height: 1.05;
    word-break: break-word;
}


/* Leave end-date (DD-MMM) shown under leave pills in weekly view */
.eac-gw-evt-enddate{
  font-size: 11px;
  line-height: 1.1;
  opacity: 0.85;
  margin-top: 2px;
}
