/* ============================================================
   Kursator – Public CSS  (Option C: Künstlerisch-Natürlich)
   ============================================================ */

/* ── Color tokens ─────────────────────────────────────────── */
:root {
    /* Brand – forest green (contrast on #fefdf8: 6.5:1 ✓) */
    --primary:       #2d6a4f;
    --primary-dark:  #1e4d38;
    --primary-light: #e8f5ed;

    /* Accent – gold/ocher (text on white: 5.8:1 ✓) */
    --accent:        #7a5c1e;
    --accent-light:  #f7edd8;

    /* Accent – dusty rose (text on white: 7.2:1 ✓) */
    --rose:          #8b3d5a;
    --rose-light:    #fce8ef;

    /* Warm-white page background */
    --bg:            #fefdf8;
    --surface:       #ffffff;

    /* Neutrals (warm-shifted) */
    --gray-50:  #f8f7f2;
    --gray-100: #f0ede4;
    --gray-200: #e4dfd3;
    --gray-300: #cdc6b8;
    --gray-400: #a89f8f;
    --gray-500: #7d7465;
    --gray-600: #5c5447;
    --gray-700: #3d3830;
    --gray-800: #28231c;
    --gray-900: #1a1610;

    /* Semantic */
    --success: #1a6340;
    --warning: #92400e;
    --danger:  #991b1b;

    /* Category palette – each pair: [text (AA on white)] / [soft bg] */
    --cat-art-text:    #b5380e;  /* terracotta  – 4.8:1 ✓ */
    --cat-art-bg:      #fce8e2;
    --cat-craft-text:  #7a5230;  /* brown       – 5.2:1 ✓ */
    --cat-craft-bg:    #f5e8d8;
    --cat-photo-text:  #1a4d8a;  /* navy        – 7.4:1 ✓ */
    --cat-photo-bg:    #e2ecf8;
    --cat-music-text:  #5b2d8a;  /* violet      – 7.1:1 ✓ */
    --cat-music-bg:    #ece4f8;
    --cat-cook-text:   #8a4a10;  /* amber       – 5.4:1 ✓ */
    --cat-cook-bg:     #f8edd8;
    --cat-dance-text:  #1a6860;  /* teal        – 5.6:1 ✓ */
    --cat-dance-bg:    #dff5f2;
    --cat-textile-text:#7a2852;  /* wine        – 6.8:1 ✓ */
    --cat-textile-bg:  #f8e4ee;
    --cat-nature-text: #3d6b1a;  /* lime-green  – 5.5:1 ✓ */
    --cat-nature-bg:   #e8f5dc;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--bg);
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ── Focus ring (accessibility) ───────────────────────────── */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================================
   Header
   ============================================================ */
.header {
    background: var(--surface);
    border-bottom: 2px solid var(--gray-100);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 66px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.logo svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}
.logo:hover { text-decoration: none; color: var(--primary); }

.nav { display: flex; gap: 2rem; }
.nav a {
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.nav a:hover  { color: var(--primary); border-bottom-color: var(--primary-light); }
.nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

.header-actions { display: flex; gap: 0.75rem; align-items: center; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.375rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s;
    line-height: 1;
}

/* Primary – green, white text (contrast 6.5:1 ✓) */
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
    color: #fff;
}

/* Secondary – outlined */
.btn-secondary {
    background: var(--surface);
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
}
.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

/* Accent – gold fill */
.btn-accent {
    background: var(--accent-light);
    color: var(--accent);
    border: 1.5px solid #d4b07a;
}
.btn-accent:hover {
    background: #f0dfc0;
    text-decoration: none;
    color: var(--accent);
}

.btn-sm  { padding: 0.4rem 0.875rem; font-size: 0.875rem; border-radius: 8px; }
.btn-icon { padding: 0.5rem; border-radius: 8px; }
.btn svg { width: 18px; height: 18px; }

/* ============================================================
   Search Bar
   ============================================================ */
.search-bar {
    background: var(--primary);
    padding: 1.125rem 0;
}

.search-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.search-form {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.search-input-group {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-input-group svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 1rem;
    border: 2px solid transparent;
    border-radius: 10px;
    background: var(--surface);
    color: var(--gray-800);
}
.search-input::placeholder { color: var(--gray-400); }
.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(122, 92, 30, 0.2);
}

.search-select {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid transparent;
    border-radius: 10px;
    background: var(--surface);
    min-width: 180px;
    color: var(--gray-800);
}
.search-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(122, 92, 30, 0.2);
}

.search-bar .btn-primary {
    background: var(--accent-light);
    color: var(--accent);
    border: 2px solid #d4b07a;
    font-weight: 600;
}
.search-bar .btn-primary:hover {
    background: #f0dfc0;
    color: var(--accent);
}

/* ============================================================
   Layout
   ============================================================ */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-controls-left { display: flex; align-items: center; gap: 1rem; }

.results-count { color: var(--gray-600); font-size: 0.9375rem; }

.view-buttons {
    display: flex;
    background: var(--surface);
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}

.view-btn {
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.view-btn:not(:last-child) { border-right: 1.5px solid var(--gray-200); }
.view-btn.active { background: var(--primary); color: #fff; }
.view-btn:hover:not(.active) { background: var(--primary-light); color: var(--primary); }
.view-btn svg { width: 20px; height: 20px; }

.sort-select {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    background: var(--surface);
    color: var(--gray-700);
}

/* ============================================================
   Course Cards  (grid view)
   ============================================================ */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(44, 33, 12, 0.08);
    transition: box-shadow 0.2s, transform 0.2s;
    /* Colored top accent via --card-accent (set by category class) */
    border-top: 4px solid var(--card-accent, var(--gray-200));
    display: flex;
    flex-direction: column;
}
.course-card:hover {
    box-shadow: 0 6px 20px rgba(44, 33, 12, 0.14);
    transform: translateY(-3px);
}

.course-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--gray-100);
    display: block;
}

.course-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-card-provider {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.course-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    flex: 1;
}
.course-card-title a { color: inherit; text-decoration: none; }
.course-card-title a:hover { color: var(--primary); }

.course-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: 0.875rem;
}
.course-card-meta span { display: flex; align-items: center; gap: 0.25rem; }
.course-card-meta svg { width: 14px; height: 14px; }

.course-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.875rem;
    border-top: 1px solid var(--gray-100);
    margin-top: auto;
}

.course-card-price {
    font-size: 1.1875rem;
    font-weight: 700;
    color: var(--primary-dark);
}
.course-card-price small {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--gray-500);
}

/* ── Category accent colors on cards ──────────────────────── */
.cat-art      { --card-accent: var(--cat-art-text); }
.cat-craft    { --card-accent: var(--cat-craft-text); }
.cat-photo    { --card-accent: var(--cat-photo-text); }
.cat-music    { --card-accent: var(--cat-music-text); }
.cat-cook     { --card-accent: var(--cat-cook-text); }
.cat-dance    { --card-accent: var(--cat-dance-text); }
.cat-textile  { --card-accent: var(--cat-textile-text); }
.cat-nature   { --card-accent: var(--cat-nature-text); }
/* Fallback: brand green */
.cat-default  { --card-accent: var(--primary); }

/* ============================================================
   Course List View
   ============================================================ */
.courses-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.course-list-item {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(44, 33, 12, 0.08);
    display: flex;
    transition: box-shadow 0.2s;
    border-left: 4px solid var(--card-accent, var(--gray-200));
}
.course-list-item:hover { box-shadow: 0 6px 20px rgba(44, 33, 12, 0.14); }

.course-list-image {
    width: 220px;
    min-height: 150px;
    object-fit: cover;
    background: var(--gray-100);
    flex-shrink: 0;
}

.course-list-body {
    flex: 1;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.course-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 0.75rem;
}

/* ============================================================
   Calendar View
   ============================================================ */
.calendar-container {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(44, 33, 12, 0.08);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--primary-light);
}

.calendar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.calendar-nav { display: flex; gap: 0.5rem; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }

.calendar-weekday {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.calendar-day {
    min-height: 120px;
    padding: 0.5rem;
    border-right: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    background: var(--surface);
}
.calendar-day:nth-child(7n) { border-right: none; }

.calendar-day-empty  { background: var(--gray-50); }
.calendar-day-today  { background: var(--primary-light); }

.calendar-day-number {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}
.calendar-day-today .calendar-day-number {
    color: var(--primary-dark);
}

.calendar-event {
    display: block;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    background: var(--primary);
    color: #fff;
    border-radius: 5px;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    font-weight: 500;
}
.calendar-event:hover {
    background: var(--primary-dark);
    text-decoration: none;
    color: #fff;
}

/* ============================================================
   Map View
   ============================================================ */
.map-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.map-wrapper {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(44, 33, 12, 0.08);
}

#courses-map { width: 100%; height: 100%; }

.map-sidebar {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map-course-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 1px 4px rgba(44, 33, 12, 0.08);
    cursor: pointer;
    transition: box-shadow 0.2s;
    border-left: 4px solid var(--gray-200);
}
.map-course-card:hover { box-shadow: 0 4px 14px rgba(44, 33, 12, 0.14); }
.map-course-card.active {
    box-shadow: 0 4px 14px rgba(44, 33, 12, 0.14);
    border-left-color: var(--primary);
}

/* ============================================================
   Filters Sidebar
   ============================================================ */
.filters-sidebar {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(44, 33, 12, 0.08);
}

.filter-section { margin-bottom: 1.5rem; }
.filter-section:last-child { margin-bottom: 0; }

.filter-title {
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
    color: var(--gray-600);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--gray-700);
}
.filter-option input { width: 18px; height: 18px; accent-color: var(--primary); }

.filter-range { display: flex; gap: 0.5rem; align-items: center; }
.filter-range input {
    width: 80px;
    padding: 0.5rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 8px;
    font-family: inherit;
}

/* ============================================================
   Tags & Badges
   ============================================================ */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-primary {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* Category tags – colored pill per topic */
.tag-cat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--cat-bg, var(--gray-100));
    color: var(--cat-text, var(--gray-700));
}
.tag-cat.cat-art     { --cat-bg: var(--cat-art-bg);     --cat-text: var(--cat-art-text); }
.tag-cat.cat-craft   { --cat-bg: var(--cat-craft-bg);   --cat-text: var(--cat-craft-text); }
.tag-cat.cat-photo   { --cat-bg: var(--cat-photo-bg);   --cat-text: var(--cat-photo-text); }
.tag-cat.cat-music   { --cat-bg: var(--cat-music-bg);   --cat-text: var(--cat-music-text); }
.tag-cat.cat-cook    { --cat-bg: var(--cat-cook-bg);    --cat-text: var(--cat-cook-text); }
.tag-cat.cat-dance   { --cat-bg: var(--cat-dance-bg);   --cat-text: var(--cat-dance-text); }
.tag-cat.cat-textile { --cat-bg: var(--cat-textile-bg); --cat-text: var(--cat-textile-text); }
.tag-cat.cat-nature  { --cat-bg: var(--cat-nature-bg);  --cat-text: var(--cat-nature-text); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
/* Status badges – all meet 4.5:1 on their bg ✓ */
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #78350f; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: var(--primary-light); color: var(--primary-dark); }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }

/* Attendance mode */
.badge-online  { background: var(--cat-photo-bg); color: var(--cat-photo-text); }
.badge-onsite  { background: var(--primary-light); color: var(--primary-dark); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
    background: var(--primary-dark);
    color: #b8d8c8;
    padding: 3.5rem 1.5rem 2rem;
    margin-top: 5rem;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.footer-section h4 {
    color: #fff;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}
.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 0.5rem; }
.footer-section a { color: #b8d8c8; text-decoration: none; }
.footer-section a:hover { color: #fff; }

.footer-bottom {
    max-width: 1400px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    text-align: center;
    font-size: 0.875rem;
    color: #8fbdaa;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .map-container { grid-template-columns: 1fr; height: auto; }
    .map-wrapper { height: 400px; }
    .map-sidebar { max-height: 400px; }
}

@media (max-width: 768px) {
    .nav { display: none; }

    .course-list-item { flex-direction: column; }
    .course-list-image { width: 100%; height: 180px; }
    .course-list-item { border-left: none; border-top: 4px solid var(--card-accent, var(--gray-200)); }

    .footer-inner { grid-template-columns: repeat(2, 1fr); }

    .search-form { flex-direction: column; }
    .search-input-group { min-width: 100%; }
}
