/* ============================================================
   MUN.Plattform – Konferenzliste Styles
   Nutzt die gleichen Variablen wie styles.css
   ============================================================ */

/* === Page Header === */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    padding: 3rem 0 2.5rem;
    position: relative;
    overflow: hidden;
}

.page-header--compact {
    padding: 2rem 0 1.5rem;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    pointer-events: none;
}

.page-header .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.page-header__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

.page-header__lead {
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* === Filter Bar === */
.filter-bar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 57px;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.filter-bar .container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Hauptfilter */
.filter-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

/* Filter Select */
.filter-select {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 140px;
}

.filter-select label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-select select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") right 0.5rem center/1.25rem no-repeat;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.filter-select select:hover {
    border-color: var(--primary-light);
}

.filter-select select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Filter Input */
.filter-input {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 140px;
}

.filter-input--wide {
    min-width: 200px;
    flex: 1;
}

.filter-input label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-input input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    font-size: 0.9rem;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-input input:hover {
    border-color: var(--primary-light);
}

.filter-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-input input::placeholder {
    color: var(--text-light);
}

/* Erweiterte Filter Button */
.filter-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    align-self: flex-end;
    height: 38px;
    margin-top: auto;
}

.filter-expand-btn:hover {
    background: #fff;
    border-color: var(--primary-light);
    color: var(--primary);
}

.filter-expand-icon {
    transition: transform 0.3s;
}

.filter-expand-icon.is-rotated {
    transform: rotate(180deg);
}

/* Erweiterte Filter (eingeklappt) */
.filter-advanced {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s, opacity 0.3s;
    opacity: 0;
    padding-top: 0;
    border-top: 0 solid var(--border);
}

.filter-advanced.is-open {
    max-height: 300px;
    opacity: 1;
    padding-top: 1rem;
    border-top-width: 1px;
    margin-top: 1rem;
}

/* Filter Aktionen */
.filter-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn--small {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

.btn--outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn--outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

/* Filter Info */
.filter-info {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.filter-bar__count {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Toggle Switch */
.filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    padding: 0.35rem 0;
}

.filter-toggle input {
    display: none;
}

.filter-toggle__slider {
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 11px;
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
}

.filter-toggle__slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.filter-toggle input:checked + .filter-toggle__slider {
    background: var(--primary);
}

.filter-toggle input:checked + .filter-toggle__slider::after {
    transform: translateX(18px);
}

.filter-toggle__label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

/* === Conference List === */
.conference-list {
    padding: 2rem 0 4rem;
    min-height: 60vh;
    background: var(--bg-soft);
}

.conference-list .container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* === MUN Card === */
.mun-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s;
}

.mun-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.mun-card__header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.mun-card__header:hover {
    background: var(--bg-soft);
}

.mun-card__main {
    min-width: 0;
}

.mun-card__badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge--national {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #7c3aed;
}

.badge--international {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #b45309;
}

.badge--workshop {
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    color: #0d9488;
}

.badge--lang {
    background: var(--bg-soft);
    color: var(--text-light);
}

.mun-card__name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 0.25rem;
}

.mun-card__fullname {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0 0 0.5rem;
}

.mun-card__short {
    color: var(--text);
    margin: 0;
    line-height: 1.6;
}

.mun-card__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mun-card__location,
.mun-card__target {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.mun-card__location i,
.mun-card__target i {
    color: var(--primary);
    font-size: 1rem;
}

.mun-card__toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-soft), var(--bg));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin-top: 0.5rem;
    border: 1px solid var(--border);
}

.mun-card__toggle i {
    font-size: 1.25rem;
    color: var(--text-light);
    transition: transform 0.3s;
}

.mun-card.is-expanded .mun-card__toggle {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
}

.mun-card.is-expanded .mun-card__toggle i {
    color: #fff;
    transform: rotate(180deg);
}

/* Card Body (expandable) */
.mun-card__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.3s;
    border-top: 0 solid var(--border);
}

.mun-card.is-expanded .mun-card__body {
    max-height: 1000px;
    padding: 1.5rem;
    border-top-width: 1px;
}

.mun-card__content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.mun-card__description h3,
.mun-card__dates h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 1rem;
}

.mun-card__description p {
    color: var(--text);
    line-height: 1.7;
    margin: 0 0 1rem;
}

.mun-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    transition: all 0.2s;
}

.mun-card__link:hover {
    color: var(--primary-dark);
    transform: translateX(4px);
}

/* Date List */
.date-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.date-item {
    padding: 1rem;
    background: var(--bg-soft);
    border-radius: var(--radius);
    border-left: 4px solid var(--border);
    transition: all 0.2s;
}

.date-item--upcoming {
    border-left-color: var(--primary);
    background: linear-gradient(135deg, #ede9fe, #f3e8ff);
}

.date-item--past {
    opacity: 0.6;
}

.date-item__range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.date-item__range i {
    color: var(--primary);
}

.date-item__note {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.date-item__deadline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

.mun-card__no-dates {
    color: var(--text-light);
    font-style: italic;
}

/* Tags */
.mun-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.tag {
    padding: 0.35rem 0.85rem;
    background: linear-gradient(135deg, var(--bg-soft), var(--bg));
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-light);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.tag:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
}

.empty-state i {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Button override for conferences page */
.conference-list .btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
}

.conference-list .btn:hover {
    box-shadow: var(--shadow-lg);
}

/* === Responsive === */
@media (max-width: 768px) {
    .page-header {
        padding: 4rem 0 3rem;
    }

    .mun-card__header {
        grid-template-columns: 1fr;
    }

    .mun-card__meta {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .mun-card__toggle {
        margin-top: 0;
        margin-left: auto;
    }

    .mun-card__content {
        grid-template-columns: 1fr;
    }

    .filter-bar .container {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 3rem 0 2rem;
    }

    .mun-card__name {
        font-size: 1.25rem;
    }

    .mun-card__header {
        padding: 1rem;
    }

    .mun-card.is-expanded .mun-card__body {
        padding: 1rem;
    }
}

/* ============================================================
   3-Column Layout mit Kalender & Karte
   Echtes Grid-Layout mit sticky Sidebars
   ============================================================ */

.conference-layout {
    background: var(--bg-soft);
    padding: 2rem 0 4rem;
    min-height: 60vh;
    width: 100%;
    max-width: 100vw;
}

.three-column {
    display: grid;
    grid-template-columns: 260px 1fr 260px;
    gap: 2rem;
    align-items: start;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 2rem !important;
    box-sizing: border-box;
}

/* Sidebars - sticky innerhalb ihrer Grid-Zelle */
.sidebar {
    position: sticky;
    top: 180px; /* Unter Navbar (57px) + Filter (~120px) */
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    z-index: 10;
}

.sidebar--left {
    grid-column: 1;
}

.sidebar--right {
    grid-column: 3;
}

.sidebar__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.sidebar__title i {
    color: var(--primary);
}

/* === Mini-Calendar === */
.mini-calendar {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.mini-calendar__month {
    margin-bottom: 1.25rem;
}

.mini-calendar__month:last-of-type {
    margin-bottom: 0.75rem;
}

.mini-calendar__month-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.5rem;
    text-align: center;
}

.mini-calendar__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.mini-calendar__table th {
    color: var(--text-light);
    font-weight: 600;
    padding: 0.25rem;
    text-align: center;
    font-size: 0.65rem;
}

.mini-calendar__table td {
    text-align: center;
    padding: 0.35rem 0.2rem;
    border-radius: 4px;
    cursor: default;
    position: relative;
    transition: all 0.2s;
}

.mini-calendar__table td.empty {
    background: transparent;
}

.mini-calendar__table td.has-event {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.mini-calendar__table td.has-event:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.mini-calendar__table td.is-today {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.mini-calendar__table td.is-today.has-event {
    outline-color: #fff;
}

/* Calendar Legend */
.mini-calendar__legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-light);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.legend-dot--event {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.legend-dot--today {
    background: #fff;
    border: 2px solid var(--accent);
}

.legend-dot--active {
    background: var(--primary);
}

.legend-dot--inactive {
    background: var(--text-light);
    opacity: 0.5;
}

/* === Mini-Map === */
.mini-map {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.mini-map__container {
    position: relative;
    aspect-ratio: 3/4;
    background: linear-gradient(180deg, #e0f2fe 0%, #f0fdf4 100%);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.mini-map__bg {
    position: absolute;
    inset: 5%;
    width: 90%;
    height: 90%;
    object-fit: contain;
    opacity: 0.15;
}

.mini-map__markers {
    position: absolute;
    inset: 0;
}

/* Map Marker - Klickbare Buttons */
.map-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.map-marker__dot {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    background: var(--primary);
}

.map-marker__label {
    display: none;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text);
    background: rgba(255,255,255,0.9);
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.map-marker:hover .map-marker__dot,
.map-marker.is-selected .map-marker__dot {
    transform: scale(1.4);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.5);
}

.map-marker:hover .map-marker__label {
    display: block;
}

.map-marker.is-selected .map-marker__dot {
    background: var(--accent);
    border-color: var(--accent);
}

.map-marker.is-selected .map-marker__label {
    display: block;
    background: var(--accent);
    color: #fff;
}

.map-marker:focus {
    outline: none;
}

.map-marker:focus .map-marker__dot {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3), 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* Empty state für Karte */
.mini-map__empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    padding: 1rem;
}

/* Sidebar Hint */
.sidebar__hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin: -0.5rem 0 1rem;
    font-style: italic;
}

/* Map Legend */
.mini-map__legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* === Leaflet Map Styles === */
.mini-map__leaflet {
    height: 300px;
    border-radius: var(--radius);
    overflow: hidden;
    background: #f8fafc;
}

/* Custom Leaflet Marker */
.leaflet-marker-custom {
    background: transparent;
}

.leaflet-marker-custom .marker-dot {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s, background 0.2s;
}

.leaflet-marker-custom:hover .marker-dot {
    transform: scale(1.3);
    background: var(--accent);
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.leaflet-popup-content {
    margin: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.4;
}

.leaflet-popup-content strong {
    color: var(--primary);
}

/* Hide Leaflet attribution for cleaner look */
.leaflet-control-attribution {
    display: none;
}

/* === Conference List in 3-col === */
.conference-layout .conference-list {
    padding: 0;
    background: transparent;
    min-height: auto;
}

.conference-layout .conference-list .container {
    max-width: none;
    padding: 0;
}

/* Überschreibe für .conference-list im 3-Spalten Layout */
.three-column .conference-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* === Responsive für Sidebars === */
/* Bei mittleren Bildschirmen: nur eine Sidebar */
@media (max-width: 1400px) {
    .three-column {
        grid-template-columns: 1fr 260px;
    }
    
    .sidebar--left {
        display: none;
    }
    
    .sidebar--right {
        grid-column: 2;
    }
}

/* Bei kleinen Bildschirmen: keine Sidebars */
@media (max-width: 1100px) {
    .three-column {
        grid-template-columns: 1fr;
    }
    
    .sidebar--left,
    .sidebar--right {
        display: none;
    }
    
    .conference-layout .conference-list {
        grid-column: 1;
    }
}
