/**
 * Fastenzentrale Termine Plugin Styles
 * Author: Frank Heuser / screenteam
 */

/* Container und Layout */


.fzt-card {
    border-radius: var(--radius-l);
    background-color: var(--neutral-light-trans-30);
    border: 1px solid var(--neutral-light-trans-30);
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: var(--space-s);
    margin-bottom: 35px;
    opacity: 0;
    animation: 0.5s ease 0s fadeInUp;
    animation-fill-mode: forwards;
}

.fzt-termine-list .clickable-parent {
  
position: relative;
isolation: isolate;
cursor: pointer;

transition: top 0.1s ease-out,  box-shadow 0.1s ease-out;

box-shadow: 0px 2px 5px -3px rgba(0,0,0,0.2);
top: 0px;

&:has(.clickable-element:hover) {

box-shadow: 0px 3px 6px -1px rgba(0,0,0,0.2);
top:-3px;
      
}
}

.fzt-termine-list .clickable-parent .clickable-element a {

      pointer-events: all;

      &::after {
          content: "";
          display: block;
          position: absolute;
          inset: 0;
          

          /* This makes text selectable but un-clickable: */
          /* z-index: -1; */
          /*touch-action: manipulation;*/
      }
      
      /* Any filters applied to this element will
           cause bugs: no click event + hover glitch */
      /* (You can filter the parent instead—see above) */
      & {
          filter: none !important; 
          transform: none !important; scale: none !important;
          translate: none !important; rotate: none !important;
      }
  }


.fzt-card-date-row {
display: flex;
justify-content: space-between;
width: 100%;
margin-bottom:15px;
}

.fzt-card-icons {
    display: flex;
    column-gap: 12px;
    row-gap: 10px;
    flex-wrap: wrap;
    position: absolute;
    top: -3px;
    right: 4%;
}

.fzt-card-icon {
    background-color: var(--white);
    font-size: 25px;
    padding-top: 10px;
    padding-right: 10px;
    padding-bottom: 10px;
    padding-left: 10px;
    border-bottom-right-radius: var(--radius-l);
    border-bottom-left-radius: var(--radius-l);
    box-shadow: -1px 2px 4px 0 var(--neutral-ultra-dark-trans-10);
    width: 45px;
    display: flex;
    justify-content: center;
}

.fzt-card-heading {
    color: var(--primary);
    font-family: "Oswald";
    font-size: var(--h3);
}

.fzt-card-subheading {
    font-size: 21px;
    margin-bottom:15px;
}

.fzt-card-fastenart {
    margin-bottom:15px;
}

.fzt-card-preis-row {
    display: flex;
justify-content: space-between;
width: 100%;
}


/* Loading und Error States */

.fzt-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}



/* Filter Chips */
.fzt-filter-chips {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fzt-chip {
    display: inline-flex;
    align-items: center;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1;
}

.fzt-chip-close {
    margin-left: 0.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-right: -7px;
}

.fzt-chip-close:hover {
    background: rgba(255, 255, 255, 0.2);
}


/*









*/


.fzt-filter-container {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.fzt-filter-group {
    margin-bottom: 1.5rem;
}

.fzt-filter-group:last-child {
    margin-bottom: 0;
}

.fzt-filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 14px;
}

/* Eingabefelder */
.fzt-filter-group input[type="text"],
.fzt-filter-group select {
    width: 100%;
    max-width: 300px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.fzt-filter-group input[type="text"]:focus,
.fzt-filter-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Checkbox und Radio Buttons */
.fzt-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.fzt-filter-option {
    display: flex;
    align-items: center;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
}

.fzt-filter-option input[type="checkbox"],
.fzt-filter-option input[type="radio"] {
    margin-right: 0.5rem;
}

.fzt-filter-option label {
    font-weight: normal;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
}

.fzt-filter-count {
    color: #666;
    font-size: 12px;
    margin-left: 0.25rem;
}

/* Styling für Optionen mit 0 Treffern */
.fzt-no-results-option {
    opacity: 0.6;
}

.fzt-no-results-option label {
    color: #999;
}

.fzt-no-results-option .fzt-filter-count {
    color: #ccc;
}

/* Hover-Effekt auch für 0-Treffer */
.fzt-no-results-option:hover label {
    color: #666;
}

/* Sortierung */
.fzt-sorting {
    margin-bottom: 1.5rem;
}

.fzt-sorting label {
    display: inline-block;
    margin-right: 0.5rem;
    font-weight: 600;
}

.fzt-sorting select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}


/* Reset Button */
.fzt-reset-button {
    background: #dc3232;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.fzt-reset-button:hover {
    background: #c62d2d;
}

/* Termine Cards */
/*
.fzt-termine-list {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
*/
.fzt-termin-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.fzt-termin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.fzt-termin-card:nth-child(odd) {
    animation-delay: 0.1s;
}

.fzt-termin-card:nth-child(even) {
    animation-delay: 0.2s;
}

.fzt-termin-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.2rem;
    line-height: 1.4;
}

.fzt-titel {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.2rem;
    line-height: 1.4;
}

.fzt-termin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.fzt-termin-meta span {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 12px;
    color: #666;
}

.fzt-datum {
    background: #e8f4f8 !important;
    color: #0073aa !important;
    font-weight: 600;
}

.fzt-ort {
    background: #f0f6ff !important;
    color: #0066cc !important;
}

.fzt-kategorie {
    background: #fff2e8 !important;
    color: #d63638 !important;
}

.fzt-veranstalter {
    background: #f0fff0 !important;
    color: #28a745 !important;
}

.fzt-beschreibung {
    color: #666;
    line-height: 1.5;
    font-size: 14px;
}

.fzt-beschreibung p {
    margin-bottom: 0.5rem;
}

.fzt-beschreibung p:last-child {
    margin-bottom: 0;
}

/* Load More Button */
.fzt-load-more {
    display: block;
    margin: 2rem auto;
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.fzt-load-more:hover:not(:disabled) {
    background: #005a87;
}

.fzt-load-more:disabled {
    background: #ccc;
    cursor: not-allowed;
}



.fzt-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

/* Animationen */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Flatpickr Anpassungen */
.flatpickr-calendar {
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.flatpickr-day.selected {
    background: #0073aa;
    border-color: #0073aa;
}

.flatpickr-day.selected:hover {
    background: #005a87;
    border-color: #005a87;
}

.flatpickr-day.today {
    border-color: #0073aa;
}

.flatpickr-day.today:hover {
    background: #0073aa;
    color: white;
}

/* Focus States für Barrierefreiheit */
.fzt-filter-group input:focus,
.fzt-filter-group select:focus,
.fzt-load-more:focus,
.fzt-reset-button:focus,
.fzt-chip-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.fzt-filter-option input:focus + label {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fzt-filter-container {
        padding: 1rem;
    }
    
    .fzt-filter-group input[type="text"],
    .fzt-filter-group select {
        max-width: 100%;
    }
    
    .fzt-filter-options {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .fzt-filter-option {
        margin-right: 0;
    }
    
    .fzt-termine-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .fzt-termin-card {
        padding: 1rem;
    }
    
    .fzt-filter-chips {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fzt-chip {
        margin-bottom: 0.25rem;
    }
    
    .fzt-sorting {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fzt-sorting label {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .fzt-sorting select {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .fzt-termin-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .fzt-termin-meta span {
        display: block;
        text-align: center;
    }
    
    .fzt-filter-container {
        padding: 0.75rem;
    }
    
    .fzt-termin-card {
        padding: 0.75rem;
    }
    
    .fzt-load-more {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Print Styles */
@media print {
    .fzt-filter-container,
    .fzt-filter-chips,
    .fzt-sorting,
    .fzt-load-more,
    .fzt-reset-button {
        display: none !important;
    }
    
    .fzt-termin-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
    
    .fzt-termine-list {
        grid-template-columns: 1fr;
    }
    
    .fzt-termin-card:hover {
        transform: none;
    }
}

/* Dark Mode Support (falls Theme unterstützt) */
@media (prefers-color-scheme: dark) {
    .fzt-filter-container {
        background: #2c2c2c;
        border-color: #444;
        color: #fff;
    }
    
    .fzt-filter-group label {
        color: #fff;
    }
    
    .fzt-filter-group input[type="text"],
    .fzt-filter-group select {
        background: #333;
        border-color: #555;
        color: #fff;
    }
    
    .fzt-filter-group input[type="text"]:focus,
    .fzt-filter-group select:focus {
        border-color: #0073aa;
    }
    
    .fzt-termin-card {
        background: #2c2c2c;
        border-color: #444;
        color: #fff;
    }
    
    .fzt-termin-card h3,
    .fzt-titel {
        color: #fff;
    }
    
    .fzt-beschreibung {
        color: #ccc;
    }

    
    .fzt-no-results {
        background: #2c2c2c;
        color: #ccc;
        border-color: #555;
    }
}

/* Accessibility Improvements */
.fzt-chip-close {
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.fzt-chip-close:focus {
    outline: 2px solid white;
    outline-offset: 1px;
}

.fzt-filter-option input:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Loading Animation Verbesserungen */
.fzt-loading {
    position: relative;
    top:0px;
}

.fzt-termine-list[data-loading="true"] {
    min-height: 200px;
    position: relative;
}

/* Smooth Transitions */
.fzt-termine-list,
.fzt-filter-chips {
    transition: opacity 0.3s ease;
}

/* Hover Effekte */
.fzt-filter-option:hover label {
    color: #0073aa;
}

.fzt-sorting select:hover {
    border-color: #0073aa;
}

/* Custom Scrollbar für Filter-Container */
.fzt-filter-options::-webkit-scrollbar {
    width: 6px;
}

.fzt-filter-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.fzt-filter-options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.fzt-filter-options::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* CSS für deaktivierte Filter-Optionen */
.fzt-disabled-option {
    opacity: 0.6;
    pointer-events: none;
}

.fzt-disabled-label {
    color: #999 !important;
    cursor: not-allowed !important;
}

.fzt-filter-options select option:disabled {
    color: #999;
    background-color: #f5f5f5;
}

.fzt-filter-options input:disabled + label {
    color: #999;
    cursor: not-allowed;
}

.fzt-filter-options input:disabled {
    cursor: not-allowed;
}

/* Ausgewählte aber deaktivierte Optionen anders kennzeichnen */
.fzt-disabled-option input:checked + label {
    color: #666;
    text-decoration: line-through;
}

/* Gruppierungs-Überschriften Styles */
.fzt-group-header {
    margin: 30px 0 15px 0;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #007cba;
    font-size: 1.1em;
    font-weight: 600;
    color: #495057;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Erste Überschrift ohne oberen Margin */
.fzt-group-header:first-child {
    margin-top: 0;
}

/* Spezifische Styles für Datums-Gruppierung */
.fzt-group-date {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

.fzt-group-date::before {
    content: "📅 ";
    margin-right: 8px;
}

/* Spezifische Styles für Alphabet-Gruppierung */
.fzt-group-alpha {
    border-left-color: #6f42c1;
    background: linear-gradient(135deg, #faf9ff 0%, #f0ebff 100%);
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fzt-group-alpha::before {
    content: "";
    width: 40px;
    height: 40px;
    background: #6f42c1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
}

/* Termine unter Überschriften */
.fzt-group-header + .fzt-termin-card {
    margin-top: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fzt-group-header {
        margin: 20px 0 10px 0;
        padding: 8px 12px;
        font-size: 1em;
    }
    
    .fzt-group-alpha {
        font-size: 1.2em;
        min-height: 35px;
    }
    
    .fzt-group-alpha::before {
        width: 30px;
        height: 30px;
        margin-right: 10px;
    }
}

/* Animation für Gruppierungs-Headers */
.fzt-group-header {
    animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);

    }
    to {
        opacity: 1;
        transform: translateY(0);
   
    }
}