/* =====================================================
   EKİP SAYFASI
===================================================== */

.team-page {
    width: 100%;
}


/* =====================================================
   SAYFA BAŞLIĞI
===================================================== */

.team-page-header {
    margin-bottom: 22px;
}


/* =====================================================
   İSTATİSTİKLER
===================================================== */

.team-stats {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 12px;

    margin-bottom: 18px;
}


.team-stat-card {
    display: flex;

    align-items: center;

    gap: 10px;

    min-height: 66px;

    padding: 15px 18px;

    border: 1px solid #eaeaea;

    border-radius: 14px;

    background: #fff;

    box-shadow:
        0 4px 15px
        rgba(0, 0, 0, 0.025);
}


.team-stat-card strong {
    color: #222;

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

    line-height: 1;
}


.team-stat-card span {
    color: #777;

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

    font-weight: 700;
}


/* =====================================================
   ÜST KONTROLLER
===================================================== */

.team-controls {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 14px;

    margin-bottom: 18px;
}


.team-tabs {
    display: flex;

    gap: 6px;
}


.team-tab {
    border:
        1px solid #ddd;

    background: white;

    padding:
        9px 13px;

    border-radius: 9px;

    color: #555;

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

    font-weight: 700;

    cursor: pointer;

    transition:
        0.15s ease;
}


.team-tab:hover {
    border-color:
        #c9c9c9;
}


.team-tab.active {
    color: #c50000;

    border-color: #c50000;

    background: #fff4f4;
}


.team-search {
    width:
        min(320px, 100%);

    padding:
        10px 12px;

    border:
        1px solid #ddd;

    border-radius: 10px;

    background: white;

    outline: none;

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


.team-search:focus {
    border-color: #c50000;
}


/* =====================================================
   GRID
===================================================== */

.member-grid,
.team-card-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(320px, 1fr)
        );

    gap: 16px;

    align-items: stretch;
}


/* =====================================================
   ORTAK KART YAPISI
===================================================== */

.member-card,
.team-card {
    position: relative;

    display: flex;

    flex-direction: column;

    height: 100%;

    box-sizing: border-box;

    overflow: hidden;

    padding: 19px;

    border:
        1px solid #eaeaea;

    border-radius: 16px;

    background: white;

    box-shadow:
        0 4px 15px
        rgba(0, 0, 0, 0.03);
}


/* =====================================================
   ÜYE KARTI - ÜST BÖLÜM
===================================================== */

.member-card-top {
    display: grid;

    grid-template-columns:
        44px
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 11px;

    min-height: 48px;
}


.member-avatar {
    width: 44px;

    height: 44px;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    overflow: hidden;

    border-radius: 50%;

    background: #f1f1f2;

    color: #444;

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

    font-weight: 900;
}


.member-avatar img {
    width: 100%;

    height: 100%;

    object-fit: cover;
}


.member-avatar-large {
    width: 50px;

    height: 50px;
}


/* =====================================================
   ÜYE KİMLİĞİ
===================================================== */

.member-identity {
    min-width: 0;
}


.member-identity strong,
.member-editor-summary strong {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    color: #222;

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

    line-height: 1.3;
}


.member-identity span,
.member-editor-summary span {
    display: block;

    margin-top: 3px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    color: #999;

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


/* =====================================================
   ROL / KIDEM
===================================================== */

.member-rank-badge {
    height: fit-content;

    padding:
        5px 8px;

    border-radius: 20px;

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

    font-weight: 800;

    white-space: nowrap;
}


.member-rank-badge.volunteer {
    background: #f2f2f3;

    color: #666;
}


.member-rank-badge.senior {
    background: #fff6d9;

    color: #856100;
}


.member-rank-badge.coordinator {
    background: #fff0f0;

    color: #b00000;
}


/* =====================================================
   MÜSAİTLİK + PROFİL BUTONU
===================================================== */

.member-summary {
    display: flex;

    align-items: center;

    justify-content: space-between;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: 13px;

    min-height: 30px;
}


.member-summary .availability {
    margin: 0;
}


/* =====================================================
   EKİP ETİKETLERİ
===================================================== */

.member-team-list {
    display: flex;

    flex-wrap: wrap;

    align-items: flex-start;

    align-content: flex-start;

    gap: 7px;

    margin-top: 14px;

    /*
       ÖNEMLİ:
       JS kartları hizalarken bu alanın yüksekliği artabilir.
       align-items / align-content flex-start sayesinde
       tek ekip etiketi artık devasa dikey kutuya dönüşmez.
    */
}


.member-team-chip {
    display: inline-flex;

    align-items: center;

    justify-content: flex-start;

    align-self: flex-start;

    flex:
        0 0 auto;

    gap: 6px;

    width: auto;

    max-width: 100%;

    min-height: 28px;

    box-sizing: border-box;

    padding:
        6px 9px;

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

    border-radius: 8px;

    background:
        var(--team-soft);

    color: #555;

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

    font-weight: 800;

    line-height: 1.2;
}


.member-team-dot,
.team-card-dot,
.member-editor-team-dot {
    width: 7px;

    height: 7px;

    min-width: 7px;

    min-height: 7px;

    border-radius: 50%;

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


.member-no-team {
    display: inline-block;

    padding:
        6px 0;

    color: #aaa;

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


/* =====================================================
   ÜYE KARTI ALT BÖLÜM
===================================================== */

.member-card-footer {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    margin-top: auto;

    padding-top: 14px;

    border-top:
        1px solid #eeeeee;
}


.member-xp {
    color: #856100;

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

    font-weight: 800;
}


/* =====================================================
   ORTAK DÜZENLE / PROFİL BUTONU
===================================================== */

.member-edit-button {
    min-height: 32px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border: none;

    border-radius: 8px;

    background: #eeeeef;

    color: #444;

    padding:
        7px 10px;

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

    font-weight: 800;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background 0.15s ease;
}


.member-edit-button:hover {
    background: #e5e5e7;
}


/* =====================================================
   EKİPLER SEKME KARTI
===================================================== */

.team-card {
    padding-top: 21px;
}


.team-card-accent {
    position: absolute;

    inset:
        0 0 auto 0;

    height: 4px;

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


.team-card-header {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 12px;

    padding-bottom: 13px;

    border-bottom:
        1px solid #eeeeee;
}


.team-card-header > div:first-child {
    display: flex;

    align-items: center;

    gap: 8px;

    min-width: 0;
}


.team-card-header strong {
    overflow: hidden;

    text-overflow: ellipsis;

    color: #222;

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

    line-height: 1.3;
}


.team-card-counts {
    display: flex;

    align-items: flex-end;

    flex-direction: column;

    gap: 3px;

    color: #888;

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

    font-weight: 700;

    white-space: nowrap;
}


/* =====================================================
   EKİP İÇİNDEKİ ÜYELER
===================================================== */

.team-member-mini-list {
    display: flex;

    flex-direction: column;

    gap: 8px;

    margin-top: 13px;
}


.team-member-mini {
    display: grid;

    grid-template-columns:
        32px
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 9px;

    min-height: 48px;

    box-sizing: border-box;

    padding:
        8px 9px;

    border:
        1px solid #eeeeee;

    border-radius: 10px;

    background: #fafafa;

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


.team-member-mini-avatar {
    width: 32px;

    height: 32px;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

    border-radius: 50%;

    background:
        var(--team-soft);

    color:
        var(--team-color);

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

    font-weight: 900;
}


.team-member-mini-avatar img {
    width: 100%;

    height: 100%;

    object-fit: cover;
}


.team-member-mini > span:nth-child(2) {
    min-width: 0;

    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap:
        4px 7px;

    color: #333;

    font-weight: 700;
}


.team-member-mini .availability {
    font-size:
        calc(8px * var(--text-scale, 1));

    font-weight: 600;
}


.team-member-mini strong {
    padding:
        4px 6px;

    border-radius: 6px;

    background: #fff6d9;

    color: #856100;

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

    white-space: nowrap;
}


.team-member-mini .member-edit-button {
    margin-left: 4px;
}


.team-empty-members {
    padding:
        22px 12px;

    border:
        1px solid #eeeeee;

    border-radius: 10px;

    background: #fafafa;

    color: #aaa;

    text-align: center;

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


/* =====================================================
   ÜYE DÜZENLE MODALI
===================================================== */

.member-modal {
    max-width: 620px;
}


.member-editor-summary {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-bottom: 18px;

    padding: 12px;

    border-radius: 12px;

    background: #fafafa;
}


/* =====================================================
   KIDEM SEÇİMİ
===================================================== */

.member-rank-options {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;
}


.member-rank-option {
    display: flex;

    align-items: flex-start;

    gap: 8px;

    padding: 11px;

    border:
        1px solid #e5e5e5;

    border-radius: 10px;

    background: #fff;

    cursor: pointer;
}


.member-rank-option input {
    margin-top: 2px;

    accent-color: #c50000;
}


.member-rank-option strong {
    display: block;

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


.member-rank-option span {
    display: block;

    margin-top: 3px;

    color: #888;

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

    line-height: 1.4;
}


.member-rank-option.senior {
    background: #fffdf6;
}


/* =====================================================
   EKİP SEÇİMİ
===================================================== */

.member-editor-team-heading {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    margin-bottom: 8px;
}


.member-editor-team-heading span {
    color: #999;

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


.member-editor-team-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 7px;
}


.member-editor-team {
    display: flex;

    align-items: center;

    gap: 7px;

    min-height: 40px;

    box-sizing: border-box;

    padding:
        9px 10px;

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

    border-radius: 9px;

    background:
        var(--team-soft);

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

    font-weight: 800;

    cursor: pointer;
}


.member-editor-team input {
    width: 16px;

    height: 16px;

    margin: 0;

    flex-shrink: 0;

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


.task-permission-note {
    display: block;

    margin-top: 6px;

    color: #856100;

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

    line-height: 1.4;
}


/* =====================================================
   MASAÜSTÜ ORTA BOY
===================================================== */

@media (max-width: 1150px) {

    .member-grid,
    .team-card-grid {
        grid-template-columns:
            repeat(
                auto-fill,
                minmax(290px, 1fr)
            );
    }

}


/* =====================================================
   TABLET
===================================================== */

@media (max-width: 760px) {

    .team-stats {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }


    .team-controls {
        align-items: stretch;

        flex-direction: column;
    }


    .team-search {
        width: 100%;
    }


    .member-grid,
    .team-card-grid {
        grid-template-columns:
            1fr;
    }


    .member-rank-options,
    .member-editor-team-grid {
        grid-template-columns:
            1fr;
    }

}


/* =====================================================
   TELEFON
===================================================== */

@media (max-width: 520px) {

    .team-stats {
        grid-template-columns:
            1fr;
    }


    .team-stat-card {
        min-height: 56px;

        padding:
            12px 14px;
    }


    .member-card,
    .team-card {
        padding: 16px;
    }


    .member-card-top {
        grid-template-columns:
            42px
            minmax(0, 1fr);
    }


    .member-avatar {
        width: 42px;

        height: 42px;
    }


    .member-rank-badge {
        grid-column:
            1 / -1;

        justify-self: start;
    }


    .member-summary {
        align-items: flex-start;
    }


    .team-card-header {
        flex-direction: column;
    }


    .team-card-counts {
        align-items: flex-start;

        flex-direction: row;

        gap: 10px;
    }


    .team-member-mini {
        grid-template-columns:
            32px
            minmax(0, 1fr);
    }


    .team-member-mini .member-edit-button {
        grid-column:
            1 / -1;

        width: 100%;

        margin-left: 0;
    }

}