/* =====================================================
   TAKVİM - EKİP RENK SİSTEMİ

   Ana fikir:
   - Renk kayıt tipini değil, EKİBİ anlatır.
   - Görev / Hatırlatıcı / Not ayrımı metin ve ikonla yapılır.
   - Kartların tamamını renge boyamıyoruz; sadece accent kullanıyoruz.
===================================================== */

.calendar-event-preview.calendar-team-coded {
    background: var(--team-soft);
    color: var(--team-color);
    border-left: 3px solid var(--team-color);
}


.calendar-event-preview.calendar-team-coded
.calendar-event-dot {
    background: var(--team-color);
}


.calendar-detail-item.calendar-team-coded {
    position: relative;
    border-left: 4px solid var(--team-color);
    border-radius: 8px;
    padding-left: 10px;
    background:
        linear-gradient(
            90deg,
            var(--team-soft) 0,
            rgba(255, 255, 255, 0) 72px
        );
}


.calendar-detail-item.calendar-team-coded
.calendar-detail-time {
    color: var(--team-color);
}


.calendar-team-chip {
    --team-color: #6B7280;
    --team-soft: #F3F4F6;

    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 4px 7px;
    border-radius: 7px;

    background: var(--team-soft) !important;
    color: var(--team-color) !important;

    border: 1px solid color-mix(
        in srgb,
        var(--team-color) 24%,
        transparent
    );

    font-size: calc(8px * var(--text-scale, 1));
    font-weight: 800;
}


.calendar-team-chip::before {
    content: "";

    width: 6px;
    height: 6px;
    min-width: 6px;

    border-radius: 50%;
    background: var(--team-color);
}


.calendar-neutral-tag {
    background: #F2F2F3 !important;
    color: #666 !important;
}


/*
   Eski tip renkleri ekip rengini ezmesin.
*/
.calendar-event-task.calendar-team-coded,
.calendar-event-reminder.calendar-team-coded,
.calendar-event-note.calendar-team-coded {
    background: var(--team-soft);
    color: var(--team-color);
}


/* Telefonda şerit de ekip rengini kullansın. */
@media (max-width: 700px) {

    .calendar-event-preview.calendar-team-coded {
        background: var(--team-color);
        border-left: none;
    }


    .calendar-event-preview.calendar-team-coded
    .calendar-event-dot {
        background: var(--team-color);
    }

}


/* =====================================================
   GÖREV SAYFASI - EKİP RENKLERİ
===================================================== */

.task-card.task-team-coded {
    position: relative;
    overflow: hidden;
    border-left: 4px solid var(--team-color) !important;
    background:
        linear-gradient(
            90deg,
            var(--team-soft) 0,
            rgba(255, 255, 255, 0) 72px
        ),
        #fff;
}


.task-card.task-team-coded::before {
    content: "";
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 3px;
    border-radius: 0 0 8px 8px;
    background: var(--team-color);
    opacity: 0.9;
}


.task-card.task-team-coded .task-card-header {
    padding-top: 3px;
}


.task-card.task-team-coded .task-meta {
    position: relative;
}


.task-card.task-team-coded .task-meta::before {
    content: "";
    width: 7px;
    height: 7px;
    min-width: 7px;
    border-radius: 50%;
    background: var(--team-color);
    box-shadow: 0 0 0 3px var(--team-soft);
}


/* =====================================================
   HATIRLATICI / NOT MODALI - EKİP SEÇİM RENKLERİ
===================================================== */

.reminder-team-option.team-color-option {
    position: relative;
    overflow: hidden;
    border-color:
        color-mix(
            in srgb,
            var(--team-color) 32%,
            #e5e5e5
        );
    border-left: 4px solid var(--team-color);
    background:
        linear-gradient(
            90deg,
            var(--team-soft),
            #fff 78%
        );
}


.reminder-team-option.team-color-option input {
    accent-color: var(--team-color);
}


.reminder-team-option.team-color-option span {
    color: #444;
    font-weight: 700;
}


.reminder-team-option.team-color-option span::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--team-color);
    vertical-align: 1px;
}


.reminder-team-option.team-color-option:has(input:checked) {
    box-shadow:
        inset 0 0 0 1px var(--team-color);
}


/* =====================================================
   TAKVİM FİLTRESİ
===================================================== */

.calendar-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}


.calendar-filter-button.has-filter {
    border-color: #c50000;
    color: #a90000;
    background: #fff7f7;
}


.calendar-filter-count {
    min-width: 18px;
    height: 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 5px;

    border-radius: 999px;

    background: #c50000;
    color: #fff;

    font-size: calc(9px * var(--text-scale, 1));
    font-weight: 800;
}


.calendar-filter-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px;

    background: rgba(18, 18, 18, 0.34);
    backdrop-filter: blur(2px);
}


.calendar-filter-modal {
    width: min(520px, 100%);
    max-height: min(680px, calc(100vh - 36px));

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border: 1px solid #e5e5e5;
    border-radius: 16px;

    background: #fff;

    box-shadow:
        0 24px 70px
        rgba(0, 0, 0, 0.18);
}


.calendar-filter-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;

    padding: 16px 17px 13px;

    border-bottom: 1px solid #eeeeee;
}


.calendar-filter-header h3 {
    margin: 0 0 3px;

    font-size: calc(16px * var(--text-scale, 1));
}


.calendar-filter-header p {
    margin: 0;

    color: #929292;
    font-size: calc(10px * var(--text-scale, 1));
}


.calendar-filter-close {
    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 8px;

    background: #f3f3f3;
    color: #555;

    font-size: calc(19px * var(--text-scale, 1));
    line-height: 1;

    cursor: pointer;
}


.calendar-filter-section {
    padding: 13px 17px;
}


.calendar-filter-section +
.calendar-filter-section {
    border-top: 1px solid #f1f1f1;
}


.calendar-filter-section-title {
    margin-bottom: 9px;

    color: #555;

    font-size: calc(9px * var(--text-scale, 1));
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}


.calendar-filter-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
}


.calendar-filter-check {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 7px;

    padding: 9px 10px;

    border: 1px solid #e8e8e8;
    border-radius: 9px;

    background: #fafafa;

    color: #555;
    font-size: calc(10px * var(--text-scale, 1));
    font-weight: 700;

    cursor: pointer;
}


.calendar-filter-check input {
    width: 14px;
    height: 14px;
    margin: 0;

    accent-color: #c50000;
}


.calendar-filter-check-icon {
    width: 17px;

    text-align: center;

    font-size: calc(11px * var(--text-scale, 1));
}


.calendar-filter-team-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-bottom: 9px;
}


.calendar-filter-team-heading
.calendar-filter-section-title {
    margin-bottom: 0;
}


.calendar-filter-team-tools {
    display: flex;
    gap: 5px;
}


.calendar-filter-team-tools button {
    border: none;

    padding: 4px 6px;

    border-radius: 6px;

    background: #f3f3f3;
    color: #777;

    font-size: calc(8px * var(--text-scale, 1));
    font-weight: 700;

    cursor: pointer;
}


.calendar-filter-team-grid {
    max-height: 235px;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;

    overflow-y: auto;
    padding-right: 2px;
}


.calendar-filter-team {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 7px;

    padding: 8px 9px;

    border: 1px solid
        color-mix(
            in srgb,
            var(--team-color) 22%,
            #e8e8e8
        );

    border-left: 3px solid var(--team-color);
    border-radius: 8px;

    background:
        linear-gradient(
            90deg,
            var(--team-soft),
            #fff 82%
        );

    cursor: pointer;
}


.calendar-filter-team input {
    width: 14px;
    height: 14px;
    min-width: 14px;
    margin: 0;

    accent-color: var(--team-color);
}


.calendar-filter-team-dot {
    width: 7px;
    height: 7px;
    min-width: 7px;

    border-radius: 50%;

    background: var(--team-color);
}


.calendar-filter-team-name {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #505050;

    font-size: calc(9px * var(--text-scale, 1));
    font-weight: 700;
}


.calendar-filter-team:has(input:not(:checked)) {
    opacity: 0.48;
    filter: grayscale(0.55);
}


.calendar-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 8px;

    padding: 12px 17px 15px;

    border-top: 1px solid #eeeeee;

    background: #fafafa;
}


.calendar-filter-actions button {
    min-height: 37px;
}


@media (max-width: 560px) {

    .calendar-filter-overlay {
        align-items: flex-end;
        padding: 10px;
    }


    .calendar-filter-modal {
        width: 100%;
        max-height: calc(100vh - 20px);
        border-radius: 16px;
    }


    .calendar-filter-team-grid {
        grid-template-columns: 1fr;
        max-height: 255px;
    }

}


/* =====================================================
   GÖREV FİLTRESİ
===================================================== */

.task-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}


.task-filter-button.has-filter {
    border-color: #c50000;
    color: #a90000;
    background: #fff7f7;
}


.task-filter-modal {
    width: min(560px, 100%);
}


.task-filter-scroll {
    min-height: 0;
    overflow-y: auto;
}


.task-filter-input {
    width: 100%;
    min-height: 38px;

    box-sizing: border-box;

    border: 1px solid #e4e4e4;
    border-radius: 9px;

    background: #fff;
    color: #444;

    padding: 8px 10px;

    font-size: calc(10px * var(--text-scale, 1));
    outline: none;
}


.task-filter-input:focus {
    border-color: #c50000;
    box-shadow: 0 0 0 3px rgba(197, 0, 0, 0.06);
}


.task-filter-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}


.task-filter-deadline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}


.task-filter-mine-toggle {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    padding: 10px 11px;

    border: 1px solid #e6e6e6;
    border-radius: 10px;

    background: #fafafa;

    cursor: pointer;
}


.task-filter-mine-toggle input {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin: 1px 0 0;

    accent-color: #c50000;
}


.task-filter-mine-toggle div {
    min-width: 0;
}


.task-filter-mine-toggle strong {
    display: block;

    color: #444;
    font-size: calc(10px * var(--text-scale, 1));
}


.task-filter-mine-toggle span {
    display: block;

    margin-top: 2px;

    color: #929292;
    font-size: calc(8px * var(--text-scale, 1));
    line-height: 1.4;
}


.task-filter-modal .calendar-filter-team-grid {
    max-height: 155px;
}


.task-filter-actions {
    grid-template-columns: 0.75fr 0.75fr 1.4fr;
}


@media (max-width: 560px) {

    .task-filter-modal {
        width: 100%;
    }


    .task-filter-choice-grid {
        grid-template-columns: 1fr;
    }


    .task-filter-deadline-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }


    .task-filter-actions {
        grid-template-columns: 1fr 1fr;
    }


    .task-filter-actions .task-filter-apply {
        grid-column: 1 / -1;
    }

}
