body {
    font-family: Arial, sans-serif;
    margin: 10px;
}

h1 {
    font-size: 22px;
    text-align: center;
}

.view-switch, .nav {
    text-align: center;
    margin: 10px 0;
}

button {
    padding: 6px 12px;
    margin: 0 5px;
    cursor: pointer;
}

#calendar-root {
    width: 100%;
}

/* Monatscontainer */
.month {
    border: 1px solid #ccc;
    margin: 5px;
    padding: 5px;
}

.month-header {
    text-align: center;
    font-weight: bold;
    margin-bottom: 5px;
}

/* Grid */
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.weekday {
    font-weight: bold;
    text-align: center;
    background: #eee;
    padding: 4px;
}

.day {
    position: relative;
    width: 40px;       /* Kachelbreite */
    height: 40px;      /* gleiche Höhe → Quadrat */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;       /* Tageszahl im Vordergrund */
    box-sizing: border-box;
	border: 1px solid #ccc;
}

.day.arrival::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    border-top: 40px solid white;
    border-right: 40px solid transparent;
    z-index: 5;
}

.day.departure::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    border-bottom: 40px solid white;
    border-left: 40px solid transparent;
    z-index: 5;
}

.day span {
    position: relative;
    z-index: 10;
}


/* ⭐ Back-to-back: dunklere Schraffur + dünner Rahmen */
/*
.day.backtoback {
    background: repeating-linear-gradient(
        45deg,
        #ff9999,
        #ff9999 4px,
        #ff6666 4px,
        #ff6666 8px
    );
    border: 1px solid #cc0000;
}

/* dezenter, weicher Rahmen, helle rote Schraffur */
/* .day.backtoback {
    background: repeating-linear-gradient(
        45deg,
        #ffb3b3,
        #ffb3b3 4px,
        #ff9999 4px,
        #ff9999 8px
    );
    border: 1px solid #d66;
}
*/

/* duenner Rahmen um die Anreise-Abreise Tageskachel */
/*
.day.backtoback {
    background: none;
    border: 1px solid #e88;
}
*/

.day.backtoback {
    background: repeating-linear-gradient(
        45deg,
        rgba(212,0,23,0.15),
        rgba(212,0,23,0.15) 4px,
        rgba(212,0,23,0.05) 4px,
        rgba(212,0,23,0.05) 8px
    );
    border: 2px solid #e88;
}




/* Fülltage */
.filler {
    background: white;
}

/* freie Tage */
.free span {
    color: rgb(96, 123, 108);
}

/* belegte Tage */
.booked {
    background: repeating-linear-gradient(
        45deg,
        rgba(212,0,23,0.15),
        rgba(212,0,23,0.15) 4px,
        rgba(212,0,23,0.05) 4px,
        rgba(212,0,23,0.05) 8px
    );
}

.booked span {
    color: rgb(212,0,23);
}

/* Anreise Dreieck */
.arrival::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    border-top: 12px solid rgb(212,0,23);
    border-right: 12px solid transparent;
}

/* Abreise Dreieck */
.departure::after {
    content: "";
    position: absolute;
    bottom: 0; right: 0;
    border-bottom: 12px solid rgb(212,0,23);
    border-left: 12px solid transparent;
}

/* Layout für 3 Monate */
.three-months {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* Jahresansicht */
.year-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}
#calendar-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

#btn-today {
    padding: 6px 12px;
    background: #eee;
    border: 1px solid #aaa;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#calendar-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

/* Grundstil für Legendenfelder */
.legend {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1px solid #aaa;
    margin-right: 4px;
    box-sizing: border-box;
}

/* frei = weißer Inhalt */
.legend.free {
    background: white;
}

/* belegt = komplett schraffiert */
.legend.booked {
    background: repeating-linear-gradient(
        45deg,
        #f8c8d8,
        #f8c8d8 4px,
        #ffffff 4px,
        #ffffff 8px
    );
}

/* An-/Abreise = halbe Fläche schraffiert, halbe weiß */

/* schraffiertes Dreieck unten rechts */
.legend.half {
    position: relative;
    background: white;
    overflow: hidden;
}

/* schraffiertes Dreieck unten rechts */
.legend.half::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;

    /* Dreieckgröße = Legendenfeldgröße */
    width: 18px;
    height: 18px;

    /* Schraffur als Hintergrund */
    background: repeating-linear-gradient(
        45deg,
        #f8c8d8,
        #f8c8d8 4px,
        #ffffff 4px,
        #ffffff 8px
    );

    /* Das ist der entscheidende Trick */
    clip-path: polygon(100% 0, 0 100%, 100% 100%);
}
