﻿.outlook-calendar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.outlook-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.outlook-toolbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.cal-btn {
    border: 1px solid #dbe2ea;
    background: #ffffff;
    color: #111827;
    border-radius: 12px;
    padding: .55rem .85rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 40px;
}

    .cal-btn:hover {
        background: #f3f6fa;
    }

.icon-btn {
    min-width: 42px;
    font-size: 1.35rem;
    line-height: 1;
}

.calendar-current-title {
    min-width: 150px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #111827;
    padding: 0 .5rem;
}

.view-switch {
    display: flex;
    background: #f3f4f6;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    padding: .25rem;
}

    .view-switch button {
        border: 0;
        background: transparent;
        padding: .5rem .9rem;
        border-radius: 10px;
        font-weight: 700;
        cursor: pointer;
        color: #374151;
    }

        .view-switch button.active {
            background: #2563eb;
            color: #ffffff;
            box-shadow: 0 8px 20px rgba(37, 99, 235, .25);
        }

.outlook-month-card {
    background: #f8fafc;
    border: 1px solid #dbe2ea;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-grid-head {
    background: #eef2f7;
    border-bottom: 1px solid #dbe2ea;
}

.calendar-head-cell {
    padding: .85rem;
    text-align: center;
    font-weight: 800;
    color: #1e293b;
    border-right: 1px solid #dbe2ea;
}

    .calendar-head-cell:last-child {
        border-right: 0;
    }

.calendar-grid-body {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #ffffff;
}

.calendar-day {
    min-height: 132px;
    padding: .55rem;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    background: #fcfcfd;
    transition: background .15s ease;
}

    .calendar-day:hover {
        background: #f3f6fa;
    }

    .calendar-day:nth-child(7n) {
        border-right: 0;
    }

    .calendar-day:nth-child(7n),
    .calendar-day:nth-child(7n-1) {
        background: #f7f9fc;
    }

.calendar-day-outside {
    background: #f1f5f9;
    color: #94a3b8;
}

.calendar-day-today {
    background: #dbeafe !important;
}

.calendar-day-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: .45rem;
    font-weight: 800;
    color: #1e293b;
    font-size: .92rem;
}

.calendar-day-outside .calendar-day-header {
    color: #94a3b8;
}

.calendar-day-today .calendar-day-header span {
    background: #2563eb;
    color: white;
    border-radius: 999px;
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-body {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.calendar-event {
    display: flex;
    gap: .45rem;
    border-radius: 10px;
    padding: .42rem .48rem;
    color: #ffffff;
    cursor: pointer;
    min-width: 0;
    box-shadow: 0 8px 16px rgba(15, 23, 42, .08);
}

    .calendar-event:hover {
        transform: translateY(-1px);
        filter: brightness(.98);
    }

.calendar-event-time {
    font-weight: 900;
    font-size: .78rem;
    white-space: nowrap;
}

.calendar-event-content {
    min-width: 0;
}

.calendar-event-title {
    font-size: .8rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event-meta {
    font-size: .7rem;
    opacity: .9;
    margin-top: .1rem;
}

.calendar-event-empty {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.calendar-event-partial {
    background: linear-gradient(135deg, #f59e0b, #fb923c);
}

.calendar-event-full {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.calendar-more {
    font-size: .75rem;
    font-weight: 700;
    color: #2563eb;
    padding: .2rem .3rem;
    cursor: pointer;
}

.calendar-legend {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem;
    color: #6b7280;
    font-size: .9rem;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

    .calendar-legend > div {
        display: flex;
        align-items: center;
        gap: .45rem;
    }

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
}

.legend-empty {
    background: #dc2626;
}

.legend-partial {
    background: #f59e0b;
}

.legend-full {
    background: #16a34a;
}

/* Jahresansicht */

.outlook-year-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.year-month-card {
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.year-month-title {
    font-weight: 900;
    font-size: 1rem;
    margin-bottom: .75rem;
    color: #111827;
}

.year-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: .25rem;
    color: #64748b;
    font-size: .7rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: .3rem;
}

.year-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: .25rem;
}

.year-day {
    position: relative;
    min-height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    color: #374151;
}

    .year-day:hover {
        background: #f3f6fa;
    }

.year-day-empty {
    cursor: default;
}

    .year-day-empty:hover {
        background: transparent;
    }

.year-day.has-event {
    background: #f8fafc;
}

.year-today {
    background: #dbeafe !important;
    color: #1d4ed8;
}

.year-dot {
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
}

.dot-red {
    background: #dc2626;
}

.dot-yellow {
    background: #f59e0b;
}

.dot-green {
    background: #16a34a;
}

/* Modal Ergänzung */

.calendar-modal-card {
    max-width: 720px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Tablet */

@media (max-width: 1100px) {
    .outlook-year-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-day {
        min-height: 115px;
    }
}

/* Handy */

@media (max-width: 760px) {

    .outlook-calendar-header {
        gap: .75rem;
    }

    .outlook-toolbar {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 48px 48px;
        gap: .5rem;
    }

    .calendar-current-title {
        grid-column: 1 / -1;
        order: -1;
        min-width: 0;
        font-size: 1.4rem;
        font-weight: 900;
        padding: .25rem 0;
    }

    .view-switch {
        grid-column: 1 / -1;
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

        .view-switch button {
            width: 100%;
        }

    .outlook-month-card {
        border-radius: 18px;
        overflow: hidden;
        background: #f8fafc;
    }

    .calendar-grid-head {
        display: grid !important;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        background: #eef2f7;
        border-bottom: 1px solid #dbe2ea;
    }

    .calendar-head-cell {
        background: #eef2f7 !important;
        color: #1e293b !important;
        border-radius: 0 !important;
        border-right: 1px solid #dbe2ea;
        padding: .65rem .1rem;
        font-size: .78rem;
        font-weight: 800;
        text-align: center;
        min-height: auto !important;
    }

        .calendar-head-cell:last-child {
            border-right: 0;
        }

    .calendar-grid-body {
        display: grid !important;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        background: #ffffff;
    }

    .calendar-day {
        min-height: 92px;
        padding: .28rem;
        border-right: 1px solid #e5e7eb;
        border-bottom: 1px solid #e5e7eb;
        border-radius: 0 !important;
        background: #fcfcfd;
    }

        .calendar-day:hover {
            background: #f3f6fa;
        }

        .calendar-day:nth-child(7n) {
            border-right: 0;
        }

        .calendar-day:nth-child(7n),
        .calendar-day:nth-child(7n-1) {
            background: #f7f9fc;
        }

    .calendar-day-outside {
        display: block;
        background: #f1f5f9;
        color: #cbd5e1;
    }

    .calendar-day-header {
        font-size: .75rem;
        font-weight: 800;
        color: #1e293b;
        margin-bottom: .2rem;
    }

    .calendar-day-outside .calendar-day-header {
        color: #cbd5e1;
    }

    .calendar-day-today {
        background: #dbeafe !important;
    }

        .calendar-day-today .calendar-day-header span {
            background: #2563eb;
            color: white;
            border-radius: 999px;
            width: 24px;
            height: 24px;
            min-width: 24px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: .75rem;
        }

    .calendar-day-body {
        gap: .15rem;
    }

    .calendar-event {
        display: block;
        padding: .28rem .32rem;
        border-radius: 7px;
        box-shadow: none;
        overflow: hidden;
    }

    .calendar-event-time {
        font-size: .64rem;
        font-weight: 900;
        line-height: 1.1;
    }

    .calendar-event-title {
        font-size: .62rem;
        font-weight: 800;
        line-height: 1.15;
        white-space: normal;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .calendar-event-meta {
        display: none;
    }

    .calendar-more {
        font-size: .6rem;
        padding: 0;
    }

    .calendar-legend {
        font-size: .75rem;
        gap: .7rem;
        padding: .75rem;
    }

    .outlook-year-grid {
        grid-template-columns: 1fr;
    }

    .calendar-modal-card {
        width: calc(100vw - 2rem);
        max-width: none;
    }
}
