/* --- Reclaim the top bar's space and strip its blue background ------------- */
html.dw-scheduler .topBar {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
    z-index: 1000;
}

/* .topBar::after is a small rounded-corner "joint" (site.css) that normally
   blends .topBar into .second-bar's colour. .second-bar is hidden in
   scheduler mode, so this pseudo-element was rendering as an orphaned solid
   blue square in the top-right corner - it has its own box/background
   independent of .topBar's own (now transparent) background. */
html.dw-scheduler .topBar::after {
    display: none;
}

/* The app logo/reload button steals width from the Scheduler's own month
   label and duplicates navigation the Scheduler's header already provides. */
html.dw-scheduler .topBar-LHS-logo-container {
    display: none;
}

/* Let the centre group's children be positioned individually (so the search bar
   can float) without a layout box of its own. */
html.dw-scheduler .topBar-center {
    display: contents !important;
}

/* Hide the top-bar controls we don't want up top. The refresh button stays in the
   DOM (hidden) so the floating refresh button can still trigger it. */
html.dw-scheduler .topBar-LHS-buttons,
html.dw-scheduler .topBar-toggle-container,
html.dw-scheduler .topBar-dropdown-container,
html.dw-scheduler .topBar-RHS-button-container {
    display: none !important;
}

/* --- Remove the blue frame; the flex shell (round 1) + this file give the
   scheduler the same header/scrolling-region/bottom-bar shape as every other
   screen, instead of a fixed-position full-viewport override. --------------- */
html.dw-scheduler .second-bar {           /* 44px left rail (blue) */
    display: none !important;
}

/* .layout-container just needs to fill whatever space body's flex column
   leaves it (topBar is position:absolute/height:0 above, so this gets
   effectively the full body height) - no explicit vh/fixed sizing needed. */
html.dw-scheduler .layout-container {
    flex: 1;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: hidden;
}

html.dw-scheduler main,
html.dw-scheduler #left-pane,
html.dw-scheduler #right-pane,
html.dw-scheduler #user-grid-container {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #fff !important;
    border: none !important;
}

/* .grid-container wraps <ejs-schedule> and is a direct flex child of
   .main-container, alongside #bottomBar. It keeps its own height:100%
   (unchanged, matches the Schedule control's own height="100%" property) but
   also needs flex:1/min-height:0 so the flex algorithm can size it to leave
   room for #bottomBar instead of the schedule + bar together overflowing the
   viewport (which is what was pushing the bar out of view). */
html.dw-scheduler .grid-container {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #fff !important;
    border: none !important;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;              /* the Schedule control manages its own internal scrolling */
}

/* The Schedule element itself: height:100% inside its now-properly-sized
   flex:1 parent. Not a pixel height, and not a control-property change - this
   selector/value already existed, only its parent's sizing changed above. */
html.dw-scheduler .e-schedule {
    height: 100% !important;
    border: none !important;
}

/* --- Bottom-right floating action buttons (search + refresh) --------------- */
#dwSchedFabs {
    display: none;                        /* hidden unless in scheduler mode */
}
html.dw-scheduler #dwSchedFabs {
    display: flex;
    flex-direction: column;
    gap: 12px;                            /* keeps the two stacked buttons from touching */
    position: fixed;
    right: 16px;
    /* Clear the bar's real height (--dw-bar-height, defined per-platform in
       native-android.css/native-ios.css - already includes the bottom
       reserve) plus its own 16px gap. Was hardcoded as 64px + reserve here,
       which drifted out of sync once the bar's own height formula changed;
       reading the shared token instead avoids repeating that. */
    bottom: calc(16px + var(--dw-bar-height));
    z-index: 1003;
}
/* Search docks at the top instead; the FAB would otherwise sit on top of it. */
html.dw-scheduler.dw-search-open #dwSchedFabs {
    display: none;
}
html.dw-scheduler .dw-sched-fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #29517c;
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
html.dw-scheduler .dw-sched-fab:active {
    background: #1f3f61;
}

/* --- Search: docked full-width beneath the (collapsed) top bar, not floating
   near the bottom. A bottom-anchored search box is always at risk of being
   covered by the keyboard; docking it at the top removes that problem
   entirely instead of trying to reposition it around the keyboard. It is
   relocated in the DOM (native-app.js) to be a flex sibling of the calendar
   region and #bottomBar, so this is normal flex flow - no fixed/absolute
   positioning needed to "float" it above anything. ----------------------- */
html.dw-scheduler .search-bar {
    display: none !important;
}
html.dw-scheduler.dw-search-open .search-bar {
    display: flex !important;
    flex-shrink: 0;                 /* shell sibling: reserves its own row, pushes the calendar down */
    order: -1;                      /* always first, regardless of DOM position */
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px)); /* topBar is collapsed here, so this row sits at the very top */
    background: #fff;
    border-bottom: 0.5px solid rgba(16, 24, 40, 0.08);
    box-shadow: none;               /* not floating, no shadow needed */
    height: auto !important;         /* base sets 32px; let it grow to the field */
    min-width: 0 !important;
    z-index: 1004;
}

html.dw-scheduler.dw-search-open .search-wrapper {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    position: relative;
}

/* Back/close affordance, injected on the left by native-app.js. Closes
   search and restores the FABs (same #dwSchedSearchFab toggle, run in
   reverse). 48x48 tap target, no icon-size change needed since it's a new
   element, not a resized existing one. */
html.dw-scheduler .dw-sched-search-close {
    order: -1;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #29517c;
    font-size: 18px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Text field. 16px font stops iOS from zooming in on focus. */
html.dw-scheduler.dw-search-open .search-input {
    order: 0;
    flex: 1 1 auto !important;
    width: auto !important;
    height: 46px;
    box-sizing: border-box;
    padding: 0 14px !important;
    font-size: 16px !important;
    background: #F1F3F6 !important;   /* beats .e-input.search-input !important */
    color: #222 !important;
    border: 1px solid #d7dbe2 !important;
    border-radius: 10px !important;
    outline: none;
    box-shadow: none !important;
}

/* Clear (×) button between the field and the search button. */
html.dw-scheduler.dw-search-open .clear-icon {
    order: 1;
    position: static !important;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #6b7280;
    font-size: 15px;
    cursor: pointer;
    margin: 0 !important;
}
html.dw-scheduler.dw-search-open .clear-icon:active {
    background: rgba(0, 0, 0, 0.08);
}

/* Primary search button — clearly the control that runs the search. */
html.dw-scheduler.dw-search-open .search-icon {
    order: 2;
    position: static !important;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #29517c;
    color: #fff;
    font-size: 18px;
    border-radius: 10px;
    cursor: pointer;
    margin: 0 !important;
    -webkit-tap-highlight-color: transparent;
}
html.dw-scheduler.dw-search-open .search-icon:active {
    background: #1f3f61;
}
