/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.site-logo {
    position: fixed;   /* stays in the same spot when scrolling */
    top: 10px;         /* distance from top of page */
    left: 10px;        /* distance from left edge */
    z-index: 1050;     /* above header (Bootstrap headers are ~1030) */
    transition: opacity 0.5s ease; /* smooth fade */
}

.site-logo img {
    height: 100px;      /* adjust size as needed */
    width: auto;
}

.site-logo.fade-out {
    opacity: 0;
    pointer-events: none; /* optional: avoids blocking clicks */
}

/* Hide the floating logo on phone-width screens; show only on
   larger (desktop/tablet) viewports. 768px matches Bootstrap's md breakpoint. */
@media (max-width: 767.98px) {
    .site-logo {
        display: none;
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

/* Default (production) */
header.env-production {
    background-color: var(--bs-primary);
}

/* Staging: orange/yellow */
header.env-staging {
    background-color: var(--bs-warning);
    color: #000; /* improve contrast on yellow */
}

/* Development: blue-gray */
header.env-development {
    background-color: var(--bs-info);
}

header .title {
    font-size: 1.25rem;
    font-weight: bold;
}

header nav a {
    margin-left: 1rem;
    text-decoration: none;
    color: #333;
}

/* Plain links in the header (e.g. the signed-in user's name) inherit the
   header's per-environment text color so they stay legible on every
   deployment's background — white on production/development, black on staging.
   Buttons keep their own Bootstrap styles. */
header a:not(.btn) {
    color: inherit;
}

header a:not(.btn):hover,
header a:not(.btn):focus {
    color: inherit;
    text-decoration: underline;
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    header nav {
        margin-top: 0.5rem;
    }
}

/* Overlay the stamp on a card */
.stamp-overlay {
    position: absolute;
    top: .5rem;
    right: .5rem;
    width: 9rem;              /* tweak size as needed */
    transform: rotate(-10deg);
    opacity: 0.9;
    mix-blend-mode: multiply; /* helps the red “sink into” the card */
    pointer-events: none;     /* don't block clicks on the card */
    z-index: 2;
}

.legend-card { position: relative; }
.legend-card .card-legend {
    position: absolute;
    top: 0; left: 1rem;              /* align with card-body padding */
    transform: translateY(-50%);     /* sit on the border line */
    background-color: var(--bs-card-bg);
    padding: 0 .5rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    line-height: 1;
}

/* Make inline SVGs inside a ratio box scale nicely */
.ratio svg { width: 100%; height: 100%; display: block; }

/* ---- Stay calendar (month-style multi-day bars) ---- */

/* Horizontal scroll so the 7-column grid stays readable on phones. */
.cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal { min-width: 720px; }

.cal-weekdays,
.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-weekday {
    padding: .25rem .5rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    border-bottom: 1px solid #dee2e6;
}

.cal-week {
    position: relative;
    --lane-height: 1.6rem;
    --header-height: 1.6rem;
}

.cal-day {
    min-height: calc(var(--header-height) + (var(--lanes, 0) * var(--lane-height)) + .4rem);
    padding: .2rem .35rem;
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
}
.cal-day:first-child { border-left: 1px solid #e9ecef; }
.cal-day.is-today { background: #fff8e1; }
/* Padding days that fill out the first/last week, beyond the requested range. */
.cal-day.is-outside { background: #f6f7f8; }
.cal-day.is-outside .cal-daynum { opacity: .5; }

.cal-daynum {
    font-size: .8rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

/* Bars float above the day cells, below the day numbers. */
.cal-bars {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: .2rem;
    pointer-events: none;
}

.cal-bar {
    position: absolute;
    height: calc(var(--lane-height) - .25rem);
    display: flex;
    align-items: center;
    padding: 0 .4rem;
    border-radius: .35rem;
    color: #fff;
    font-size: .75rem;
    line-height: 1;
    text-decoration: none;
    overflow: hidden;
    pointer-events: auto;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .15);
}
.cal-bar:hover { color: #fff; filter: brightness(1.08); }

.cal-bar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Flatten the edge of a bar that runs into an adjacent week. */
.cal-bar.continues-left  { border-top-left-radius: 0;  border-bottom-left-radius: 0; }
.cal-bar.continues-right { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* Color carries the stay's state (see AbodesHelper::STAY_BAR_COLORS); a hold is
   tentative, so it reads lighter via a dashed outline. */
.cal-bar.state-hold { border: 1px dashed rgba(255, 255, 255, .85); }

.cal-legend-swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: .2rem;
}
.cal-legend-open {
    background: #f1f3f5;
    border: 1px solid #ced4da;
}

/* --- Availability grid (abode rows × day columns) --- */
.cal-avail {
    min-width: 720px;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
    border-radius: .35rem;
    overflow: hidden;
}

.cal-avail-row {
    display: grid;
    grid-template-columns: minmax(8rem, 1.4fr) repeat(var(--avail-cols, 7), 1fr);
}
.cal-avail-row + .cal-avail-row { border-top: 1px solid #e9ecef; }

.cal-avail-head { background: #f8f9fa; }

.cal-avail-label {
    padding: .3rem .5rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    border-right: 1px solid #e9ecef;
    display: flex;
    align-items: center;
}

.cal-avail-dayhead {
    padding: .25rem .35rem;
    text-align: center;
    border-left: 1px solid #e9ecef;
    line-height: 1.1;
}
.cal-avail-dayhead.is-today { background: #fff8e1; }
.cal-avail-dayhead.is-outside { background: #f6f7f8; color: var(--bs-secondary-color); }
.cal-avail-dow {
    display: block;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}
.cal-avail-dom { font-size: .8rem; }

.cal-cell {
    min-height: 2rem;
    border-left: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    text-decoration: none;
    color: #fff;
}
.cal-cell.is-outside { opacity: .55; }

.cal-cell.is-open {
    background: #f1f3f5;
    color: #adb5bd;
}
.cal-cell.is-open:hover {
    background: #e2e6ea;
    color: #198754;
}

.cal-cell.is-reserved { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.cal-cell.is-reserved:hover { filter: brightness(1.08); }
.cal-cell.is-reserved.is-muted {
    background: repeating-linear-gradient(45deg, #e9ecef, #e9ecef 4px, #f1f3f5 4px, #f1f3f5 8px);
    cursor: default;
}

.cal-cell-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 .25rem;
}
