/* ==========================================================================
   SHARED STYLES — Studio Kann Reisen
   Single source of truth for header, navigation, menus & base variables.
   Used by both index.html (Reisemodus) and admin.html (Planungsmodus).
   ========================================================================== */

/* ---------- Font Loading ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

@font-face {
    font-family: 'PP Editorial New';
    src: local('PP Editorial New Thin Italic'), local('PPEditorialNew-ThinItalic'),
         url('PPEditorialNew-ThinItalic.ttf') format('truetype');
    font-weight: 100;
    font-style: italic;
}

/* ---------- CSS Variables (Light Mode) ---------- */
:root {
    --bg-primary: #F2F1EE;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #EEEDEB;
    --bg-input: #F7F6F4;
    --text-primary: #1A1A1A;
    --text-secondary: #6B6B6B;
    --text-muted: #A0A0A0;
    --accent: #1A1A1A;
    --accent-hover: #333333;
    --accent-subtle: rgba(26, 26, 26, 0.06);
    --success: #34c759;
    --warning: #ff9500;
    --danger: #c88654;
    --border: #E5E4E1;
    --border-strong: #D5D4D1;
    --shadow: none;
    --shadow-lg: none;
    --shadow-panel: none;
    --radius: 16px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-pill: 50px;
    --font-display: 'PP Editorial New', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --bg-card: #FFFFFF;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- CSS Variables (Dark Mode) ---------- */
body.dark {
    --bg-primary: #1c1c1e;
    --bg-secondary: #2c2c2e;
    --bg-tertiary: #3a3a3c;
    --bg-input: #3a3a3c;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-muted: #6e6e73;
    --accent: #E5E4E1;
    --accent-hover: #D5D4D1;
    --accent-subtle: rgba(229, 228, 225, 0.08);
    --success: #30d158;
    --warning: #ff9f0a;
    --danger: #d4976a;
    --border: #3a3a3c;
    --border-strong: #48484a;
    --shadow: none;
    --shadow-lg: none;
    --shadow-panel: none;
    --bg-card: #2c2c2e;
}

/* ---------- Universal Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Header ---------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(242, 241, 238, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: calc(var(--safe-top) + 12px) 20px 12px;
    border-bottom: 0.5px solid var(--border);
    line-height: normal;
}

body.dark .header {
    background: #1c1c1e;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.header-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 100;
    font-style: italic;
    letter-spacing: -0.02em;
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.header-title-row .dropdown-arrow {
    color: var(--text-secondary);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.header-title-row.open .dropdown-arrow {
    transform: rotate(180deg);
}

.header-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---------- Dark Mode Toggle (Flag Emoji) ---------- */
.dark-toggle {
    font-size: 26px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    line-height: 1;
    transition: transform 0.2s ease;
}

.dark-toggle:active {
    transform: scale(0.85);
}

/* ---------- Menu Toggle Button (Hamburger) ---------- */
.menu-toggle {
    background: none;
    border: none;
    padding: 8px;
    margin: -8px;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: var(--border);
}

/* ---------- Trip Menu Dropdown ---------- */
.trip-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    z-index: 200;
    overflow: hidden;
}

.trip-menu.open {
    display: block;
}

.trip-list {
    max-height: 260px;
    overflow-y: auto;
}

.trip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}

.trip-item:hover {
    background: var(--bg-tertiary);
}

.trip-item.active {
    background: var(--accent);
    color: white;
}

.trip-item.active .trip-dates {
    color: rgba(255,255,255,0.8);
}

.trip-flag {
    font-size: 18px;
    font-style: normal;
}

.trip-info {
    flex: 1;
    min-width: 0;
}

.trip-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.trip-dates {
    font-size: 12px;
    color: var(--text-secondary);
}

.trip-divider {
    height: 1px;
    background: var(--border);
}

.trip-new {
    color: var(--accent);
    font-weight: 500;
}

.trip-new svg {
    color: var(--accent);
}

/* ---------- Date Navigation ---------- */
.date-nav-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-nav-row .date-nav {
    flex: 1;
    min-width: 0;
}

.date-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0 8px;
    scroll-behavior: smooth;
}

.date-nav::-webkit-scrollbar {
    display: none;
}

.date-chip {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
}

.date-chip.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.date-chip-day {
    font-size: 10px;
    opacity: 0.7;
    text-transform: uppercase;
}

.date-chip-num {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

/* ---------- Calendar Toggle & Overlay ---------- */
.calendar-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    border-radius: 50%;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.calendar-toggle.open {
    transform: rotate(180deg);
    background: var(--text-primary);
    color: #fff;
    border-color: var(--text-primary);
}

.calendar-overlay {
    display: none;
    padding: 12px 4px 8px;
    animation: calSlideDown 0.2s ease;
}

.calendar-overlay.open {
    display: block;
}

@keyframes calSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-weekday {
    text-align: center;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    padding-bottom: 4px;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    min-height: 42px;
}

.calendar-day:active {
    background: var(--accent-light);
}

.calendar-day.active {
    background: var(--accent);
    color: #fff;
}

.calendar-day-num {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.calendar-day-city {
    font-size: 8px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.calendar-day.active .calendar-day-city {
    color: rgba(255,255,255,0.7);
}

/* ---------- Hamburger Menu Panel ---------- */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: var(--bg-secondary);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    border-left: 1px solid var(--border);
}

.menu-overlay.active .menu-panel {
    transform: translateX(0);
}

.menu-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.menu-logo {
    height: 32px;
    width: auto;
}

body.dark .menu-logo {
    filter: invert(1);
}

.menu-close {
    background: none;
    border: none;
    padding: 8px;
    margin: -8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 24px;
    line-height: 1;
}

.menu-content {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.menu-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.menu-user-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-user-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.menu-user-email {
    font-size: 14px;
    color: var(--text-secondary);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.menu-item:hover {
    background: var(--bg-tertiary);
}

.menu-item-icon {
    width: 24px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-item-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.menu-item-danger {
    color: var(--danger);
}

.menu-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* ---------- Mode Switcher Toggle ---------- */
.mode-switcher {
    display: flex;
    align-items: center;
    margin: 4px 20px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-pill);
    padding: 3px;
    position: relative;
}

.mode-switcher-option {
    flex: 1;
    padding: 8px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s ease;
    border: none;
    background: none;
    font-family: inherit;
}

.mode-switcher-option.active {
    color: #fff;
}

.mode-switcher-pill {
    position: absolute;
    top: 3px;
    bottom: 3px;
    width: calc(50% - 3px);
    background: var(--accent);
    border-radius: var(--radius-pill);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    left: 3px;
}

.mode-switcher-pill.right {
    transform: translateX(100%);
}

