:root {
    --color-primary: #4998B0;
    --color-accent: #4998B0;
}

.page-container {
    position: relative;
    min-height: 100dvh;
    padding-bottom: 4rem;
    margin-bottom: 4rem;
}

.ts-control {
    z-index: 0;
}

/* Ensure native select elements are readable on mobile */
select {
    font-size: 16px;
}
select option {
    font-size: 16px;
}

/* ------------------------------------------------------------------------------------------------------------------ */
/* Tooltip */
/* ------------------------------------------------------------------------------------------------------------------ */
/* Tooltip container */
.tooltip {
    position: relative;
    display: inline-block;
}

/* Tooltip text */
.tooltip .tooltiptext {
    visibility: hidden;
    width: 300px;
    color: #fff;
    text-align: center;
    padding: 0.25rem 0.5rem;
    right: 32%;
    bottom: 46%;
    margin-left: -150px; /* Use half of the width (150/2 = 75), to center the tooltip */
    /* Position the tooltip text - see examples below! */
    position: absolute;
    z-index: 100;
    font-size: 12px ;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
    visibility: visible;
}

[data-tooltip]:hover::after {
    display: block;
    position: absolute;
    content: attr(data-tooltip);
    border: 1px solid black;
    background: #eee;
    padding: .25em;
    max-width: 400px;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* ------------------------------------------------------------------------------------------------------------------ */
/* Navigation Modal */
/* ------------------------------------------------------------------------------------------------------------------ */
.navigation-modal-button {
    text-decoration: inherit;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    border-radius: 0.5rem;
    padding: 15px;
    line-height: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    background-color: white;
    border: 2px solid var(--color-primary)
}

.navigation-modal-button.nav-active {
    background-color: color-mix(in srgb, var(--color-primary) 8%, white);
    border-left: 4px solid var(--color-primary);
    font-weight: 700;
}

/* ============================================================
   Gantt Month Overview
   ============================================================ */

.gantt-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    white-space: nowrap;
    font-size: 0; /* eliminate whitespace between inline-block month segments */
}

.gantt-timeline-wrapper {
    display: flex;
    flex-direction: row;
}

.gantt-fixed-units {
    flex-shrink: 0;
    width: 8rem;
    z-index: 20;
    background: #fafafa;
    border-right: 1px solid #e5e7eb;
    position: sticky;
    left: 0;
}

.gantt-unit-header-cell {
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #d1d5db;
    box-sizing: border-box;
}

.gantt-unit-label {
    display: flex;
    align-items: center;
    padding: 0 0.625rem;
    box-sizing: border-box;
    box-shadow: 0 1px 0 0 #d1d5db;
    white-space: nowrap;
    overflow: hidden;
}

.gantt-unit-label a {
    color: #374151;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-unit-label a:hover {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gantt-month-segment {
    display: inline-block;
    vertical-align: top;
    font-size: 0.75rem; /* restore font size (parent has font-size: 0 to kill whitespace) */
}

.gantt-unit-row {
    border-bottom: none;
    padding-top: 0;
    padding-bottom: 0;
    box-shadow: 0 1px 0 0 #d1d5db;
    position: relative;
    z-index: 0;
}

.gantt-drop-target {
    background-color: rgba(99, 102, 241, 0.25) !important;
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.6);
    z-index: 5 !important;
    position: relative;
}

.gantt-unit-row > .gantt-bar,
.gantt-unit-row > a.gantt-bar {
    min-height: 0;
    height: 1.375rem;
    line-height: 1.375rem;
    overflow: hidden;
    margin-top: 2px;
    margin-bottom: 2px;
}

.gantt-grid {
    display: grid;
    position: relative;
    align-items: stretch;
    min-height: 2.5rem;
    /* Fixed cell width for infinite scroll mode: 2.5rem */
}

.gantt-header-unit,
.gantt-unit-name {
    position: sticky;
    left: 0;
    z-index: 20;
    background: #eef2ff;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e0e7ff;
    border-right: 1px solid #e0e7ff;
    min-width: 8rem;
    max-width: 8rem;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

.gantt-header-unit {
    white-space: nowrap;
}

.gantt-header-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0.25rem 0;
    border-bottom: 1px solid #e0e7ff;
    font-size: 0.75rem;
}

.gantt-cw {
    font-size: 0.625rem;
    color: #818cf8;
    margin-bottom: 0.125rem;
}

.gantt-weekday {
    font-size: 0.6875rem;
    color: #6b7280;
}

.gantt-day-num {
    font-size: 0.75rem;
    color: #7c3aed;
    padding: 0.125rem 0.375rem;
}

.gantt-day-today {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.gantt-cell {
    min-height: 2.5rem;
}

.gantt-today-bg {
    background-color: rgba(99, 102, 241, 0.06);
}

/* Today column vertical line — drawn by JS as an absolutely positioned overlay */
.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2.5rem; /* matches grid column width */
    border-left: 1px solid rgba(99, 102, 241, 0.18);
    border-right: 1px solid rgba(99, 102, 241, 0.18);
    pointer-events: none;
    z-index: 10;
}

/* Row wrapper with horizontal separator */
.gantt-row-wrapper {
    position: relative;
    border-bottom: 1px solid #e5e7eb;
}

/* Lines overlay — absolutely positioned OVER the grid, pointer-events pass through */
.gantt-lines-overlay {
    display: grid;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    pointer-events: none;
}

.gantt-line {
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.gantt-line-today {
    border-right: 2px solid rgba(99, 102, 241, 0.35);
    border-left: 2px solid rgba(99, 102, 241, 0.35);
    background-color: rgba(99, 102, 241, 0.04);
}

/* Gantt bar base */
.gantt-bar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.625rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    cursor: pointer;
    margin: 0.1875rem 0.125rem;
    min-height: 1.25rem;
}

.gantt-bar:hover {
    filter: brightness(0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Status colors — flat, no gradients */
.gantt-status-completed {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.gantt-status-pending {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.gantt-status-new {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
}

/* Clipped start — continuation from previous month: flat left edge, no border, hide name */
.gantt-clipped-start {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    margin-left: 0;
}
.gantt-clipped-start > span.truncate,
.gantt-clipped-start > span.gantt-guest-count {
    visibility: hidden;
}

/* Clipped end — continues into next month: flat right edge, no border */
.gantt-clipped-end {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    margin-right: 0;
}

/* Guest count badge */
.gantt-guest-count {
    display: inline-flex;
    align-items: center;
    align-self: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.5625rem;
    font-weight: 700;
    margin-left: 0.25rem;
    flex-shrink: 0;
    line-height: 1;
}

/* Drag-and-drop styles for month overview */
.gantt-bar-dragging { opacity: 0.5; border: 2px dashed #9CA3AF; }
.gantt-drop-valid { background-color: #F0FDF4; border: 2px solid #86EFAC; }
.gantt-drop-swap { background-color: #EFF6FF; border: 2px solid #93C5FD; }
.gantt-drop-invalid { background-color: #FEF2F2; cursor: not-allowed; }
.gantt-bar-loading { animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.gantt-bar[draggable="true"] { cursor: grab; }
.gantt-bar[draggable="true"]:active { cursor: grabbing; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Drag-and-drop styles for month overview calendar */
.gantt-bar-dragging { opacity: 0.5; border: 2px dashed #9CA3AF; }
.gantt-drop-valid { background-color: rgba(134, 239, 172, 0.3); outline: 2px solid #86EFAC; outline-offset: -2px; }
.gantt-drop-swap { background-color: rgba(147, 197, 253, 0.3); outline: 2px solid #93C5FD; outline-offset: -2px; }
.gantt-drop-invalid { background-color: rgba(252, 165, 165, 0.2); cursor: not-allowed; }
.gantt-bar-loading { animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.gantt-bar[draggable="true"] { cursor: grab; }
.gantt-bar[draggable="true"]:active { cursor: grabbing; }

/* Infinite Scroll Calendar — merged into main gantt-scroll-container above */

.gantt-header-label {
    position: sticky;
    top: 0;
    z-index: 30;
}

.gantt-loading-indicator {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 50;
}

.gantt-error-toast {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    z-index: 50;
}
.gantt-dragging-active .gantt-cell {
    z-index: 10;
    position: relative;
}
/* Show a ghost preview spanning multiple cells */
.gantt-drop-preview {
    position: absolute;
    top: 0;
    bottom: 0;
    background-color: rgba(73, 152, 176, 0.15);
    border: 2px dashed rgba(73, 152, 176, 0.5);
    border-radius: 0.375rem;
    pointer-events: none;
    z-index: 9;
    transition: opacity 0.15s ease;
}

/* Documentation prose styles (replaces @tailwindcss/typography) */
.doc-prose h1 { font-size: 1.875rem; font-weight: 700; margin-top: 2rem; margin-bottom: 0.75rem; color: #111827; line-height: 1.3; }
.doc-prose h2 { font-size: 1.5rem; font-weight: 600; margin-top: 1.75rem; margin-bottom: 0.5rem; color: #1f2937; line-height: 1.35; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.4rem; }
.doc-prose h3 { font-size: 1.25rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; color: #374151; line-height: 1.4; }
.doc-prose h4 { font-size: 1.1rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.4rem; color: #374151; }
.doc-prose p { margin-top: 0.75rem; margin-bottom: 0.75rem; line-height: 1.7; color: #374151; }
.doc-prose ul { list-style-type: disc; padding-left: 1.5rem; margin-top: 0.5rem; margin-bottom: 0.75rem; }
.doc-prose ol { list-style-type: decimal; padding-left: 1.5rem; margin-top: 0.5rem; margin-bottom: 0.75rem; }
.doc-prose li { margin-top: 0.25rem; margin-bottom: 0.25rem; line-height: 1.6; color: #374151; }
.doc-prose li > ul, .doc-prose li > ol { margin-top: 0.25rem; margin-bottom: 0.25rem; }
.doc-prose a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
.doc-prose a:hover { opacity: 0.8; }
.doc-prose strong { font-weight: 600; color: #111827; }
.doc-prose em { font-style: italic; }
.doc-prose code { background: #f3f4f6; padding: 0.15rem 0.35rem; border-radius: 0.25rem; font-size: 0.875rem; color: #dc2626; }
.doc-prose pre { background: #1f2937; color: #e5e7eb; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin-top: 1rem; margin-bottom: 1rem; font-size: 0.875rem; line-height: 1.6; }
.doc-prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.doc-prose blockquote { border-left: 3px solid var(--color-primary); padding-left: 1rem; margin-top: 1rem; margin-bottom: 1rem; color: #6b7280; font-style: italic; }
.doc-prose hr { border: none; border-top: 1px solid #e5e7eb; margin: 1.5rem 0; }
.doc-prose table { width: 100%; border-collapse: collapse; margin-top: 1rem; margin-bottom: 1rem; font-size: 0.875rem; }
.doc-prose th { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 2px solid #e5e7eb; font-weight: 600; color: #374151; }
.doc-prose td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #f3f4f6; color: #4b5563; }

/* Occupancy Heatmap */
.heatmap-vacant { background-color: #f1f5f9; } /* slate-100 */
.heatmap-partial { background-color: #fcd34d; } /* amber-300 */
.heatmap-full { background-color: #ef4444; } /* red-500 */
