/* ===================================================================
   PANEL COMPONENTS – Modal, Toast, Form, Table enhancements
   Tüm panellerde (Admin/Leader/Member) ortak kullanılır.
   =================================================================== */

/* ============================================================
   1. PREMIUM MODAL (admin-modal)
   ============================================================ */

.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn .2s ease;
}

.admin-modal {
    background: var(--bg);
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,.18);
    animation: slideUp .25s ease;
    overflow: hidden;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.admin-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.admin-modal-close {
    background: none;
    border: none;
    padding: .35rem;
    cursor: pointer;
    color: var(--text);
    opacity: .5;
    transition: opacity .15s;
    font-size: 1.1rem;
}

.admin-modal-close:hover { opacity: 1; }

.admin-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.admin-modal-footer {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0,0,0,.06);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   2. TOAST
   ============================================================ */

.admin-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    animation: slideUp .3s ease;
}

.admin-toast {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--bg);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 10px;
    padding: .75rem 1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: 280px;
    max-width: 420px;
}

.admin-toast.toast-success {
    border-left: 4px solid #2e7d32;
}

.admin-toast.toast-error {
    border-left: 4px solid var(--primary);
}

.admin-toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-success .admin-toast-icon { color: #2e7d32; }
.toast-error .admin-toast-icon   { color: var(--primary); }

.admin-toast-message {
    flex: 1;
    font-size: .85rem;
    color: var(--text);
}

.admin-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    opacity: .4;
    font-size: 1rem;
    padding: .25rem;
    transition: opacity .15s;
}

.admin-toast-close:hover { opacity: 1; }

/* ============================================================
   3. FORM COMPONENTS
   ============================================================ */

.admin-form-section {
    margin-bottom: 1.25rem;
}

.admin-form-section-title {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text);
    opacity: .6;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .75rem;
}

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.admin-form-group {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.admin-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text);
}

.admin-input {
    padding: .55rem .75rem;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    font-size: .88rem;
    color: var(--text);
    background: var(--bg);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    width: 100%;
}

.admin-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(178,58,44,.08);
}

.admin-field-hint {
    font-size: .72rem;
    color: var(--text);
    opacity: .5;
}

/* ============================================================
   4. TABLE TOOLBAR
   ============================================================ */

.admin-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-table-search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.admin-table-search i {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: .35;
    font-size: .85rem;
}

.admin-table-search input {
    width: 100%;
    padding: .55rem .75rem .55rem 2.1rem;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    font-size: .85rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.admin-table-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(178,58,44,.08);
}

/* ============================================================
   5. RESPONSIVE
   ============================================================ */

@media (max-width: 767px) {
    .admin-modal {
        max-width: 95vw;
        margin: 1rem;
    }

    .admin-form-row {
        grid-template-columns: 1fr;
    }

    .admin-table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-table-search {
        max-width: none;
    }

    .admin-toast-container {
        left: 1rem;
        right: 1rem;
    }

    .admin-toast {
        min-width: auto;
        max-width: none;
    }
}

/* ============================================================
   6. TEAM PAGE (Ekip Oluştur — Leader Panel)
   ============================================================ */

/* Page header */
.team-page-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.team-header-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(178,58,44,.1);
    color: var(--primary, #B23A2C);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.team-header-info h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 .25rem;
    color: var(--text, #2b2b2b);
}

.team-header-info p {
    font-size: .88rem;
    color: var(--text, #2b2b2b);
    opacity: .6;
    margin: 0;
}

/* Step cards */
.team-step-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    position: relative;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.team-step-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary, #B23A2C);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: .15rem;
}

.team-step-content {
    flex: 1;
}

.team-step-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text, #2b2b2b);
    margin-bottom: .35rem;
}

.team-step-title i {
    color: var(--primary, #B23A2C);
}

.team-step-desc {
    font-size: .88rem;
    color: var(--text, #2b2b2b);
    opacity: .6;
    margin: 0 0 .85rem;
}

.team-select {
    width: 100%;
    max-width: 480px;
    padding: .6rem .85rem;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 8px;
    background: #fff;
    color: var(--text, #2b2b2b);
    font-size: .9rem;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    appearance: auto;
}

.team-select:focus {
    border-color: var(--primary, #B23A2C);
    box-shadow: 0 0 0 3px rgba(178,58,44,.1);
}

/* Builder grid */
.team-builder-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
    .team-builder-grid {
        grid-template-columns: 1fr;
    }
}

/* Panel */
.team-panel {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    max-height: 520px;
}

.team-panel-selected {
    border-color: rgba(178,58,44,.18);
}

.team-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,.07);
    background: #fafafa;
    flex-shrink: 0;
}

.team-panel-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .92rem;
    font-weight: 700;
    color: var(--text, #2b2b2b);
}

.team-panel-title i { color: var(--primary, #B23A2C); }

.team-panel-count {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text, #2b2b2b);
    opacity: .5;
    background: rgba(0,0,0,.05);
    padding: .18rem .55rem;
    border-radius: 999px;
}

.team-count-highlight {
    background: rgba(178,58,44,.1);
    color: var(--primary, #B23A2C);
    opacity: 1;
}

/* Search box inside panel */
.team-panel-search {
    position: relative;
    padding: .75rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,.06);
    flex-shrink: 0;
}

.team-panel-search-icon {
    position: absolute;
    left: 1.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text, #2b2b2b);
    opacity: .35;
    font-size: .85rem;
    pointer-events: none;
}

.team-panel-search-input {
    width: 100%;
    padding: .5rem .75rem .5rem 2.1rem;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    font-size: .85rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
    color: var(--text, #2b2b2b);
}

.team-panel-search-input:focus {
    border-color: var(--primary, #B23A2C);
    box-shadow: 0 0 0 3px rgba(178,58,44,.08);
}

/* Member list */
.team-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: .5rem 0;
}

.team-panel-list::-webkit-scrollbar { width: 4px; }
.team-panel-list::-webkit-scrollbar-track { background: transparent; }
.team-panel-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 2px; }

/* Member row */
.team-member-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .65rem 1.1rem;
    cursor: pointer;
    transition: background .15s;
    user-select: none;
}

.team-member-row:hover { background: rgba(178,58,44,.04); }

.team-member-selected {
    background: rgba(178,58,44,.06) !important;
}

.team-member-in-team {
    background: rgba(178,58,44,.04);
}

.team-member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(178,58,44,.1);
    color: var(--primary, #B23A2C);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.team-avatar-highlight {
    background: rgba(178,58,44,.18);
    color: var(--primary, #B23A2C);
}

.team-member-info { flex: 1; min-width: 0; }

.team-member-name {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text, #2b2b2b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-member-email {
    font-size: .76rem;
    color: var(--text, #2b2b2b);
    opacity: .5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-member-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    color: var(--text, #2b2b2b);
    opacity: .35;
    transition: all .18s;
    flex-shrink: 0;
}

.team-member-check.checked {
    background: var(--primary, #B23A2C);
    border-color: var(--primary, #B23A2C);
    color: #fff;
    opacity: 1;
}

/* Remove button */
.team-remove-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(198,40,40,.2);
    background: rgba(198,40,40,.06);
    color: #c62828;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .18s, border-color .18s;
}

.team-remove-btn:hover {
    background: rgba(198,40,40,.14);
    border-color: rgba(198,40,40,.4);
}

/* Empty state */
.team-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 2.5rem 1rem;
    color: var(--text, #2b2b2b);
    opacity: .35;
    text-align: center;
    font-size: .88rem;
}

.team-panel-empty i { font-size: 1.75rem; opacity: .5; }

.team-empty-selected { opacity: .4; }

/* Save / Clear buttons */
.team-save-wrap {
    padding: 1rem 1.1rem;
    border-top: 1px solid rgba(0,0,0,.07);
    display: flex;
    gap: .65rem;
    flex-shrink: 0;
    background: #fafafa;
}

.team-save-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .65rem 1.25rem;
    border: none;
    border-radius: 10px;
    background: var(--primary, #B23A2C);
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, box-shadow .2s, transform .15s;
    box-shadow: 0 3px 10px rgba(178,58,44,.25);
}

.team-save-btn:hover:not(:disabled) {
    background: #9a3224;
    box-shadow: 0 5px 16px rgba(178,58,44,.35);
    transform: translateY(-1px);
}

.team-save-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

.team-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .65rem 1rem;
    border: 1px solid rgba(0,0,0,.13);
    border-radius: 10px;
    background: #fff;
    color: var(--text, #2b2b2b);
    font-size: .86rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, border-color .18s;
}

.team-clear-btn:hover {
    background: rgba(198,40,40,.05);
    border-color: rgba(198,40,40,.25);
    color: #c62828;
}
