:root {
    --bg-main: #f4f7f6;
    --text-main: #2d3748;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --accent-color: #e28743;
    --trophy-gold: #ffd700;
    --trophy-silver: #c0c0c0;
    --google-blue: #4285f4;
}

[data-theme="dark"] {
    --bg-main: #1a202c;
    --text-main: #edf2f7;
    --card-bg: #2d3748;
    --border-color: #4a5568;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-main); }
body { background-color: var(--bg-main); color: var(--text-main); line-height: 1.6; }

/* ==========================================
   STICKY VERTIKALER INSTITUTIONEN-REGISTER BUTTON
   ========================================== */
.sticky-inst-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left top;
    background: #e53e3e;
    color: #ffffff;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 1px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 99999;
    border-radius: 0 0 8px 8px;
    transition: background 0.3s, transform 0.2s;
    white-space: nowrap;
    border: 2px solid #ffffff;
    border-top: none;
}
.sticky-inst-btn:hover {
    background: #c53030;
    transform: translateY(-50%) rotate(-90deg) scale(1.05);
}

/* NEWSTICKER */
.newsticker-wrap {
    background-color: #000000;
    color: #ffffff;
    display: flex;
    align-items: center;
    height: 36px;
    border-bottom: 2px solid var(--accent-color);
    font-size: 14px;
    font-weight: bold;
    overflow: hidden;
}
.newsticker-label {
    background-color: #e53e3e;
    color: #ffffff;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    letter-spacing: 1px;
    font-weight: 900;
    flex-shrink: 0;
    text-transform: uppercase;
}
.newsticker-scroll { flex-grow: 1; padding: 0 15px; color: #ffffff; }

.container { max-width: 1200px; margin: 20px auto; padding: 0 15px; min-height: 70vh; }

/* Header & Nav Responsive */
.main-header { background: var(--card-bg); box-shadow: 0 2px 4px rgba(0,0,0,0.1); border-bottom: 3px solid var(--primary-color); }
.header-top { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; gap: 15px; }
.logo-area { display: flex; flex-direction: column; }
.logo-text { font-size: 28px; font-weight: bold; color: var(--primary-color); letter-spacing: 2px; }
.custom-logo { max-height: 60px; width: auto; }
.slogan { font-size: 13px; color: var(--accent-color); font-weight: bold; font-style: italic; }

.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-gear { font-size: 24px; text-decoration: none; transition: transform 0.3s; }
.admin-gear:hover { transform: rotate(90deg); }
.social-link, .hotline { text-decoration: none; font-weight: bold; color: var(--text-main); font-size: 14px; display: inline-flex; align-items: center; }

.main-nav { background: var(--primary-color); }
.main-nav ul { display: flex; list-style: none; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; }
.main-nav a { color: white; padding: 12px 18px; text-decoration: none; display: block; font-weight: bold; font-size: 14px; }
.main-nav a:hover { background: rgba(255,255,255,0.1); }

/* Buttons & Karten */
.btn-primary, .btn-danger, .btn-login, .btn-logout, .btn-profile { 
    padding: 8px 16px; border-radius: 4px; text-decoration: none; border: none; cursor: pointer; font-weight: bold; display: inline-block; text-align: center;
}
.btn-primary { background: var(--primary-color); color: white; }
.btn-danger { background: #e53e3e; color: white; }
.btn-login { background: var(--accent-color); color: white; }
.btn-logout { background: #cbd5e0; color: #2d3748; }

.card { background: var(--card-bg); padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 20px; border: 1px solid var(--border-color); }

/* Optische Hervorhebung im Admin für ungelesene / neue Einträge */
.admin-item-highlight {
    border-left: 5px solid #e53e3e !important;
    background-color: rgba(229, 62, 62, 0.06) !important;
    position: relative;
}
.admin-item-highlight::after {
    content: "NEU";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e53e3e;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

/* Offizielle Stellungnahmen der Institutionen */
.official-reply-box {
    margin-top: 12px;
    margin-left: 40px;
    background-color: rgba(26, 54, 93, 0.06);
    border-left: 4px solid var(--primary-color);
    padding: 12px 15px;
    border-radius: 4px;
}

/* Top Ranking & Map */
.ranking-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.ranking-item { display: flex; align-items: center; gap: 15px; background: var(--card-bg); padding: 15px; border-radius: 8px; border-left: 5px solid var(--primary-color); }
.ranking-img { width: 70px; height: 70px; object-fit: cover; border-radius: 50%; flex-shrink: 0; }
.trophy.gold { color: var(--trophy-gold); font-size: 24px; text-shadow: 0 0 5px rgba(255,215,0,0.5); }
.trophy.silver { color: var(--trophy-silver); font-size: 24px; }
.stars { color: #f6ad55; font-weight: bold; font-size: 18px; }

#map { height: 450px; width: 100%; border-radius: 8px; margin-top: 15px; z-index: 1; }

/* Google Rezension Badge & Vote Buttons */
.google-badge { background: #e8f0fe; color: #1a73e8; border: 1px solid #d2e3fc; padding: 3px 8px; border-radius: 12px; font-size: 12px; font-weight: bold; display: inline-flex; align-items: center; gap: 5px; }
.vote-btn { background: var(--bg-main); border: 1px solid var(--border-color); padding: 4px 10px; border-radius: 15px; cursor: pointer; font-size: 13px; font-weight: bold; color: var(--text-main); transition: all 0.2s; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.vote-btn:hover { background: var(--primary-color); color: white; }
.admin-delete-x { color: #e53e3e; font-weight: bold; font-size: 18px; text-decoration: none; margin-left: 10px; padding: 0 5px; }
.admin-delete-x:hover { background: #fff5f5; border-radius: 50%; }

/* Modal & Formulare */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); align-items: center; justify-content: center; padding: 15px; }
.modal-content { background: var(--card-bg); padding: 30px; border-radius: 8px; max-width: 400px; width: 100%; text-align: center; }
.modal-buttons { margin-top: 20px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

form label { display: block; margin-top: 12px; font-weight: bold; }
form input, form select, form textarea { width: 100%; padding: 10px; margin-top: 5px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--card-bg); color: var(--text-main); font-size: 16px; }
form input[type="file"] { border: none; padding: 5px 0; }

/* Admin Badges & Icons */
.admin-icon-link { position: relative; display: inline-flex; align-items: center; text-decoration: none; font-size: 22px; margin: 0 4px; }
.admin-badge { background: #e53e3e; color: #fff; border-radius: 50%; padding: 2px 6px; font-size: 11px; font-weight: bold; position: absolute; top: -6px; right: -8px; box-shadow: 0 0 0 2px var(--card-bg); }

/* Footer */
.main-footer { background: var(--card-bg); border-top: 1px solid var(--border-color); padding: 20px 0; margin-top: 40px; font-size: 14px; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; padding: 0 20px; flex-wrap: wrap; gap: 10px; }
.footer-grid a { color: var(--primary-color); font-weight: bold; text-decoration: none; }
.avatar-sm { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 10px; }

/* MOBILE (< 768px) */
@media screen and (max-width: 768px) {
    .header-top { flex-direction: column; text-align: center; }
    .header-actions { justify-content: center; width: 100%; margin-top: 10px; }
    .main-nav ul { flex-direction: column; width: 100%; text-align: center; }
    .main-nav a { border-bottom: 1px solid rgba(255,255,255,0.1); padding: 14px; }
    .ranking-grid { grid-template-columns: 1fr; }
    .footer-grid { flex-direction: column; text-align: center; }
    #map { height: 350px; }
    .fb-text { display: none; }
    .newsticker-label { padding: 0 8px; font-size: 11px; }
    .sticky-inst-btn { padding: 8px 14px; font-size: 11px; }
}