/* 
 * Pirates Park FKK Saunaclub
 * Events Seite CSS
 */

/* Verbessertes Modal-Styling für Events */
.event-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.modal-content {
    background-image: url('../img/backgrounds/pergament.png');
    background-size: cover;
    width: 90%;
    max-width: 600px; /* Breiter gemacht */
    max-height: 80vh;
    border-radius: 15px; /* Größer gerundete Ecken */
    padding: 2.5rem; /* Mehr Padding */
    position: relative;
    color: #5A3921;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); /* Stärkerer Schatten */
    animation: modalEnter 0.4s ease-out;
    /* Maske für den Transparenzverlauf */
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%);
}

@keyframes modalEnter {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #5A3921;
    font-size: 34px; /* Größer */
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: rgba(90, 57, 33, 0.1);
}

.close-modal:hover {
    color: #C04000;
    background-color: rgba(90, 57, 33, 0.2);
    transform: rotate(90deg);
}

.modal-content h3 {
    color: #5A3921;
    font-size: 2rem; /* Größer */
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px dashed #5A3921;
    padding-bottom: 3rem;
}

.event-list {
    margin: 4.5rem;
    min-height: 200px;
}

.modal-event {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed #5A3921;
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
    animation-delay: calc(var(--index, 0) * 0.1s);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-event h4 {
    font-size: 1.6rem; /* Größer */
    margin-bottom: 0.8rem;
    color: #5A3921;
}

.modal-event p {
    font-size: 1.2rem; /* Größer */
    line-height: 1.6;
}

.modal-event:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.no-events-message {
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
    color: #8a6d56;
}

/* Events Calendar Styles */
.event-calendar-section {
    margin: 3rem 0;
}

.calendar-container {
    max-width: 100%;
    overflow: hidden; /* Verhindert horizontales Scrollen */
    margin: 0 auto;
    padding: 0 1rem;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.calendar-nav-button {
    background-color: var(--mahogany);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-nav-button:hover {
    background-color: #A33500;
}

.calendar-nav-button.active {
    transform: scale(0.95);
}

.current-month {
    font-size: 1.5rem;
    color: var(--gold);
    text-align: center;
    flex-grow: 1;
}

#eventsCalendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr)); /* Verhindert Überlaufen */
    width: 100%;
    gap: 2px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    overflow: hidden; /* Wichtig für mobile Anzeige */
    box-sizing: border-box; /* Stellt sicher, dass der Rahmen die Gesamtgröße nicht überschreitet */
}

/* Entfernen von Inline-Styles, die möglicherweise im JS gesetzt werden */
.calendar-row {
    display: contents;
    width: 100%;
}

.calendar-cell {
    position: relative;
    aspect-ratio: 1; /* Quadratische Zellen */
    min-width: 0; /* Verhindert Überlauf */
    overflow: hidden; /* Clipt überlaufenden Inhalt */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: clamp(0.7rem, 1.5vw, 1rem); /* Responsive Schriftgröße */
    padding: 0.5rem;
    background-color: rgba(18, 18, 18, 0.7);
    color: white;
    transition: all 0.3s ease;
}

.calendar-cell.weekday {
    background-color: rgba(192, 64, 0, 0.7);
    font-weight: bold;
    min-height: 40px;
    color: var(--gold);
}

.calendar-cell.today {
    background-color: rgba(0, 100, 0, 0.3);
    border: 2px solid var(--gold);
}

.calendar-cell.empty {
    background-color: rgba(18, 18, 18, 0.4);
}

.calendar-cell.has-events {
    background-color: rgba(212, 175, 55, 0.2);
    cursor: pointer;
}

.calendar-cell.has-events:hover {
    background-color: rgba(212, 175, 55, 0.3);
    transform: scale(1.02);
}

/* Anpassungen für die Marker */
.day-events {
    position: absolute;
    bottom: 3px;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0 2px;
}

.event-marker {
    width: min(6px, 6%);
    height: min(6px, 6%);
    min-width: 3px;
    min-height: 3px;
    background-color: var(--gold);
    border-radius: 50%;
    display: inline-block;
}

/* "Mehr"-Indikator für zusätzliche Events */
.more-marker {
    font-size: 0.6rem;
    color: var(--gold);
    margin-left: 2px;
}

/* Event-Karten */
.events-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem; /* Erhöhter Abstand zwischen den Karten */
    margin: 3rem 0;
    padding: 0 1.5rem; /* Zusätzlicher seitlicher Abstand */
}

.event-card {
    background-image: url('../img/backgrounds/pergament.png');
    background-size: cover;
    border-radius: 10px;
    overflow: hidden;
    padding: 2.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: #5A3921;
    transition: all 0.3s ease;
    transform: rotate(-1deg);
    position: relative;
    margin: 0.5rem 1rem; /* Zusätzlicher Rand für besseren Abstand */

    /* Maske für den Transparenzverlauf */
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 90%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 90%, rgba(0, 0, 0, 0) 100%);
}

.event-card:nth-child(even) {
    transform: rotate(1deg);
}

.event-card:hover {
    transform: translateY(-5px) rotate(0);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Neue Styles für Bild-Element */
.event-card .event-image {
    position: relative;
    height: 180px;
    overflow: hidden;
        margin: -1.1rem -5rem 1.5rem 0rem; /* Negatives margin, um an den Rand zu gehen */
    border-radius: 10px 10px 0 0; /* Abrunden nur oben */
}

.event-card .event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.event-card:hover .event-image img {
    transform: scale(1.1);
}

.event-card .event-date-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--mahogany);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Anpassung der bestehenden Event-Elemente */
.event-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px dashed #5A3921;
    padding-bottom: 1rem;
	background: none !important;
}

.event-header h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #5A3921;
}

/* Tablet-Anpassungen */
@media (max-width: 992px) {
    .events-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .event-card {
        margin: 0.5rem;
    }
}

/* Mobile-Anpassungen */
@media (max-width: 768px) {
    .events-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .event-card {
        margin: 0.25rem 0.5rem;
    }
    
    .event-card .event-image {
        height: 160px;
    }
}

.event-card:hover {
    transform: translateY(-5px) rotate(0);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.event-card.ghost-effect {
    animation: cardFloat 4s infinite ease-in-out;
}

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0) rotate(-1deg);
    }
    50% {
        transform: translateY(-10px) rotate(1deg);
    }
}

.event-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px dashed #5A3921;
    padding-bottom: 1rem;
}

.event-header h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #5A3921;
}

.event-schedule {
    font-size: 1.1rem;
    color: #8A6D56;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.event-schedule.recurring {
    font-style: italic;
}

.event-date, .event-time {
    display: flex;
    align-items: center;
}

.event-date::before {
    content: '\f073'; /* Calendar icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 0.5rem;
}

.event-time::before {
    content: '\f017'; /* Clock icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 0.5rem;
}

.event-content {
    font-size: 1.1rem;
    line-height: 1.6;
	font-weight: bold;
}

.event-special-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(90, 57, 33, 0.1);
    border-radius: 8px;
    font-style: italic;
}

.no-events {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background-color: rgba(18, 18, 18, 0.7);
    border-radius: 10px;
    color: var(--silver);
    font-style: italic;
}

/* Spezifische Tablet-Anpassungen */
@media (max-width: 992px) {
    .calendar-container {
        padding: 0 0.5rem;
    }
    
    .calendar-cell {
        padding: 0.3rem;
    }
    
    .calendar-cell.weekday {
        font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    }

    .events-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Spezifische Mobile-Anpassungen */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 2rem;
    }
    
    .modal-content h3 {
        font-size: 1.8rem;
    }
    
    .modal-event h4 {
        font-size: 1.4rem;
    }
    
    .modal-event p {
        font-size: 1.1rem;
    }

    .event-list {
        margin: 2rem;
    }

    .calendar-container {
        padding: 0;
    }
    
    .calendar-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .calendar-nav-button {
        width: 100%;
    }
    
    #eventsCalendar {
        gap: 1px;
    }
    
    .calendar-cell {
        padding: 0.2rem;
        font-size: clamp(0.6rem, 3vw, 0.8rem);
    }
    
    .calendar-cell.weekday {
        font-size: clamp(0.6rem, 3vw, 0.8rem);
        padding: 0.2rem;
        min-height: 30px;
    }
    
    .day-events {
        bottom: 1px;
        gap: 1px;
    }
    
    .event-marker {
        width: 4px;
        height: 4px;
        min-width: 3px;
        min-height: 3px;
    }

    .events-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem;
    }
    
    .modal-content h3 {
        font-size: 1.6rem;
    }
    
    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 28px;
    }

    .calendar-navigation {
        margin-bottom: 0.5rem;
    }
    
    .current-month {
        font-size: 1.2rem;
        width: 100%;
        order: -1;
        margin-bottom: 0.5rem;
    }
    
    .calendar-nav-button {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .calendar-cell {
        font-size: 0.6rem;
        padding: 0.1rem;
    }
    
    .calendar-cell.weekday {
        font-size: 0.6rem;
        min-height: 25px;
    }
    
    .event-marker {
        width: 3px;
        height: 3px;
    }

    .event-card {
        padding: 1.5rem;
    }

    .event-header h3 {
        font-size: 1.5rem;
    }

    .event-schedule {
        font-size: 0.9rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}