:root { 
    --primary: #6EC6C3; --btn-text: #1A1A1A; --success: #2ecc71;
    --success-forecast: #85e399; 
    --warning: #ffa502; --danger: #ff4757; 
    --danger-forecast: #ff7675;
    --dark: #2d3436;
    --accent: #e63946; 
    --bg: #cbd5e0; 
    --text-muted: #698787; 
    --white: #ffffff;
    --gust-low: #2ecc71;
    --gust-mid: #ffa502;
    --gust-high: #ff4757;
}
body { font-family: 'Segoe UI', sans-serif; background: var(--bg); margin: 0; padding: 15px; display: flex; flex-direction: column; align-items: center; }

.header-container { 
    width: 100%; max-width: 900px; display: grid; grid-template-columns: 120px 1fr 120px; 
    align-items: center; margin-bottom: 15px; background: white; padding: 15px 25px; 
    border-radius: 20px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); border: 1px solid rgba(0,0,0,0.08);
    box-sizing: border-box; 
}
.mobile-top-row { display: contents; }
.logo-box img { height: 80px; border-radius: 8px; display: block; }
.title-group { text-align: center; }
.main-title { font-size: 1.4rem; color: var(--dark); font-weight: 800; margin: 0; text-transform: uppercase; letter-spacing: 1px; }
.sub-timestamp { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-top: 2px; display: block; }

.button-group { display: flex; flex-direction: column; gap: 6px; justify-self: end; width: 120px; }

.action-btn { 
    background: var(--primary); color: var(--btn-text); border: none; height: 38px; width: 100%; 
    border-radius: 12px; cursor: pointer; font-size: 0.95rem; font-weight: 400; 
    transition: all 0.3s ease; display: flex; align-items: center; justify-content: center;
    text-align: center; line-height: 1.2; text-decoration: none;
    border: 1px solid rgba(0,0,0,0.1);
}

@keyframes pulse-animation {
    0% { background-color: var(--primary); transform: scale(1); }
    50% { background-color: #7ed6d8; transform: scale(1.03); }
    100% { background-color: var(--primary); transform: scale(1); }
}

.loading-pulse { animation: pulse-animation 1.5s infinite ease-in-out; pointer-events: none; }
.action-btn.success { background: var(--success) !important; color: white !important; }
.action-btn.retry { background: var(--warning) !important; color: white; animation: none; }

.dashboard { width: 100%; max-width: 950px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.card { 
    background: white; 
    padding: 15px; 
    border-radius: 20px; 
    box-shadow: 0 8px 20px rgba(0,0,0,0.08); 
    border: 1px solid rgba(0,0,0,0.06); 
    text-align: center; 
    position: relative; 
}

.view-toggle {
    display: inline-flex;
    margin-top: 5px; 
    background: #f0f2f5; 
    border-radius: 12px; 
    padding: 4px;
    z-index: 100;
}
.toggle-item {
    padding: 8px 20px;   
    font-size: 0.85rem;  
    font-weight: 800; 
    border-radius: 9px;
    cursor: pointer; 
    transition: 0.3s; 
    color: var(--text-muted); 
    text-transform: uppercase;
}
.toggle-item.active { 
    background: white; 
    color: var(--primary); 
    box-shadow: 0 3px 8px rgba(0,0,0,0.08); 
}

#compass-view, #map-view { 
    width: 100%; 
    height: 180px; 
    box-sizing: border-box; 
    margin: 10px 0 0 0; 
    overflow: hidden; 
}

#map-view { 
    position: relative; 
    border-radius: 15px; 
    border: 1px solid #eee; 
}

.map-attribution {
    font-size: 0.65rem; 
    color: var(--text-muted); 
    text-align: right; 
    margin-top: 5px;
    margin-bottom: 2px;
    padding-right: 5px;
    display: block; 
    min-height: 15px; 
    visibility: hidden; 
}
.map-attribution a { color: inherit; text-decoration: none; }

#wind-map { 
    height: 100%; 
    width: 100%; 
    z-index: 1;
}

.compass { 
    position: relative; 
    width: 150px; 
    height: 150px; 
    border: 3px solid #eee; 
    border-radius: 50%; 
    background: #fff;
    margin: 12px auto; 
}

.compass span { position: absolute; font-weight: 800; transform: translate(-50%, -50%); }

.label-main { font-size: 0.75rem; color: #bbb; }
.label-sub { font-size: 0.6rem; color: #ddd; }

.label-n { top: 12%; left: 50%; color: var(--accent) !important; }
.label-no { top: 22%; left: 78%; }
.label-o { top: 50%; left: 88%; }
.label-so { top: 78%; left: 78%; }
.label-s { top: 88%; left: 50%; }
.label-sw { top: 78%; left: 22%; }
.label-w { top: 50%; left: 12%; }
.label-nw { top: 22%; left: 22%; }

.needle { position: absolute; top: 50%; left: 50%; width: 4px; height: 110px; background: var(--dark); margin-top: -55px; margin-left: -2px; transition: transform 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 2; }
.needle::before { content: ''; position: absolute; top: -12px; left: -6px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 25px solid var(--accent); }

.value-display { font-size: 3rem; font-weight: 800; margin: 0; line-height: 1; display: block; }
.cur-speed-color { color: var(--dark); }
.gust-speed-color { color: var(--accent); }
.sub-info { font-size: 0.95rem; color: var(--text-muted); font-weight: 600; margin-bottom: 10px; }

.forecast-card { grid-column: span 2; display: grid; grid-template-columns: 1fr 2fr; gap: 15px; padding: 12px 20px; }
.ampel-box { border-right: 1px solid #eee; display: flex; flex-direction: column; }
.ampel-container { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ampel-light { width: 40px; height: 40px; border-radius: 50%; background: #ccc; margin: 5px 0; transition: background 0.5s ease; }

.light-red { background: var(--danger); box-shadow: 0 0 15px rgba(255, 71, 87, 0.5); }
.light-orange { background: var(--warning); box-shadow: 0 0 15px rgba(255, 165, 2, 0.5); }
.light-green { background: var(--success); box-shadow: 0 0 15px rgba(46, 213, 115, 0.5); }
.light-green-forecast { background: var(--success-forecast); box-shadow: 0 0 10px rgba(133, 227, 153, 0.5); }
.light-red-forecast { background: var(--danger-forecast); box-shadow: 0 0 10px rgba(255, 118, 117, 0.5); }

.lake-recommendation { font-size: 0.8rem; font-weight: 700; color: var(--primary); margin-top: 8px; line-height: 1.2; }

.forecast-table { 
    width: 100%; 
    max-width: 420px; 
    margin: 0 auto;   
    font-size: 0.8rem; 
    border-collapse: collapse; 
}

.forecast-table th { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; padding-bottom: 5px; }
.forecast-table td { padding: 4px 5px; border-bottom: 1px solid #f9f9f9; text-align: center; }
.gust-forecast-val { color: var(--accent); font-weight: normal; }

.chart-card { grid-column: span 2; padding: 20px 30px; }
.chart-container { position: relative; height: 330px; width: 100%; overflow: visible; }

h2 { margin: 0 0 5px 0; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.2px; }

/* UPDATE V13.3 (v41) - Footer als Flex-Container für Button-Positionierung */
.footer { 
    font-size: 0.75rem; color: var(--text-muted); margin: 25px 0; grid-column: span 2; 
    text-align: center; line-height: 1.5;
    display: flex; justify-content: center; align-items: center; position: relative;
}

#retryMsg { color: var(--warning); font-weight: bold; margin-bottom: 10px; display: none; font-size: 0.9rem; text-align: center; width: 100%; max-width: 900px; }

.container-index { 
    text-align: center; width: 90%; max-width: 500px; 
    background: var(--white); padding: 40px 20px; 
    border-radius: 30px; box-shadow: 0 15px 35px rgba(0,0,0,0.1); 
}
.logo-index { width: 120px; height: auto; margin-bottom: 20px; border-radius: 15px; }
.h1-index { margin: 0; font-size: 1.8rem; font-weight: 800; color: var(--dark); }
.p-index { color: var(--text-muted); margin-bottom: 30px; font-weight: 500; }
.button-group-index { display: flex; flex-direction: column; gap: 15px; }

/* --- V13.3 NEUE BUTTON STRUKTUR --- */
.lake-card {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-radius: 18px; 
    border: 1px solid #d1d9e6;
    margin-bottom: 0px; 
    height: 70px; 
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    position: relative;
    width: 100%;
}
.lake-card:hover { transform: translateY(-1px); box-shadow: 0 8px 12px rgba(89, 188, 190, 0.15); border-color: var(--primary); }

.card-section-left {
    width: 70px; 
    background: #f8f9fa; 
    border-right: 1px solid #eee; 
    display: flex; justify-content: center; align-items: center;
    padding: 15px; 
    box-sizing: border-box;
    cursor: pointer;
}
.lake-icon-svg { width: 100%; height: 100%; object-fit: contain; }

.card-section-middle {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 70px; 
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.lake-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 4px;
    line-height: 1.1;
}

.lake-card-status {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.card-section-right {
    width: 60px;
    border-left: 1px solid #eee; /* Trennlinie zur Glocke */
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    background: white;
    transition: background 0.3s;
}
.card-section-right:hover { background: #f0f2f5; }

.alarm-icon-card { font-size: 1.2rem; filter: grayscale(100%); opacity: 0.4; transition: 0.3s; }

/* Aktiv-Status der Glocke (Grün) */
.alarm-active-card .alarm-icon-card { filter: none; opacity: 1; text-shadow: 0 0 10px rgba(46, 204, 113, 0.4); }

/* DOTS */
.status-dot-inline { width: 10px; height: 10px; border-radius: 50%; background-color: #ccc; box-shadow: 0 0 5px rgba(0,0,0,0.1); margin-right: 8px; transition: background-color 0.5s ease; flex-shrink: 0; }

.dot-green { background-color: var(--success); box-shadow: 0 0 10px rgba(46, 204, 113, 0.4); }
.dot-green-forecast { background-color: var(--success-forecast); box-shadow: 0 0 10px rgba(133, 227, 153, 0.4); }
.dot-orange { background-color: var(--warning); box-shadow: 0 0 10px rgba(255, 165, 2, 0.4); }

@keyframes dot-pulse-animation {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); transform: scale(1); }
    70% { box-shadow: 0 0 0 6px rgba(255, 71, 87, 0); transform: scale(1.1); }
    100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); transform: scale(1); }
}
.dot-red { background-color: var(--danger); animation: dot-pulse-animation 1.5s infinite; }
.dot-red-forecast { background-color: var(--danger-forecast); box-shadow: 0 0 10px rgba(255, 118, 117, 0.4); }

.legend-box {
    margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center;
    gap: 15px 20px; background: #f8f9fa; padding: 15px; border-radius: 15px; border: 1px solid #edf2f7;
}
.legend-item { display: flex; align-items: center; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; display: inline-block; }

.update-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 30px;
}

.footer a { color: var(--text-muted); text-decoration: none; border-bottom: 1px dotted var(--text-muted); transition: color 0.3s; margin: 0 5px; }
.footer a:hover { color: var(--primary); border-bottom-color: var(--primary); }
.legal-text { text-align: left; font-size: 0.85rem; line-height: 1.6; color: var(--dark); margin-top: 20px; }
.legal-text strong { display: block; margin-top: 15px; margin-bottom: 5px; color: var(--primary); }
.legal-text p { margin: 0 0 10px 0; color: var(--dark); }

@media (max-width: 767px) {
    body { padding: 10px; }
    .header-container { display: flex; flex-direction: column; padding: 15px; gap: 10px; border-radius: 15px; }
    .mobile-top-row { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; width: 100%; gap: 15px; }
    .logo-box img { height: 55px; }
    .title-group { text-align: left; }
    .main-title { font-size: 1.2rem; }
    .button-group { width: 100%; flex-direction: row; }
    .action-btn { height: 44px; }
    .dashboard { grid-template-columns: 1fr; }
    .forecast-card { grid-template-columns: 1fr; grid-column: span 1; }
    .ampel-box { border-right: none; border-bottom: 1px solid #eee; padding-bottom: 15px; margin-bottom: 10px; }
    .chart-card { grid-column: span 1; padding: 15px 10px; }
    .footer { grid-column: span 1; }
    
    /* Mobile Adjustments for New Cards */
    .card-section-middle { padding-left: 20px; /* Weniger Padding auf Mobile */ }
}

/* Karten-Legende Overlay */
.map-legend-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.85);
    padding: 6px 10px;
    border-radius: 8px;
    z-index: 1001;
    font-size: 0.65rem;
    pointer-events: none;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(0,0,0,0.05);
}
.map-legend-title { display: block; font-weight: 800; color: var(--dark); margin-bottom: 3px; font-size: 0.6rem; letter-spacing: 0.5px; }
.map-legend-item { display: flex; align-items: center; margin-top: 2px; color: var(--text-muted); font-weight: 700; }
.dot-teal { background-color: #59BCBE; box-shadow: 0 0 5px rgba(89, 188, 190, 0.4); }

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    padding: 15px;
    box-sizing: border-box;
}
.modal-active { display: flex; }

/* Modal Box */
.modal-box {
    background: white;
    width: 100%; max-width: 380px;
    border-radius: 25px;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    text-align: left;
    position: relative;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid #f0f0f0; padding-bottom: 15px; }
.modal-title { margin: 0; font-size: 1.2rem; font-weight: 800; color: var(--dark); text-transform: uppercase; letter-spacing: 1px; }
.modal-close { background: #f0f2f5; border: none; font-size: 1.4rem; cursor: pointer; color: var(--dark); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.modal-close:hover { background: var(--danger); color: white; }

/* Form Elements */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.75rem; font-weight: 800; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-control { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid #e1e4e8; font-family: inherit; font-size: 0.95rem; box-sizing: border-box; background: #f8f9fa; color: var(--dark); font-weight: 600; }
.form-control:focus { outline: none; border-color: var(--primary); background: white; }

.slider-container { display: flex; align-items: center; gap: 15px; }
.slider-val { font-weight: 800; color: var(--primary); min-width: 45px; text-align: right; }

input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 20px; width: 20px; border-radius: 50%; background: var(--primary); cursor: pointer; margin-top: -8px; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: #e1e4e8; border-radius: 2px; }

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #e1e4e8; transition: .3s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .3s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(22px); }

.save-btn { width: 100%; background: var(--dark); color: white; border: none; padding: 16px; border-radius: 15px; font-weight: 800; font-size: 1rem; margin-top: 15px; cursor: pointer; transition: 0.2s; letter-spacing: 1px; }
.save-btn:active { transform: scale(0.98); }
.delete-btn { width: 100%; background: transparent; color: var(--danger); border: 1px solid rgba(255, 71, 87, 0.3); padding: 12px; border-radius: 15px; font-weight: 700; font-size: 0.85rem; margin-top: 10px; cursor: pointer; transition: 0.2s; }
.delete-btn:hover { background: rgba(255, 71, 87, 0.05); }

#settingsContainer { transition: opacity 0.3s ease; }

/* Time Input Fix for iOS */
input[type="time"] { -webkit-appearance: none; appearance: none; }

/* Freq Selector Chips */
.freq-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.freq-item { flex: 1; min-width: 60px; position: relative; cursor: pointer; }
.freq-item input { position: absolute; opacity: 0; cursor: pointer; }
.freq-btn { 
    display: flex; align-items: center; justify-content: center; 
    width: 100%; padding: 10px 0; 
    background: #f0f2f5; border-radius: 10px; 
    font-size: 0.75rem; font-weight: 700; color: var(--text-muted); /* Old style restored */
    transition: all 0.2s; border: 1px solid transparent;
}
.freq-item input:checked + .freq-btn { 
    background: white; color: var(--primary); 
    border-color: var(--primary); box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
}
.freq-time {
    font-size: inherit; font-weight: 800; color: var(--dark); margin-left: 4px; /* Size Inherited */
}
/* Help Button Styles - Jetzt im Footer */
.help-trigger {
    position: absolute; right: 0; /* Rechts im Footer */
    width: 24px; height: 24px; border-radius: 50%;
    background: #f0f2f5; color: var(--text-muted);
    border: none; font-weight: 800; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; font-size: 0.8rem;
    z-index: 10;
}
.help-trigger:hover { background: var(--primary); color: white; }
.help-content h4 { margin: 15px 0 5px 0; color: var(--dark); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.help-content p { font-size: 0.85rem; color: #555; margin-bottom: 10px; line-height: 1.5; }
.help-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }