@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Lato:wght@300;400;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* === DARK MODE (Default, wie das Firmenschild) === */
body {
    background-color: #000000;
    color: #e0e0e0;
    font-family: 'Lato', sans-serif;
    margin: 0;
    padding: 5px 15px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

.top-bar-left {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.list-toggle-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    font-size: 14px;
    font-family: 'Archivo Black', sans-serif;
    border-radius: 8px;
    height: 48px;
    padding: 0 16px;
    cursor: pointer;
    color: #fff;
    transition: background 0.3s;
}

.list-toggle-btn:active {
    background: #333;
}

.top-bar {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: flex-end;
    justify-content: flex-end;
    -webkit-align-items: center;
    align-items: center;
    padding: 10px 10px 0 10px;
}

.top-btn {
    background: transparent;
    border: 1px solid #444;
    font-size: 20px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    border-radius: 12px;
    width: 60px;
    height: 60px;
    cursor: pointer;
    color: #fff;
    margin-right: 12px;
    transition: background 0.3s;
}

.top-btn:active {
    background: #333;
}

.theme-toggle {
    background: transparent;
    border: 1px solid #444;
    font-size: 28px;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    color: #fff;
    transition: background 0.3s;
}

.theme-toggle:active {
    background: #333;
}

.zoom-container {
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 15px;
    margin-top: 0px;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    border: 2px solid #888;
    padding: 5px 20px;
    border-radius: 4px;
    background: #111;
}

@-webkit-keyframes flyAnimation {
    0%   { -webkit-transform: translateY(0px) scale(1); }
    50%  { -webkit-transform: translateY(-8px) scale(1.02); }
    100% { -webkit-transform: translateY(0px) scale(1); }
}
@keyframes flyAnimation {
    0%   { transform: translateY(0px) scale(1); }
    50%  { transform: translateY(-8px) scale(1.02); }
    100% { transform: translateY(0px) scale(1); }
}

.header-logo {
    height: 75px;
    max-width: 100%;
    width: auto;
    margin-bottom: 0px;
    margin-right: 20px;
    -webkit-filter: grayscale(100%) contrast(500%);
    filter: grayscale(100%) contrast(500%);
    mix-blend-mode: lighten;
    -webkit-animation: flyAnimation 3.5s ease-in-out infinite;
    animation: flyAnimation 3.5s ease-in-out infinite;
}

.header h1 {
    font-family: 'Archivo Black', sans-serif;
    font-size: 58px;
    color: #ffffff;
    letter-spacing: 1px;
    margin-bottom: 5px;
    font-weight: 400;
    text-transform: uppercase;
}

.header .subtitle {
    font-size: 22px;
    color: #aaaaaa;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.loading {
    text-align: center;
    margin-top: 100px;
    color: #fff;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    -webkit-animation: spin 1s ease-in-out infinite;
    margin: 0 auto 20px auto;
}

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

.error-message {
    background-color: rgba(255, 60, 60, 0.1);
    border: 1px solid rgba(255, 60, 60, 0.4);
    color: #ff6b6b;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 40px auto;
    max-width: 600px;
}

.price-list {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    max-width: 768px;
    margin: 0 auto;
}

.category-wrapper {
    width: 100%;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
}

.category-header {
    width: 100%;
    font-family: 'Archivo Black', sans-serif;
    font-size: 18px;
    color: #ffffff;
    border-bottom: 1px solid #555;
    padding-bottom: 4px;
    margin-top: 15px;
    margin-bottom: 8px;
}

/* === Spalten-Layout (dynamisch per JS) === */
.price-item {
    width: 50%;                         /* Fallback, wird per JS überschrieben */
    background: transparent;
    padding: 5px 12px;
    border-radius: 0;
    margin-bottom: 0;
    border-bottom: 1px solid #222;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-justify-content: center;
    justify-content: center;
    min-height: 42px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.price-item-header {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-items: center;
    align-items: center;
}

.item-name {
    font-size: 13px;
    font-weight: 400;
    color: #cccccc;
    -webkit-flex: 1;
    flex: 1;
    padding-right: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.item-price {
    font-size: 14px;
    font-family: 'Archivo Black', sans-serif;
    color: #ffffff;
    white-space: nowrap;
}

.item-price-details {
    font-size: 9px;
    color: #666666;
    margin-top: 0px;
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    white-space: nowrap;
    line-height: 1.2;
    text-align: right;
}

.item-name-block {
    -webkit-flex: 1;
    flex: 1;
    overflow: hidden;
    padding-right: 8px;
}

.item-name-block .item-name {
    padding-right: 0;
}

.item-footnotes {
    font-size: 10px;
    color: #888;
    margin-top: 1px;
    font-style: italic;
}

/* Inhaltsstoffe-Legende */
.inhaltsstoffe-legende {
    width: 100%;
    margin-top: 20px;
    padding: 12px 16px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #0a0a0a;
    box-sizing: border-box;
}

.legende-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: 16px;
    color: #ffffff;
    letter-spacing: 1px;
    margin-bottom: 8px;
    border-bottom: 1px solid #555;
    padding-bottom: 6px;
    text-align: center;
}

.legende-list {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-justify-content: center;
    justify-content: center;
}

.legende-entry {
    font-size: 12px;
    color: #aaa;
    margin-right: 16px;
    margin-bottom: 4px;
    white-space: nowrap;
}

.legende-entry sup {
    font-weight: 700;
    color: #ccc;
    font-size: 10px;
}

.price-container {
    min-width: 60px;
    text-align: right;
}

.item-desc {
    font-size: 16px;
    color: #aaaaaa;
    line-height: 1.5;
}

.demo-notice {
    text-align: center;
    color: #888;
    width: 100%;
    margin-top: 40px;
    font-size: 14px;
}


/* === TRANSPORT WIDGET === */

.transport-widget {
    width: 100%;
    max-width: 768px;
    margin: 20px auto 0 auto;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background: #0a0a0a;
}

.tw-header {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-items: center;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #222;
    background: #111;
}

.tw-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: 16px;
    color: #fff;
}

.tw-controls {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    /* gap: 6px → iOS 9 fix: use margin on children */
}

.tw-filter-btn {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
    padding: 3px 10px;
    cursor: pointer;
    margin-left: 6px;         /* gap-Ersatz */
    min-height: 28px;         /* touch target */
}

.tw-body {
    display: -webkit-flex;
    display: flex;
}

.tw-stops-col {
    width: 240px;
    min-width: 240px;
    border-right: 1px solid #222;
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tw-dep-col {
    -webkit-flex: 1;
    flex: 1;
    padding: 8px;
    max-height: 600px;              /* 2h Abfahrten brauchen Platz */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tw-section-title {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 6px;
    margin-top: 8px;
    letter-spacing: 1px;
}

.tw-stop-row {
    display: -webkit-flex;
    display: flex;
    /* gap: 4px → margin-right on child */
    margin-bottom: 4px;
}

.tw-stop-btn {
    -webkit-flex: 1;
    flex: 1;
    text-align: left;
    padding: 8px 10px;        /* larger touch target */
    border-radius: 6px;
    border: 1px solid #333;
    background: #111;
    color: #ccc;
    cursor: pointer;
    font-size: 13px;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    min-width: 0;
    margin-right: 4px;        /* gap-Ersatz */
    min-height: 42px;         /* touch target */
}

.tw-stop-btn.active {
    border-color: #0065bd;
    background: rgba(0, 101, 189, 0.15);
}

.tw-stop-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    -webkit-flex: 1;
    flex: 1;
}

.tw-star {
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.tw-star.filled {
    color: #ffc107;
}

.tw-dist {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    display: block;
}

.tw-del-btn {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #111;
    color: #e74c3c;
    cursor: pointer;
    font-size: 13px;
}

.tw-dep-list {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    /* gap: 4px → margin-bottom on items */
}

.tw-dep-item {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    padding: 8px;             /* touch target */
    background: #111;
    border: 1px solid #222;
    border-radius: 6px;
    margin-bottom: 4px;       /* gap-Ersatz */
}

.tw-line-badge {
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    min-width: 36px;
    text-align: center;
    margin-right: 10px;       /* gap-Ersatz */
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.tw-dep-info {
    -webkit-flex: 1;
    flex: 1;
    overflow: hidden;
}

.tw-dep-dest {
    font-size: 14px;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.tw-dep-time {
    text-align: right;
    white-space: nowrap;
}

.tw-dep-time-val {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.tw-delay {
    font-size: 11px;
    color: #e74c3c;
    font-weight: 700;
    margin-left: 4px;
}

.tw-empty {
    color: #666;
    font-size: 13px;
    padding: 16px;
    text-align: center;
}

/* === WEATHER WIDGET === */
.weather-widget {
    width: 100%;
    max-width: 768px;
    margin: 20px auto 40px auto;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background: #0a0a0a;
}

.ww-header {
    padding: 10px 16px;
    border-bottom: 1px solid #222;
    background: #111;
}

.ww-title {
    margin: 0;
    font-family: 'Archivo Black', sans-serif;
    font-size: 16px;
    color: #fff;
}

.ww-body {
    display: -webkit-flex;
    display: flex;
    overflow-x: auto;
    background: #000;
}

.ww-day-wrap {
    -webkit-flex: 1;
    flex: 1;
    min-width: 100px;           /* 7×100=700 < 738px (iPad 768-30px padding) */
    border-right: 1px solid #222;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
}

.ww-day-wrap:last-child {
    border-right: none;
}

.ww-day-box {
    padding: 12px 6px;          /* kompakter für iPad 768px */
    text-align: center;
    cursor: pointer;
    background: #0a0a0a;
    transition: background 0.3s;
}

.ww-day-box:hover {
    background: #111;
}

.ww-day-box.active {
    background: #1a1a1a;
    border-bottom: 2px solid #0065bd;
}

.ww-day-label {
    font-size: 14px;
    font-weight: 700;
    color: #ccc;
    margin-bottom: 8px;
}

.ww-day-icon {
    font-size: 26px;            /* etwas kleiner für 768px */
    margin-bottom: 6px;
}

.ww-day-temps {
    font-size: 16px;
    font-family: 'Archivo Black', sans-serif;
}

.ww-temp-max { color: #fff; margin-right: 6px; }
.ww-temp-min { color: #666; font-size: 13px; }

.ww-day-pop {
    font-size: 11px;
    color: #3b82f6;
    margin-top: 6px;
    min-height: 14px;
    font-weight: 700;
}

.ww-hourly-scroll {
    display: -webkit-flex;
    display: flex;
    overflow-x: auto;
    background: #111;
    padding: 10px;
    border-top: 1px solid #222;
    -webkit-overflow-scrolling: touch;
}

.ww-hour-box {
    text-align: center;
    min-width: 50px;
    padding: 0 5px;
    border-right: 1px dashed #333;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    -webkit-flex: 1;
    flex: 1;
}

.ww-hour-box:last-child {
    border-right: none;
}

.ww-h-time {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}

.ww-h-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.ww-h-temp {
    font-size: 13px;
    color: #eee;
    font-weight: 700;
}

.ww-h-pop {
    font-size: 10px;
    color: #3b82f6;
    margin-top: 2px;
    min-height: 12px;
}

.ww-loading {
    color: #666;
    font-size: 13px;
    padding: 20px;
    text-align: center;
}


/* === LIGHT MODE OVERRIDES === */

body.light-mode {
    background-color: #f5f5f5;
    color: #222;
}

body.light-mode .theme-toggle {
    border-color: #ccc;
    background: #fff;
    color: #000;
}

body.light-mode .theme-toggle:active {
    background: #e0e0e0;
}

body.light-mode .top-btn {
    border-color: #ccc;
    color: #333;
}

body.light-mode .top-btn:active {
    background: #e0e0e0;
}

body.light-mode .list-toggle-btn {
    background: #fff;
    border-color: #ccc;
    color: #222;
}

body.light-mode .list-toggle-btn:active {
    background: #f0f0f0;
}

body.light-mode .header {
    background: #ffffff;
    border-color: #888888; /* Silber/Grau bleibt als Akzent */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

body.light-mode .header h1 {
    color: #111111;
}

body.light-mode .header .subtitle {
    color: #666666;
}

body.light-mode .header-logo {
    -webkit-filter: grayscale(100%) contrast(500%) invert(1);
    filter: grayscale(100%) contrast(500%) invert(1);
    mix-blend-mode: multiply; /* Versteckt den weißen Hintergrund komplett */
}

body.light-mode .category-header {
    color: #111111;
    border-bottom-color: #cccccc;
}

body.light-mode .price-item {
    border-bottom-color: #ddd;
    border-right-color: #ddd;
}

body.light-mode .item-name {
    color: #444444;
}

body.light-mode .item-price {
    color: #333333;
}

body.light-mode .item-footnotes { color: #999; }
body.light-mode .inhaltsstoffe-legende { background: #f8f8f8; border-color: #ccc; }
body.light-mode .legende-title { color: #111; border-bottom-color: #ccc; }
body.light-mode .legende-entry { color: #444; }
body.light-mode .legende-entry sup { color: #666; }

body.light-mode .item-price-details {
    color: #666666;
}

body.light-mode .item-desc {
    color: #666666;
}

body.light-mode .loading {
    color: #222;
}

body.light-mode .spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #222;
}

/* Light mode transport overrides */
body.light-mode .transport-widget {
    background: #fff;
    border-color: #ddd;
}

body.light-mode .tw-header {
    background: #f8f8f8;
    border-bottom-color: #eee;
}

body.light-mode .tw-title { color: #222; }
body.light-mode .tw-stops-col { border-right-color: #eee; }

body.light-mode .tw-stop-btn {
    background: #f8f8f8;
    border-color: #ddd;
    color: #333;
}

body.light-mode .tw-stop-btn.active {
    border-color: #0065bd;
    background: rgba(0, 101, 189, 0.08);
}

body.light-mode .tw-del-btn {
    background: #f8f8f8;
    border-color: #ddd;
}

body.light-mode .tw-dep-item {
    background: #f8f8f8;
    border-color: #eee;
}

body.light-mode .tw-dep-dest { color: #333; }
body.light-mode .tw-dep-time-val { color: #111; }

/* Light mode weather overrides */
body.light-mode .weather-widget { background: #fff; border-color: #ddd; }
body.light-mode .ww-header { background: #f8f8f8; border-bottom-color: #eee; }
body.light-mode .ww-title { color: #222; }
body.light-mode .ww-body { background: #fff; }
body.light-mode .ww-day-wrap { border-right-color: #eee; }
body.light-mode .ww-day-box { background: #fff; }
body.light-mode .ww-day-box:hover { background: #f9f9f9; }
body.light-mode .ww-day-box.active { background: #f0f8ff; border-bottom-color: #0065bd; }
body.light-mode .ww-day-label { color: #444; }
body.light-mode .ww-temp-max { color: #111; }
body.light-mode .ww-temp-min { color: #888; }
body.light-mode .ww-hourly-scroll { background: #f8f8f8; border-top-color: #eee; }
body.light-mode .ww-hour-box { border-right-color: #ddd; }
body.light-mode .ww-h-time { color: #555; }
body.light-mode .ww-h-temp { color: #222; }

/* === RESPONSIVE: Widget-Spalten stacken ab 600px === */
/* Preisliste: IMMER 2 Spalten, kein Breakpoint nötig */
@media (max-width: 768px) {
    .tw-body {
        -webkit-flex-direction: column;
        flex-direction: column;
    }
    .tw-stops-col {
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid #222;
        max-height: 140px;
    }
    .tw-dep-col {
        max-height: 500px;
    }
}




