/* assets/css/kurse.css */

/* --- Layout & General --- */
.main-content {
    overflow-x: hidden;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hide-mobile-text { display: inline; }
.btn-responsive-text { display: inline-flex; }

@media (max-width: 768px) {
    .hide-mobile-text { display: none; }
    .btn-responsive-text { padding: 12px; }
    .top-bar { margin-bottom: 1.5rem; }
}

/* Filter Bar */
.filter-bar {
    display: flex; gap: 0.8rem; padding: 1rem; border-radius: 20px; margin-bottom: 2rem;
    align-items: center; flex-wrap: wrap; 
    background: var(--bg-card);
    backdrop-filter: blur(12px); 
    border: var(--glass-border);
    box-shadow: var(--shadow-soft);
}

.filter-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 140px;
}

.filter-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

.filter-input {
    width: 100%;
    padding: 10px 12px 10px 42px; /* Mehr Platz für Icon */
    border-radius: 12px; 
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.6); 
    font-family: var(--font-body); 
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.filter-input:focus {
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(121, 47, 97, 0.1);
}

.filter-wrapper select.filter-input {
    padding-left: 12px; 
    cursor: pointer;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* Kurs Grid */
.courses-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 1.5rem; 
    padding-bottom: 2rem; 
}

.course-card {
    background: var(--bg-card); 
    backdrop-filter: blur(12px); 
    border: var(--glass-border);
    border-radius: 24px; 
    padding: 1.5rem; 
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s; 
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
}
.course-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.15); }

.course-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.course-title { font-size: 1.3rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.3rem; line-height: 1.2; }

.course-date-badge {
    background: var(--accent-1); color: white; padding: 6px 12px;
    border-radius: 12px; font-weight: 700; text-align: center;
    line-height: 1.1; font-size: 0.8rem; display: flex; flex-direction: column;
    box-shadow: 0 4px 10px rgba(121, 47, 97, 0.3);
}
.course-date-badge span { font-size: 1.2rem; font-weight: 800; }

.course-time {
    color: var(--text-muted); display: flex; align-items: center;
    gap: 6px; margin-bottom: 1rem; font-weight: 500; font-size: 0.9rem;
}

.course-cat-tag {
    font-size: 0.7rem; text-transform: uppercase; font-weight: 700;
    padding: 4px 10px; border-radius: 20px; margin-left: auto;
    border: 1px solid currentColor;
}

.course-stats {
    display: flex; align-items: center; gap: 15px; font-size: 0.9rem;
    color: var(--text-main); background: rgba(255,255,255,0.4);
    padding: 10px 14px; border-radius: 12px; margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.course-actions { 
    display: flex; gap: 10px; 
    margin-top: auto; /* Push to bottom */
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.btn-card {
    flex: 1; padding: 10px; border-radius: 14px; border: none; cursor: pointer;
    font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.2s; font-size: 0.9rem;
}
.btn-edit { background: rgba(255,255,255,0.6); color: var(--text-main); border: 1px solid rgba(0,0,0,0.05); }
.btn-edit:hover { background: #fff; transform: translateY(-2px); }
.btn-delete { background: rgba(244, 67, 54, 0.08); color: #d32f2f; }
.btn-delete:hover { background: rgba(244, 67, 54, 0.15); transform: translateY(-2px); }

/* --- MODALS (PURPLE DESIGN) --- */

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
    width: 100%; max-width: 550px;
    background: linear-gradient(145deg, var(--accent-1), #5c234a);
    color: white; 
    padding: 2rem; border-radius: 28px; 
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex; flex-direction: column; 
    max-height: 90vh; overflow-y: auto;
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-card.wide-modal {
    max-width: 900px;
    height: 85vh;
}

.modal-header { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.1); 
    padding-bottom: 1rem;
}
.modal-header h2 { color: white; margin: 0; font-size: 1.5rem; }

.close-btn { 
    background: none; border: none; font-size: 2rem; cursor: pointer; 
    color: rgba(255,255,255,0.7); display: flex; align-items: center;
}
.close-btn:hover { color: white; }

/* Formular im Lila Modal */
.form-group { margin-bottom: 1.5rem; }
.form-group label { 
    display: block; font-size: 0.9rem; font-weight: 500; 
    color: rgba(255,255,255,0.9); margin-bottom: 0.5rem; 
}

/* Series Checkbox Fix */
.series-option {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.checkbox-container {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    font-size: 1rem; font-weight: 600; color: white;
}
.checkbox-container input {
    width: 20px !important; height: 20px; box-shadow: none; margin: 0;
}

/* Inputs hell auf lila */
.modal-card input:not([type="checkbox"]), .modal-card select {
    width: 100%; padding: 12px 16px; border-radius: 12px; border: none;
    background: #ffffff; color: #333; font-family: var(--font-body);
    font-size: 1rem; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.modal-card input:focus, .modal-card select:focus {
    outline: none; box-shadow: 0 0 0 4px rgba(255,255,255,0.3);
}

.modal-footer { display: flex; justify-content: flex-end; gap: 1rem; margin-top: auto; padding-top: 2rem; }

.modal-footer .btn-secondary { color: white; border-color: rgba(255,255,255,0.5); }
.modal-footer .btn-secondary:hover { background: rgba(255,255,255,0.1); }
.modal-footer .btn-primary { background: white; color: var(--accent-1); }
.modal-footer .btn-primary:hover { background: #f0f0f0; }

/* --- TEILNEHMER MANAGER REDESIGN --- */

.pm-layout {
    display: flex; flex-direction: column; height: 100%; overflow: hidden;
}

.pm-actions {
    display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}

.pm-search-wrap {
    flex: 2;
    position: relative;
    display: flex;
    align-items: center;
}
/* Icon ganz links */
.pm-search-wrap i { 
    position: absolute; 
    left: 16px; 
    color: #666; 
    font-size: 1.2rem; 
    z-index: 2; 
}

/* FIX: Padding extrem erhöht (50px), damit Icon niemals im Text ist */
.pm-search-wrap input {
    width: 100%; 
    padding: 12px 12px 12px 55px !important; 
    border-radius: 12px;
    background: white; 
    color: #333;
}

.pm-search-results {
    position: absolute; top: 110%; left: 0; width: 100%;
    background: white; border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-height: 250px; overflow-y: auto; z-index: 50; color: #333;
    display: none;
}

/* FIX: Icons in Suchergebnissen */
.search-result-item {
    padding: 12px 16px; 
    border-bottom: 1px solid #eee; 
    cursor: pointer;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.search-result-item:hover { background: #f5f5f5; }
.search-result-item:last-child { border-bottom: none; }

/* Name links, Icon rechts */
.search-result-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}
.search-result-item i {
    flex-shrink: 0;
}

/* Suche in Gruppen Editor */
.search-wrap-static { position: relative; margin-bottom: 1rem; }
.search-wrap-static input {
    width: 100%; padding: 12px 12px 12px 16px; 
}
.search-results-static {
    position: absolute; top: 100%; left: 0; width: 100%;
    background: white; color: #333; border-radius: 12px; z-index: 50;
    max-height: 200px; overflow-y: auto; display: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.pm-group-add {
    flex: 1; display: flex; gap: 8px;
}
.pm-group-add select { flex: 1; background: white; color: #333; }

.btn-icon-only { width: 46px; padding: 0; justify-content: center; }

/* Group Add Button Fix */
.pm-group-add .btn-secondary {
    border-color: rgba(255,255,255,0.6);
    color: white; 
    background: rgba(255,255,255,0.1);
}
.pm-group-add .btn-secondary:hover {
    background: white; color: var(--accent-1);
}

.pm-list-header {
    display: grid; grid-template-columns: 2fr 1fr 1fr; 
    padding: 0 1rem 0.8rem 1rem;
    font-weight: 600; color: rgba(255,255,255,0.7); 
    font-size: 0.85rem; text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.pm-list {
    flex: 1; overflow-y: auto; padding-top: 0.5rem;
}

.p-item {
    display: grid; grid-template-columns: 2fr 1fr 1fr; 
    padding: 12px 1rem; align-items: center; 
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
}
.p-item:hover { background: rgba(255,255,255,0.05); }

.p-info { display: flex; align-items: center; gap: 10px; }
.p-avatar {
    width: 32px; height: 32px; background: rgba(255,255,255,0.2); 
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
}
.p-name-box { display: flex; flex-direction: column; }
.p-sub { font-size: 0.75rem; opacity: 0.7; }

.p-status-badge {
    padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; 
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    display: inline-block;
}
.st-reg { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.9); }
.st-in { background: #4caf50; color: white; box-shadow: 0 0 10px rgba(76, 175, 80, 0.4); }

.p-actions { text-align: right; display: flex; justify-content: flex-end; gap: 8px; }
.btn-action-small {
    background: rgba(255,255,255,0.1); border: none; color: white;
    width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.btn-action-small:hover { background: white; color: var(--accent-1); }
.btn-delete-small:hover { background: #f44336; color: white; }

/* --- GROUP MANAGER --- */
.groups-layout {
    display: flex; gap: 2rem; height: 100%; overflow: hidden; position: relative;
}
.groups-sidebar {
    flex: 1; border-right: 1px solid rgba(255,255,255,0.15); 
    padding-right: 1.5rem; display: flex; flex-direction: column;
    min-width: 250px;
}
.sidebar-title { color: white !important; margin-bottom: 1rem; }
.editor-title { color: white !important; margin-bottom: 1.5rem; }

.groups-list-container {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 1rem;
}
.group-item {
    background: rgba(255,255,255,0.1); padding: 14px; border-radius: 14px; cursor: pointer;
    transition: all 0.2s; display: flex; justify-content: space-between; align-items: center;
    border: 1px solid transparent;
}
.group-item:hover { background: rgba(255,255,255,0.2); transform: translateX(2px); }
.group-item.active { background: white; color: var(--accent-1); border-color: white; }
.group-item.active small { color: var(--accent-1); opacity: 0.8; }

.groups-editor, .groups-editor-empty { flex: 2; display: flex; flex-direction: column; }
.groups-editor-empty { align-items: center; justify-content: center; opacity: 0.5; text-align: center; }
.groups-editor-empty i { font-size: 4rem; margin-bottom: 1rem; }

.members-preview-list {
    flex: 1; background: rgba(0,0,0,0.15); border-radius: 14px;
    padding: 10px; overflow-y: auto; margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.1);
}
.preview-member {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.preview-member:last-child { border-bottom: none; }

.editor-actions { display: flex; gap: 10px; margin-top: auto; }
.editor-actions button { flex: 1; }

/* FIX: Abbrechen Button im Editor (Modal) auf Weiß zwingen */
.editor-actions .btn-secondary {
    color: white !important;
    border-color: rgba(255,255,255,0.5) !important;
}
.editor-actions .btn-secondary:hover {
    background: rgba(255,255,255,0.1) !important;
}

.mt-2 { margin-top: 1rem; }
.btn-full { width: 100%; }

.empty-hint { padding: 20px; text-align: center; font-style: italic; opacity: 0.6; color: white; }
.loading-state {
    color: var(--text-muted) !important;
    text-align: center; padding: 2rem; font-style: italic;
    grid-column: 1 / -1;
}

/* Neuer Kurs: Pre-Selection List */
.pre-add-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.pre-add-search { position: relative; margin-bottom: 1rem; }

/* FIX: Input Padding für neuen Kurs */
.pre-add-search input { 
    width: 100%; 
    padding: 10px 12px 10px 45px !important; 
}
.pre-add-search i { 
    position: absolute; 
    left: 14px; 
    top: 10px; /* Zentriert */
    color: #666; 
    font-size: 1.1rem; 
    z-index: 2; 
}

.pre-add-list {
    background: rgba(0,0,0,0.15); border-radius: 12px; padding: 10px;
    max-height: 150px; overflow-y: auto;
}