@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700&family=Open+Sans:wght@400;600&display=swap');

:root {
    --primary: #4a86c8;
    --primary-dark: #326199;
    --heading-blue: #4a90d9;
    --accent-red: #c62828;
    --accent-green: #2e7d32;
    --bg: #f2f4f6;
    --border: #dde1e6;
    --text: #232629;
    --star: #f5b301;
    --star-off: #d7dbe0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Open Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1, h2, h3 {
    font-family: 'Quicksand', 'Open Sans', sans-serif;
    font-weight: 700;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.site-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--primary);
}

.site-header .brand { display: flex; align-items: center; gap: 14px; }
.site-header .brand img { height: 90px; width: auto; }
.site-header h1 { margin: 0; font-size: 28px; color: var(--heading-blue); }
.site-header nav a {
    color: #fff;
    background: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 6px;
    display: inline-block;
}
.site-header nav a:hover { background: var(--primary-dark); text-decoration: none; }

.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.alert-success { background: #e6f4ea; color: var(--accent-green); }
.alert-error { background: #fdecea; color: var(--accent-red); }
.alert-info { background: #e8f0fe; color: var(--primary-dark); }

.upload-form {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upload-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.upload-form input,
.upload-form select {
    font-size: 1rem;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: normal;
}

.upload-form .hint { font-size: 0.85rem; color: #666; margin: 0; }

button, .btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
button:hover, .btn:hover { background: var(--primary-dark); }
.btn-danger { background: #c53030; }
.btn-danger:hover { background: #9b2c2c; }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.gallery-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin: 0;
}
.gallery-item img { width: 100%; height: 220px; object-fit: cover; display: block; }
.gallery-item figcaption { padding: 14px; }
.gallery-item h3 { margin: 0 0 4px; font-size: 1.05rem; }
.gallery-item .category { margin: 0 0 8px; color: #666; font-size: 0.85rem; }

.stars { font-size: 1.4rem; cursor: pointer; user-select: none; }
.stars .star { color: var(--star-off); transition: color .15s; }
.stars .star.filled { color: var(--star); }
.stars[data-locked="1"] { cursor: not-allowed; opacity: 0.6; }

.avg-rating { font-size: 0.85rem; color: #666; margin: 6px 0 0; }

/* ---------------- Admin ---------------- */
.admin-header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom: 20px;}
.admin-nav { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-nav a { color: var(--primary); text-decoration: none; font-weight: 600; padding: 8px 0; }
.admin-nav a.active { border-bottom: 2px solid var(--primary); }

table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;}
table.admin-table th, table.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem; vertical-align: middle;}
table.admin-table th { background: #f1f3f5; }
table.admin-table img.thumb { width: 70px; height: 55px; object-fit: cover; border-radius: 4px; }
.status-badge { padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-pending { background: #fff4e0; color: #a05a00; }
.status-approved { background: #e6f4ea; color: #1e6f39; }

.action-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.action-buttons form { display: inline; }
.action-buttons button, .action-buttons a.btn { padding: 6px 10px; font-size: 0.8rem; border-radius: 6px; }

.settings-form { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 24px; max-width: 600px; display:flex; flex-direction: column; gap: 16px;}
.settings-form label { display:flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem;}
.settings-form input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-weight: normal; }
.settings-form .hint { font-size: 0.8rem; color: #666; font-weight: normal; }

.category-list { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; max-width: 500px; margin-bottom: 24px;}
.category-list li { display:flex; justify-content: space-between; align-items:center; padding: 8px 0; border-bottom: 1px solid var(--border);}
.category-list li:last-child { border-bottom: none; }
.inline-form { display:flex; gap: 8px; margin-top: 16px;}
.inline-form input { flex:1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;}

/* ---------------- Wettbewerbs- & Kategorie-Karten ---------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}
.info-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    display: block;
    transition: box-shadow .15s, transform .15s;
}
.info-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); transform: translateY(-2px); }
.info-card h3 { margin: 0 0 6px; color: var(--heading-blue); font-size: 1.15rem; }
.info-card p { margin: 0; color: #666; font-size: 0.9rem; }
.info-card .badge { display:inline-block; margin-top:10px; font-size:0.75rem; font-weight:600; padding:3px 10px; border-radius:999px; background:#e8f0fe; color: var(--primary-dark); }

.category-facts {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.category-facts li {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.4;
}

.breadcrumb { margin-bottom: 18px; font-size: 0.9rem; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------------- Lightbox (Bild-Zoom) ---------------- */
.gallery-item img { cursor: zoom-in; }
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 30px;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox-caption { color: #fff; text-align: center; margin-top: 12px; font-size: 1rem; }
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2.2rem;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}
.lightbox-close:hover { color: var(--star); background: none; }

/* ---------------- Rangliste / Gewinner ---------------- */
.winners-list { display: flex; flex-direction: column; gap: 16px; max-width: 720px; margin: 0 auto; }
.winner-row {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
}
.winner-row.rank-1 { border: 2px solid #f5b301; background: #fffbea; }
.winner-row.rank-2 { border: 2px solid #b0b8c1; }
.winner-row.rank-3 { border: 2px solid #c98a4b; }
.winner-rank {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--primary-dark);
    width: 46px;
    text-align: center;
    flex-shrink: 0;
}
.winner-row.rank-1 .winner-rank { color: #b8860b; }
.winner-row img { width: 90px; height: 70px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.winner-info { flex: 1; }
.winner-info h3 { margin: 0 0 2px; font-size: 1.05rem; }
.winner-info p { margin: 0; color: #666; font-size: 0.85rem; }
.winner-score { font-weight: 700; color: var(--star); font-size: 1.1rem; white-space: nowrap; }

.publish-toggle { display:inline-flex; align-items:center; gap:8px; }

/* ---------------- Zusatztext / Richtlinien-Box ---------------- */
.guidelines-box {
    background: #f4f6f9;
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 20px;
}
.guidelines-box h3 { margin: 0 0 6px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--primary-dark); }
.guidelines-box p { margin: 0; font-size: 0.85rem; line-height: 1.5; color: #444; }

.submit-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.submit-layout .upload-form { flex: 1 1 420px; max-width: 480px; margin: 0; }
.submit-layout .info-panel { flex: 1 1 280px; min-width: 260px; }
.submit-layout .info-panel .guidelines-box { display: none; margin-bottom: 16px; }
.submit-layout .info-panel .guidelines-box.active { display: block; }
