.icsyc-yearly-calendar {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	margin: 0;
	padding: 20px 0;
	width: 100%;
	box-sizing: border-box;
}

/* VOLLE BREITE - Container über gesamte Breite */
.icsyc-yearly-calendar,
.icsyc-calendar-grid {
	width: 100%;
	max-width: 100%;
}

/* WordPress Template volle Breite */
.icsyc-yearly-calendar {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(-50vw + 50%);
	margin-right: calc(-50vw + 50%);
	padding: 20px;
	box-sizing: border-box;
}

/* Im Editor oder Admin-Bereich nicht über volle Breite */
.wp-admin .icsyc-yearly-calendar,
.block-editor-block-list__layout .icsyc-yearly-calendar {
	width: 100%;
	margin-left: 0;
	margin-right: 0;
}

.icsyc-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 25px;
	padding-bottom: 15px;
	border-bottom: 3px solid #3b82f6;
	flex-wrap: wrap;
	gap: 15px;
}

.icsyc-title {
    margin: 0;
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
}

.icsyc-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.icsyc-pdf-button,
.icsyc-ics-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.icsyc-pdf-button {
    background: #3b82f6;
    color: white;
}

.icsyc-pdf-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.icsyc-ics-button {
    background: #10b981;
    color: white !important;
    text-decoration: none !important;
}

.icsyc-ics-button:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    color: white !important;
}

/* KALENDER GRID - Flexible Spalten je nach Bildschirmbreite */
.icsyc-calendar-grid {
    display: grid;
    gap: 25px;
    width: 100%;
}

/* Standard: 3 Monate pro Reihe */
.icsyc-layout-horizontal {
    grid-template-columns: repeat(3, 1fr);
}

/* Bei sehr großen Bildschirmen: 4 Monate */
@media (min-width: 1600px) {
    .icsyc-layout-horizontal {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Bei mittleren Bildschirmen: 2 Monate */
@media (max-width: 1200px) {
    .icsyc-layout-horizontal {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Bei kleinen Bildschirmen: 1 Monat */
@media (max-width: 768px) {
    .icsyc-layout-horizontal {
        grid-template-columns: 1fr;
    }
}

.icsyc-layout-vertical {
    grid-template-columns: 1fr;
}

@media (max-width: 900px) {
    .icsyc-layout-horizontal,
    .icsyc-layout-vertical {
        grid-template-columns: 1fr;
    }
}

/* MONATS-BLOCK - MAXIMALE BREITE */
.icsyc-month {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
    min-width: 380px; /* Mindestbreite für bessere Lesbarkeit */
}

.icsyc-month:hover {
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
}

.icsyc-month-header {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 15px 20px;
    text-align: center;
    font-weight: 700;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Farben für Monate - Abgestuftes Blau/Grün */
.icsyc-month:nth-child(1) .icsyc-month-header { background: linear-gradient(135deg, #1e40af, #1e3a8a); }
.icsyc-month:nth-child(2) .icsyc-month-header { background: linear-gradient(135deg, #1d4ed8, #1e40af); }
.icsyc-month:nth-child(3) .icsyc-month-header { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.icsyc-month:nth-child(4) .icsyc-month-header { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.icsyc-month:nth-child(5) .icsyc-month-header { background: linear-gradient(135deg, #0ea5e9, #3b82f6); }
.icsyc-month:nth-child(6) .icsyc-month-header { background: linear-gradient(135deg, #06b6d4, #0ea5e9); }
.icsyc-month:nth-child(7) .icsyc-month-header { background: linear-gradient(135deg, #14b8a6, #06b6d4); }
.icsyc-month:nth-child(8) .icsyc-month-header { background: linear-gradient(135deg, #10b981, #14b8a6); }
.icsyc-month:nth-child(9) .icsyc-month-header { background: linear-gradient(135deg, #22c55e, #10b981); }
.icsyc-month:nth-child(10) .icsyc-month-header { background: linear-gradient(135deg, #84cc16, #22c55e); }
.icsyc-month:nth-child(11) .icsyc-month-header { background: linear-gradient(135deg, #eab308, #84cc16); }
.icsyc-month:nth-child(12) .icsyc-month-header { background: linear-gradient(135deg, #f59e0b, #eab308); }

/* TAGE GRID */
.icsyc-month-days {
    padding: 12px;
}

.icsyc-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.icsyc-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    padding: 8px 0;
    text-transform: uppercase;
    background: #f1f5f9;
    border-radius: 4px;
}

.icsyc-weekdays .icsyc-weekend {
    color: #dc2626;
    background: #fef2f2;
}

.icsyc-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

/* TAG-FELDER - MAXIMALE GRÖSSE für ausgiebige Nutzung */
.icsyc-day {
    min-height: 140px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
}

.icsyc-day:hover {
    background: #dbeafe;
    border-color: #60a5fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
}

.icsyc-day.icsyc-empty {
    background: #f1f5f9;
    border-color: transparent;
    cursor: default;
    min-height: 140px;
}

.icsyc-day.icsyc-empty:hover {
    background: #f1f5f9;
    transform: none;
    box-shadow: none;
}

.icsyc-day.icsyc-weekend {
    background: #fef2f2;
}

.icsyc-day.icsyc-today {
    background: #dcfce7;
    border: 2px solid #22c55e;
}

.icsyc-day.icsyc-has-event {
    background: #eff6ff;
    border-color: #93c5fd;
}

.icsyc-day.icsyc-has-event:hover {
    background: #dbeafe;
}

.icsyc-day-number {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.icsyc-day.icsyc-weekend .icsyc-day-number {
    color: #dc2626;
}

/* EVENT-VORSCHAU IM TAG - VERGRÖSSERT */
.icsyc-day-events {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    flex: 1;
}

.icsyc-event-item-preview {
    padding: 8px 10px;
    background: #3b82f6;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icsyc-event-item-preview:nth-child(2) { background: #7c3aed; }
.icsyc-event-item-preview:nth-child(3) { background: #059669; }

.icsyc-event-item-preview:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.icsyc-event-title-preview {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 3px;
}

.icsyc-event-location-preview {
    font-size: 10px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* TOOLTIP STYLES - HELLES DESIGN */
.icsyc-tooltip {
    position: fixed;
    z-index: 9999;
    background: #ffffff;
    color: #1e293b;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1);
    max-width: 420px;
    min-width: 320px;
    font-size: 14px;
    line-height: 1.5;
    animation: icsyc-tooltip-appear 0.2s ease;
    border: 1px solid #e2e8f0;
}

@keyframes icsyc-tooltip-appear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.icsyc-tooltip-header {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.icsyc-tooltip-date {
    font-weight: 700;
    font-size: 15px;
}

.icsyc-tooltip-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.icsyc-tooltip-close:hover {
    background: rgba(255,255,255,0.2);
}

.icsyc-tooltip-content {
    padding: 20px;
    background: #f8fafc;
}

.icsyc-tooltip-event {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.icsyc-tooltip-event:last-child {
    margin-bottom: 0;
    padding-bottom: 16px;
    border-bottom: none;
}

.icsyc-tooltip-event-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    color: #1e40af;
}

.icsyc-tooltip-event-time {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.icsyc-tooltip-event-location {
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.icsyc-tooltip-event-location::before {
    content: "📍";
    color: #3b82f6;
}

.icsyc-tooltip-event-description {
    font-size: 13px;
    color: #e2e8f0;
    line-height: 1.5;
}

/* Fehlermeldung */
.icsyc-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
    margin: 15px 0;
    font-weight: 500;
}

/* Print Styles */
@media print {
    .icsyc-pdf-actions,
    .icsyc-tooltip,
    .icsyc-tooltip-close {
        display: none !important;
    }
    
    .icsyc-calendar-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .icsyc-month {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .icsyc-day {
        min-height: 60px;
    }
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .icsyc-yearly-calendar {
        padding: 10px;
    }
    
    .icsyc-title {
        font-size: 1.5rem;
    }
    
    .icsyc-day {
        min-height: 65px;
        padding: 4px;
    }
    
    .icsyc-day-number {
        font-size: 12px;
    }
    
    .icsyc-event-item-preview {
        font-size: 9px;
        padding: 3px 4px;
    }
    
    .icsyc-event-title-preview {
        font-size: 9px;
    }
    
    .icsyc-event-location-preview {
        font-size: 8px;
    }
}
