/* Accordion Content Grid (66:33) */
.course-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: flex-start;
}
.course-description-left {
    /* left column: description */
    padding-top: 12px;
}
.course-description-right {
    /* right column: registration info */
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    font-size: 1em;
    color: #333;
}

.course-registration-info {
    margin-bottom: 12px;
}

.registration-label {
    font-weight: bold;
    color: #000080;
    /* font-size: 1.05em; */
}
.registration-text {
    display: block;
    margin-top: 8px;
    color: #333;
}
/**
 * TSV Riederich Course Management - Frontend Styles
 * Matching the design of https://www.tsv-riederich.de/
 */

/* Main Container */
.tsv-course-list {
    max-width: 1200px;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    color: #333;
}

/* Page Title - Maximum Priority Override */
html body .tsv-course-list h2,
html body div.tsv-course-list h2,
html body .tsv-course-list > h2,
html body .tx-coursemanagement .tsv-course-list h2,
html body .content .tsv-course-list h2,
html body #content .tsv-course-list h2,
.tsv-course-list h2.course-title,
.tsv-course-list h2 {
    color: #000080 !important;
    font-size: 2em !important;
    margin-bottom: 30px !important;
    padding-bottom: 10px !important;
    font-weight: bold !important;
}

/* Additional ultra-specific override */
html body * .tsv-course-list h2 {
    color: #000080 !important;
}

/* Emergency override class - use this if nothing else works */
.force-blue-title,
h2.force-blue-title,
.tsv-course-list .force-blue-title {
    color: #000080 !important;
}

/* ========================================
   SPARTEN-FILTER TABS
   ======================================== */

/* Tab Container */
.sparten-filter-container {
    margin: 20px 0 30px 0;
}

/* Tab Navigation */
.sparten-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 0;
}

/* Individual Tab Button */
.sparten-tab {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    padding: 12px 20px;
    margin-right: 2px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: bold;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
    top: 1px;
}

/* Tab Hover State */
.sparten-tab:hover {
    background: #e9ecef;
    color: #000080;
}

/* Active Tab */
.sparten-tab.active {
    background: #fff;
    color: #000080;
    border-color: #000080;
    border-bottom: 2px solid #fff;
    z-index: 1;
}

/* Tab Count Badge */
.tab-count {
    font-size: 0.85em;
    color: #999;
    font-weight: normal;
    margin-left: 5px;
}

.sparten-tab.active .tab-count {
    color: #000080;
}

/* Sparten Content Areas */
.sparten-content {
    display: none; /* Hidden by default, shown via JavaScript */
}

.sparten-content.active {
    display: block;
}

/* Mobile Responsive Tabs */
@media (max-width: 768px) {

    .appointmentcount-block {
        display: block;
        margin-top: 2px;
    }
    .sparten-tabs {
        flex-direction: column;
        border-bottom: none;
    }
    
    .sparten-tab {
        margin-right: 0;
        margin-bottom: 2px;
        border: 1px solid #e0e0e0;
        top: 0;
    }
    
    .sparten-tab.active {
        border-bottom: 1px solid #000080;
    }
}

/* Course Grid Layout */
.course-grid {
    display: grid;
    /* 2cards per row: */
    /* grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); */
    /* 1 card per row: */
    grid-template-columns: repeat(auto-fit, minmax(550px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Course Grid inside Sparten Tabs - reduce top margin */
.sparten-content .course-grid {
    margin-top: 0;
}

/* Individual Course Cards - NUR EIN BORDER */
.course-accordion {
    background: #fff;
    border: 1px solid #e0e0e0;  /* DER EINZIGE Border */
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

/* ALLE Kind-Elemente: KEIN Border */
.course-accordion *,
.course-accordion *::before,
.course-accordion *::after {
    /* border: none !important; */
}

.course-accordion:hover {
    /* box-shadow: 0 4px 15px rgba(0,0,0,0.15); */
    transform: translateY(-2px);
}

/* Department Badge */
.course-department-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #fff;
    color: #000080;
    padding: 8px 15px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #000080 !important;
}

/* Course Title */
.course-accordion h3 {
    color: #000080;
    font-size: 1.6em;
    margin: 0 0 6px 122px;
    padding-right: 80px; /* Space for department badge */
    line-height: 1.3;
}

/* Appointment Row Styles */
.appointment-row {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    padding: 4px 0;
}

.appointment-row:not(:last-child) {
    border-bottom: 0px solid #e0e0e0;
}

.appointment-course-number-addon {
    margin-left: 0px;
}

.appointment-start-time {
    margin-left: 8px;
}

/* Time Information Container */
.course-time-container {
    background: #f8f9fa;
    padding: 12px;
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.course-day-time {
    display: flex;
    /* align-items: center; */
    align-items: flex-end; /* Toggle oben ausrichten */
    justify-content: space-between;
    font-weight: bold;
    color: #000080;
}

.season-time {
    font-size: 0.9em;
    color: #555;
    font-weight: normal;
    margin: 0 0 4px 114px;
}

.time-location-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.course-location-inline {
    margin-left: 10px;
    color: #000080;
    font-weight: bold;
    font-size: 0.9em;
}

.course-trainer-inline {
    font-size: 0.9em;
    color: #333;
    margin-left: 114px;
    padding-left: 10px;
}

.appointment-location {
    color: #000080;
    font-weight: normal;
}

.trainer-name {
    color: #333;
    font-weight: bold;
}

.trainer-contact {
    color: #666;
    font-style: italic;
    margin-left: 8px;
}

.course-teaser-inline {
    font-size: 1em;
    color: #555;
    padding-left: 10px;
    padding-top: 5px;
    line-height: 1.3;
    /* font-style: italic; */
    border-left: 0px solid #e0e0e0;
    margin: 5px 0px 14px 114px
}

.course-day {
    /* background: #e8f0fe; */
    background: #fff;
    padding: 5px 10px;
    font-size: 0.9em;
    width: 100px;
    text-align: center;
    border: 1px solid #000080;
    display: inline-block;
}

/* Information Grid */
.course-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.course-info-item {
    display: flex;
    flex-direction: column;
}

.course-info-label {
    font-weight: bold;
    color: #666;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.course-info-value {
    color: #333;
    font-size: 0.95em;
    line-height: 1.4;
}

/* Location Information */
.course-location {
    grid-column: 1 / -1;
    background: #fff3cd;
    padding: 10px;
    margin-top: 10px;
}

/* Age Badge */
.course-age-badge {
    background: #17a2b8;
    color: white;
    padding: 4px 8px;
    font-size: 0.8em;
    font-weight: bold;
    display: inline-block;
}

/* No Courses Message */
.no-courses-message {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    color: #666;
    font-size: 1.1em;
}

/* Filter Section (for future use) */
.course-filters {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 30px;
}

.filter-title {
    color: #000080;
    font-size: 1.2em;
    margin-bottom: 15px;
    font-weight: bold;
}

.filter-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-item label {
    font-weight: bold;
    color: #666;
    font-size: 0.9em;
}

.filter-item select {
    padding: 8px 12px;
    font-size: 0.9em;
    background: white;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .tsv-course-list {
        padding: 15px;
    }
    
    .course-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .course-info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .course-day-time {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .course-accordion h3 {
        padding-right: 0;
        margin-bottom: 25px; /* More space for badge */
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }
    
    .course-department-badge {
        position: static;
        display: inline-block;
        margin-bottom: 10px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-item {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .course-accordion {
        break-inside: avoid;
        box-shadow: none;
        margin-bottom: 20px;
    }
    
    .course-accordion:hover {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .course-accordion {
    }
    
    .course-department-badge {
        background: #000;
    }
    
    .course-day {
        background: #000;
        color: #fff;
    }
}

/* Accessibility Improvements */
.course-accordion:focus-within {
    /*outline: 2px solid #000080;
    outline-offset: 2px;*/
}

.course-info-label {
    /* Ensure labels are announced properly by screen readers */
    display: block;
}

/* Animation for loading state */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-accordion {
    animation: fadeIn 0.6s ease-out;
}

/* Stagger animation for cards */
.course-accordion:nth-child(1) { animation-delay: 0.1s; }
.course-accordion:nth-child(2) { animation-delay: 0.2s; }
.course-accordion:nth-child(3) { animation-delay: 0.3s; }
.course-accordion:nth-child(4) { animation-delay: 0.4s; }
.course-accordion:nth-child(5) { animation-delay: 0.5s; }
.course-accordion:nth-child(6) { animation-delay: 0.6s; }

/* ========================================
   ACCORDION FUNCTIONALITY
   ======================================== */

/* Course Card Header (clickable area) */
.course-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0;
}

.course-accordion-header:hover {
    background-color: rgba(0, 0, 128, 0.05);
}

.course-accordion-main {
    flex: 1;
    min-width: 0; /* Prevent flex item from growing too large */
}

/* Accordion Toggle Arrow */
.course-accordion-toggle {
    flex-shrink: 0;
    padding: 8px 12px;
    margin-left: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(0, 0, 128, 0.1);
}

.course-accordion-toggle:hover {
    background: rgba(0, 0, 128, 0.2);
}

.accordion-arrow {
    font-size: 16px;
    color: #000080;
    font-weight: bold;
    transition: transform 0.3s ease;
    display: inline-block;
}

.accordion-info-text {
    color: #333;
    font-weight: normal;
    font-style: italic;
    margin: 0px 8px 0px 8px;
}

/* Rotated arrow when expanded */
.course-accordion.expanded .accordion-arrow {
    transform: rotate(180deg);
}

/* Aufgeklappte Karte - DERSELBE Border wird dicker und blauer */
.course-accordion.expanded {
    border: 1px solid #000080;  /* DERSELBE Border, nur dicker und blau */
}

/* Course Card Body - always visible part */
.course-accordion-body {
    position: relative;
}

/* Accordion Content - collapsible part */
.course-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    padding: 0 20px;
    background: transparent;
    margin-top: 0;
}

/* Expanded state */
.course-accordion.expanded .course-accordion-content {
    max-height: 1000px; /* Erhöht für längere Beschreibungstexte */
    padding: 0px 20px 20px 20px;
}

/* Course Description Styling */
.course-description {
    padding: 0px;
    margin-left: 106px;
    background: transparent;
}

.course-description-title {
    color: #000080;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 8px;
}

.course-description-teaser {
    color: #333;
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 0;
}

.course-description-text {
    color: #444;
    line-height: 1.6;
    font-size: 0.95em;
}

.course-description-text p {
    margin-bottom: 10px;
}

.course-description-empty {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 15px 0;
}

/* Hover effects for better UX */
.course-accordion:hover .course-accordion-toggle {
    background-color: rgba(0, 0, 128, 0.1);
}


@media (max-width: 1200px) {
    .appointment-start-time {
    margin-left: 0px !important;
    }    
    .course-description {
        margin-left: 0px;
    }
    .course-description-right {
        font-size: 0.9em;
    }
    .course-day-time {
        font-size: 0.9em;
    }    
    .accordion-info-text {
        font-size: 0.9em;
    }
}

@media (max-width: 500px) {

    .trainer-contact {
        display: block;
        margin-top: 4px;
    }

    .course-day {
        padding: 5px 0px;
        width: 80px;
    }

}

/* Mobile responsiveness for accordion */
@media (max-width: 768px) {
    .course-time-container {
        padding: 8px 10px;
        margin: 10px 0;
    }
    
    .course-day-time {
        gap: 8px;
        font-size: 0.9em;
    }
    
    .course-accordion {
        padding: 4px;
    }

    .course-accordion-toggle {
        padding: 6px 8px;
        margin-left: 8px;
    }
    
    .accordion-arrow {
        font-size: 14px;
    }
    
    .course-accordion-content {
        padding: 0 15px;
    }
    
    .course-accordion.expanded .course-accordion-content {
        padding: 15px;
    }
}

/* Sparten Tabs - Appointment Row Display */
.sparten-content .course-day-time .time-location-info {
    display: block;
    gap: 0;
}

.appointment-row {
  display: flex;
  align-items: flex-start;
}
.course-day-nowrap {
  flex-shrink: 0;
  white-space: nowrap;
  margin-right: 0.5em;
}
.appointment-details-location-block {
  min-width: 0;
  display: block;
  /* Optional: flex: 1; */
  padding-top: 4px;
}

@media (max-width: 424px) {
    .course-content-grid {
        display: grid;
        grid-template-columns: 1fr;
    }
    /* Accordion und Grid exakt so breit wie Filter-Boxen */
    .sparten-content {
        max-width: 100vw;
        /*padding: 0 2vw;*/
    }
    .course-grid {
        display: block;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
    .course-accordion {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}