/* =====================================================
   WeekWise 2.1 - Stylesheet
   ===================================================== */

:root {
    --header-color: #2196F3;
    --contrast: rgb(255, 255, 255);
    --primary: #2196F3;
    --secondary: #FFC107;
    --danger: #f44336;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f5f5f5;
    --border-color: #ddd;
    --shadow: rgba(0, 0, 0, 0.2);
    --shadow-hover: rgba(0, 0, 0, 0.3);
}

/* =====================================================
   Icons
   ===================================================== */

.icon {
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
    display: block;
    width: 24px;
    height: 24px;
    background-color: var(--contrast);
}

.icon.add {
    -webkit-mask-image: url('ico/add.svg');
    mask-image: url('ico/add.svg');
}

.icon.edit {
    -webkit-mask-image: url('ico/edit.svg');
    mask-image: url('ico/edit.svg');
}

.icon.del {
    -webkit-mask-image: url('ico/del.svg');
    mask-image: url('ico/del.svg');
}

.icon.settings {
    -webkit-mask-image: url('ico/settings.svg');
    mask-image: url('ico/settings.svg');
}

.icon.link {
    -webkit-mask-image: url('ico/link.svg');
    mask-image: url('ico/link.svg');
}

.icon.chevron-left {
    -webkit-mask-image: url('ico/chevron-left.svg');
    mask-image: url('ico/chevron-left.svg');
}

.icon.chevron-right {
    -webkit-mask-image: url('ico/chevron-right.svg');
    mask-image: url('ico/chevron-right.svg');
}

.icon.print {
    -webkit-mask-image: url('ico/print.svg');
    mask-image: url('ico/print.svg');
}

.icon.calendar {
    -webkit-mask-image: url('ico/calendar.svg');
    mask-image: url('ico/calendar.svg');
}

.icon.help {
    -webkit-mask-image: url('ico/help.svg');
    mask-image: url('ico/help.svg');
}

/* =====================================================
   Sidebar Styles
   ===================================================== */

.sidebar {
    width: 20%;
    position: fixed;
    top: 0;
    right: 0;
    border: 1px solid var(--text-dark);
    background-color: #fff;
    box-shadow: -5px 0 5px var(--shadow);
    overflow-x: hidden;
    transition: width 0.2s ease;
    padding-top: 76px;
    height: 100%;
    z-index: 50;
}

.sidebar-container {
    display: none;
}

.sidebar-toggle {
    font-size: 20px;
    cursor: pointer;
    background-color: var(--header-color);
    color: var(--contrast);
    padding: 8px 6px;
    border: 1px solid var(--text-dark);
    border-radius: 5px 0 0 5px;
    position: fixed;
    top: 25%;
    z-index: 997;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle .icon {
    width: 20px;
    height: 20px;
}

.closebtn {
    right: 20%;
}

.openbtn {
    right: 0;
    display: none;
}

#main {
    transition: margin-right 0.3s ease;
}

/* =====================================================
   Typography
   ===================================================== */

h1 { font-size: 2em; margin: 10px; }
h2 { font-size: 1.7em; margin: 10px; }
h3 { font-size: 1.5em; margin: 5px; }
h4 { font-size: 1.1em; margin: 5px; font-style: italic; }

/* =====================================================
   Base Layout
   ===================================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 25px;
    background: transparent;
}

/* Embedded Mode - No padding */
body.embedded {
    padding: 0;
}

body.embedded .calendar {
    box-shadow: none;
    border-radius: 0;
}

body.embedded .fab-stack {
    display: none !important;
}

body.embedded .sidebar-container {
    display: none !important;
}

/* Compact Mode - No header */
body.compact .calendar-header {
    display: none;
}

/* Readonly Mode */
body.readonly .booking {
    cursor: default;
}

body.readonly .mobile-booking {
    cursor: default;
}

.calendar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow);
    overflow: hidden;
}

.calendar-header {
    background: var(--header-color);
    color: white;
    padding: 15px;
    text-align: center;
}

/* Scroll wrapper + hint container */
.scroll-wrapper-container {
    position: relative;
}

.desktop-scroll-wrapper {
    overflow-x: visible;
}

.desktop-scroll-wrapper.event-scroll {
    overflow-x: auto;
}

/* Scroll hint: sticky gradient overlay on right edge */
.scroll-hint {
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.85) 50%, white);
    pointer-events: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    font-size: 1.2em;
    color: var(--text-light);
    transition: opacity 0.3s;
    opacity: 0;
}

.scroll-hint.visible {
    opacity: 1;
}

.scroll-hint::after {
    content: '→';
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.weekdays.event-scroll {
    grid-template-columns: repeat(var(--day-count, 7), minmax(120px, 1fr));
}

.weekday {
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

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

/* When event mode has many days, ensure columns don't get too narrow */
.day-columns.event-scroll {
    grid-template-columns: repeat(var(--day-count, 7), minmax(120px, 1fr));
}

.day-column {
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    min-height: 400px;
    height: auto;
}

/* =====================================================
   Bookings - Desktop View
   ===================================================== */

.booking {
    background: var(--secondary);
    border-radius: 4px;
    padding: 8px;
    margin: 2px;
    font-size: 0.85em;
    position: absolute;
    left: 2px;
    box-sizing: border-box;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, z-index 0.2s ease;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 2px 5px var(--shadow);
    overflow: hidden;
    /* Default: full width minus margins */
    width: calc(100% - 4px);
}

/* Overlap handling - dynamically set via JS */
.booking[data-overlap-count="2"] {
    width: calc(50% - 3px);
}

.booking[data-overlap-count="3"] {
    width: calc(33.33% - 3px);
}

.booking[data-overlap-count="4"] {
    width: calc(25% - 3px);
}

/* Overlap positioning - precise rules for each count/index combination */
.booking[data-overlap-count="2"][data-overlap-index="0"] { left: 2px; }
.booking[data-overlap-count="2"][data-overlap-index="1"] { left: calc(50% + 1px); }

.booking[data-overlap-count="3"][data-overlap-index="0"] { left: 2px; }
.booking[data-overlap-count="3"][data-overlap-index="1"] { left: calc(33.33% + 1px); }
.booking[data-overlap-count="3"][data-overlap-index="2"] { left: calc(66.66% + 1px); }

.booking[data-overlap-count="4"][data-overlap-index="0"] { left: 2px; }
.booking[data-overlap-count="4"][data-overlap-index="1"] { left: calc(25% + 1px); }
.booking[data-overlap-count="4"][data-overlap-index="2"] { left: calc(50% + 1px); }
.booking[data-overlap-count="4"][data-overlap-index="3"] { left: calc(75% + 1px); }

.booking:hover {
    z-index: 10;
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.booking.expanded {
    z-index: 20;
    transform: scale(1.05);
    box-shadow: 0 5px 15px var(--shadow-hover);
}

/* Multi-selection highlight */
.booking.selected,
.mobile-booking.selected {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.25);
    z-index: 15;
}

/* Drag & Drop */
.booking.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.day-column.drag-over {
    background: rgba(33, 150, 243, 0.08);
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
}

#Ablage.drag-over {
    background: rgba(33, 150, 243, 0.08);
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
}

#contentSidebar.drag-over {
    background: rgba(33, 150, 243, 0.04);
}

.drag-ghost {
    position: absolute;
    top: -9999px;
    left: -9999px;
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap;
    pointer-events: none;
}

/* Floating copy indicator shown during drag when modifier pressed */
.drag-ghost.drag-ghost-floating {
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    box-shadow: 0 2px 8px var(--shadow);
    animation: ghostFadeIn 0.15s ease;
}

@keyframes ghostFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    cursor: ns-resize;
    background: transparent;
    z-index: 5;
    border-radius: 0 0 4px 4px;
    transition: background 0.15s;
}

.resize-handle:hover,
.booking.resizing .resize-handle {
    background: rgba(0, 0, 0, 0.15);
}

.booking.resizing {
    z-index: 30;
    box-shadow: 0 4px 16px var(--shadow-hover);
    transition: none;
}

.booking-title {
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
}

.booking-time {
    font-size: 0.8em;
    color: var(--text-light);
    margin-top: 2px;
}

.booking-details {
    font-size: 0.8em;
    color: var(--text-light);
    display: none;
}

.booking.expanded .booking-details {
    display: block;
}

.booking-actions {
    display: none;
    margin-top: 8px;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.booking.expanded .booking-actions {
    display: flex;
}

#bookingDescription {
    width: 100%;
}

/* =====================================================
   Action Buttons
   ===================================================== */

.action-button {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    color: white;
}

/* =====================================================
   Context Menu
   ===================================================== */

.context-menu {
    position: fixed;
    z-index: 2000;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.06);
    min-width: 180px;
    padding: 4px 0;
    font-size: 0.88em;
    animation: ctxFadeIn 0.12s ease;
    user-select: none;
}

@keyframes ctxFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-dark);
    transition: background 0.1s;
    position: relative;
}

.context-menu-item:hover {
    background: var(--bg-light);
}

.context-menu-item.danger {
    color: var(--danger);
}

.context-menu-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.context-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.context-menu-item .ctx-icon {
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.9em;
}

.context-menu-item .ctx-label {
    flex: 1;
}

.context-menu-item .ctx-arrow {
    font-size: 0.75em;
    opacity: 0.5;
    margin-left: 12px;
}

/* Submenu */
.context-submenu {
    position: absolute;
    left: 100%;
    top: -4px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.06);
    min-width: 160px;
    padding: 4px 0;
    display: none;
    z-index: 2001;
}

.context-menu-item:hover > .context-submenu {
    display: block;
}

.context-submenu .context-menu-item .ctx-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.context-submenu .context-menu-item .ctx-check {
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.8em;
}

.edit-button {
    background: var(--header-color);
}

.delete-button {
    background: var(--danger);
}

.duplicate-button {
    background: #607D8B;
}

/* =====================================================
   Time Range Row (Form)
   ===================================================== */

.time-range-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.time-select {
    flex: 1;
    min-width: 80px;
}

/* =====================================================
   Floating Action Buttons (vertical flex stack, bottom-right)
   ===================================================== */

.fab-stack {
    position: fixed;
    right: 30px;
    bottom: 30px;
    display: flex;
    flex-direction: column-reverse;
    gap: 14px;
    z-index: 998;
}

.fab {
    background: var(--header-color);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px var(--shadow);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

/* =====================================================
   Print Options Popup
   ===================================================== */

.print-popup {
    position: fixed;
    right: 30px;
    bottom: 100px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px var(--shadow);
    padding: 15px;
    z-index: 999;
    min-width: 220px;
    display: none;
    flex-direction: column;
    gap: 10px;
}

.print-popup.visible {
    display: flex;
}

.print-popup h4 {
    margin: 0 0 5px 0;
    font-style: normal;
}

.print-popup label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9em;
}

.print-popup select {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.print-popup button {
    margin-top: 5px;
}

/* =====================================================
   Day Checkboxes (Settings) – Chip Style
   ===================================================== */

.day-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.day-checkboxes .day-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
    cursor: pointer;
    user-select: none;
    background: var(--bg-light);
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: background 0.15s, border-color 0.15s;
}

.day-checkboxes .day-chip:hover {
    border-color: var(--primary);
}

.day-checkboxes .day-chip input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Inline checkbox label (for hideEmptyDays etc.) */
.form-group .inline-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
}

.form-group .inline-check input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* =====================================================
   Hidden Day Styles
   ===================================================== */

.weekday-hidden {
    opacity: 0.4;
}

.day-column-hidden {
    opacity: 0.3;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 0, 0, 0.03) 10px,
        rgba(0, 0, 0, 0.03) 20px
    );
}

.day-tile-hidden {
    opacity: 0.4;
}

.day-tile-hidden .day-name {
    text-decoration: line-through;
}

/* =====================================================
   Modals
   ===================================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    position: relative;
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px var(--shadow);
    max-height: 90vh;
    overflow-y: auto;
}

/* Settings modal needs more width for day checkboxes */
#optionsModal .modal-content {
    max-width: 520px;
}

/* Settings: tighter form spacing */
#optionsModal .form-group {
    margin-bottom: 12px;
}

#optionsModal .form-group label {
    margin-bottom: 4px;
    font-size: 0.9em;
}

/* Settings Section Dividers */
.settings-section-divider {
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 4px;
    margin: 18px 0 10px;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 16px;
}

.mode-option {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    font-weight: normal !important;
    cursor: pointer;
    user-select: none;
}

.mode-option input[type="radio"] {
    width: auto;
    margin: 0;
}

/* Event Mode Preview */
.event-day-preview {
    font-size: 0.85em;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 8px 10px;
    border-radius: 4px;
    line-height: 1.5;
    word-break: break-word;
}

/* Event Mode Date/Count Inputs */
#eventStartDate,
#eventDayCount {
    max-width: 200px;
}

/* =====================================================
   ICS Modal
   ===================================================== */

#icsModal .modal-content {
    max-width: 520px;
}

.ics-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.ics-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
    cursor: pointer;
    user-select: none;
    background: var(--bg-light);
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: background 0.15s, border-color 0.15s;
}

.ics-chip:hover {
    border-color: var(--primary);
}

.ics-chip input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.ics-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.ics-link-row input[type="text"] {
    flex: 1;
    font-family: monospace;
    font-size: 0.82em;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-light);
    color: var(--text-dark);
}

.ics-link-row button {
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: 0.85em;
}

.ics-counter {
    font-size: 0.82em;
    color: var(--text-light);
    margin: 8px 0 4px;
}

.ics-section-divider {
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 4px;
    margin: 14px 0 10px;
}

.ics-token-info {
    font-size: 0.82em;
    color: var(--text-light);
    margin-top: 4px;
}

/* =====================================================
   Help Modal
   ===================================================== */

.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
    margin-bottom: 8px;
}

.help-table td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--bg-light);
    vertical-align: top;
}

.help-table td:first-child {
    white-space: nowrap;
    font-weight: 500;
    width: 45%;
}

.help-table kbd {
    display: inline-block;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.88em;
    font-family: inherit;
    line-height: 1.4;
}

.help-table code {
    background: var(--bg-light);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.88em;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.fab:focus-visible {
    outline: 2px solid var(--text-dark);
    outline-offset: 2px;
}

.booking:focus-visible,
.mobile-booking:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.cancel-button {
    background: #999;
    margin-left: 10px;
}

.danger-button {
    background: var(--danger);
}

/* =====================================================
   Time Markers
   ===================================================== */

.time-markers {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.time-marker {
    position: absolute;
    width: 100%;
    border-top: 1px dashed var(--border-color);
    font-size: 0.7em;
    color: #999;
    padding-left: 5px;
}

/* =====================================================
   Color Picker
   ===================================================== */

.color-picker {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.color-option.selected,
.color-option:hover {
    border-color: var(--text-dark);
}

.color-edit {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.color-swatch {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.color-delete {
    background-color: var(--danger);
    cursor: pointer;
}

.category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--bg-light);
    color: var(--text-light);
    font-size: 0.78em;
    font-weight: 600;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.header-color-edit input,
.secondary-color-edit input {
    background: var(--bg-light);
    cursor: not-allowed;
}

/* =====================================================
   View Booking Modal
   ===================================================== */

.view-booking-header {
    background: var(--secondary);
    color: white;
    padding: 15px;
    margin: -20px -20px 20px -20px;
    border-radius: 8px 8px 0 0;
    position: relative;
    padding-bottom: 40px;
    text-align: center;
}

.trainer-tags {
    position: absolute;
    bottom: 10px;
    right: 10px;
    margin: 0;
    text-align: right;
}

.trainer-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    margin: 2px;
    font-size: 0.9em;
}

.description-box {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.contact-info {
    margin: 15px 0;
    color: var(--text-light);
}

.link-button {
    background: var(--primary);
    color: white;
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s;
}

.link-button:hover {
    transform: scale(1.1);
}

#viewBookingLink {
    position: absolute;
    bottom: 20px;
    right: 20px;
}

/* =====================================================
   Mobile View - Day Tiles
   ===================================================== */

.day-tiles {
    margin: 10px;
    flex-direction: column;
    display: none;
}

.day-tile {
    margin-bottom: 10px;
}

.day-name {
    background: var(--bg-light);
    color: var(--text-dark);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    margin: 5px;
}

.filing-tile {
    background-color: var(--danger);
    color: white;
}

.ablage-tile {
    display: none;
}

.day-bookings {
    margin-top: 5px;
}

.mobile-booking {
    background: var(--secondary);
    padding: 12px;
    border-radius: 8px;
    margin: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.mobile-booking:active {
    transform: scale(0.98);
}

.mobile-booking-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.mobile-booking-time {
    font-size: 0.85em;
    color: var(--text-light);
}

.mobile-booking-actions {
    display: none;
    margin-top: 10px;
    gap: 8px;
}

.mobile-booking.expanded .mobile-booking-actions {
    display: flex;
}

/* =====================================================
   Loading Indicator
   ===================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   Tooltip
   ===================================================== */

.booking-tooltip {
    position: absolute;
    background: var(--text-dark);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.booking-tooltip.visible {
    opacity: 1;
}

/* =====================================================
   Responsive Breakpoints
   ===================================================== */

/* Large Desktop */
@media (min-width: 1200px) {
    .booking-title {
        font-size: 0.9em;
    }
}

/* Desktop */
@media (min-width: 826px) {
    .day-tiles {
        display: none;
    }
    
    .weekdays,
    .day-columns {
        display: grid;
    }
}

/* Tablet */
@media (max-width: 1200px) {
    .booking .delete-button {
        display: none;
    }
    
    .booking-title {
        font-size: 0.8em;
    }
}

@media (max-width: 900px) {
    .booking-time {
        font-size: 0.7em;
    }
}

/* Mobile */
@media (max-width: 825px) {
    body {
        padding: 10px;
    }
    
    .weekdays,
    .day-columns {
        display: none;
    }
    
    .day-tiles {
        display: flex;
    }
    
    .sidebar-container {
        display: none !important;
    }
    
    .calendar {
        margin-right: 0 !important;
    }
    
    .fab-stack {
        right: 20px;
        bottom: 20px;
        gap: 10px;
    }
    
    .fab {
        display: flex;
    }
    
    .modal-content {
        max-width: 100%;
        margin: 10px;
    }
    
    .ablage-tile {
        display: block;
        margin-top: 10px;
    }
    
    .delete-button {
        display: inline-block;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .calendar-header h2 {
        font-size: 1.3em;
    }
    
    .mobile-booking {
        padding: 10px;
    }
    
    .fab {
        width: 50px;
        height: 50px;
    }
    
    .fab .icon {
        width: 20px;
        height: 20px;
    }
    
    .fab-stack {
        gap: 8px;
    }
}

/* =====================================================
   Auto Text Color Based on Background
   ===================================================== */

.booking.light-bg .booking-title,
.booking.light-bg .booking-time {
    color: var(--text-dark);
}

.booking.dark-bg .booking-title,
.booking.dark-bg .booking-time {
    color: white;
}

.mobile-booking.light-bg .mobile-booking-title,
.mobile-booking.light-bg .mobile-booking-time {
    color: var(--text-dark);
}

.mobile-booking.dark-bg .mobile-booking-title,
.mobile-booking.dark-bg .mobile-booking-time {
    color: white;
}

/* =====================================================
   Print Styles
   ===================================================== */

@media print {
    @page {
        margin: 10mm;
    }
    
    body {
        padding: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .fab-stack,
    .sidebar-container,
    .booking-actions,
    .mobile-booking-actions,
    .print-popup,
    .modal,
    .context-menu {
        display: none !important;
    }
    
    /* Always show desktop grid when printing */
    .day-tiles {
        display: none !important;
    }
    
    .weekdays,
    .day-columns {
        display: grid !important;
        overflow-x: visible;
    }

    .desktop-scroll-wrapper {
        overflow: visible !important;
    }
    
    .scroll-hint {
        display: none !important;
    }
    
    .calendar {
        box-shadow: none;
        margin-right: 0 !important;
        overflow: visible;
    }
    
    .day-column {
        overflow: visible;
        max-width: 280px;
    }
    
    /* Hide greyed-out columns in print */
    .day-column-hidden,
    .weekday-hidden {
        display: none !important;
    }
    
    /* Print option: no header */
    body.print-no-header .calendar-header {
        display: none !important;
    }
    
    /* Print option: no colors */
    body.print-no-colors .booking {
        background: white !important;
        border: 1px solid #333 !important;
    }
    
    body.print-no-colors .booking-title,
    body.print-no-colors .booking-time {
        color: #333 !important;
    }
    
    body.print-no-colors .calendar-header {
        background: #333 !important;
    }
    
    /* Print option: category filter */
    .booking.print-hidden {
        display: none !important;
    }
    
    /* Booking text legibility */
    .booking-title {
        font-size: 0.75em;
    }
    
    .booking-time {
        font-size: 0.65em;
    }
    
    /* Auto-scale: fit day columns to page height */
    .day-columns {
        max-height: calc(100vh - 60px);
    }
    
    .day-column {
        height: auto !important;
        min-height: 0 !important;
    }
    
    /* Portrait: narrower max-width per column */
    body.print-portrait .day-column {
        max-width: 200px;
    }
}
