/**
 * NowBiz Team Management CSS
 *
 * @package NowBizPlan
 * @since 1.0.0
 */

/* ===========================
   Container
   =========================== */
.nowbizplan-team-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.nowbizplan-error {
    padding: 12px 16px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

/* ===========================
   Header
   =========================== */
.nowbizplan-team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 15px;
}

.nowbizplan-team-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nowbizplan-team-title .dashicons {
    color: #2271b1;
    font-size: 28px;
    width: 28px;
    height: 28px;
}

/* ===========================
   Statistics
   =========================== */
.nowbizplan-team-stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #2271b1;
}

.stat-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===========================
   Add Member Form
   =========================== */
.nowbizplan-add-member-form {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.nowbizplan-add-member-form h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.nowbizplan-team-form .form-row {
    margin-bottom: 15px;
}

.nowbizplan-team-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
}

.nowbizplan-team-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.nowbizplan-team-feedback {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.nowbizplan-team-feedback.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.nowbizplan-team-feedback.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===========================
   Team Members List
   =========================== */
.nowbizplan-team-list {
    margin-top: 20px;
}

.team-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.nowbizplan-no-members {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.nowbizplan-no-members p {
    font-size: 16px;
    margin: 0;
}

/* ===========================
   Member Card
   =========================== */
.nowbizplan-member-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    padding: 16px;
    transition: all 0.3s ease;
}

.nowbizplan-member-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-left-width: 6px;
}

.nowbizplan-member-card.role-owner {
    border-left-color: #dc3545;
}

.nowbizplan-member-card.role-admin {
    border-left-color: #fd7e14;
}

.nowbizplan-member-card.role-editor {
    border-left-color: #28a745;
}

.nowbizplan-member-card.role-viewer {
    border-left-color: #6c757d;
}

/* Owner Read-Only Card */
.nowbizplan-member-card.member-owner-readonly {
    background: #fffbf0;
    border: 2px solid #ffc107;
    border-left: 4px solid #dc3545;
}

.nowbizplan-member-card.member-owner-readonly:hover {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
}

/* Member Header */
.member-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.member-avatar {
    flex-shrink: 0;
}

.avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 700;
}

.avatar-initial.avatar-owner {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: 3px solid #ffc107;
    box-shadow: 0 0 0 2px #fff, 0 0 10px rgba(220, 53, 69, 0.3);
}

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

.member-name {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.owner-badge {
    display: inline-flex;
    align-items: center;
    color: #ffc107;
    animation: pulse-star 2s ease-in-out infinite;
}

.owner-badge .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

@keyframes pulse-star {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.member-display-name {
    display: block;
    font-size: 12px;
    color: #777;
    font-style: italic;
}

.member-role {
    flex-shrink: 0;
}

/* Role Badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.role-owner {
    background: #dc3545;
    color: #fff;
}

.role-badge.role-admin {
    background: #fd7e14;
    color: #fff;
}

.role-badge.role-editor {
    background: #28a745;
    color: #fff;
}

.role-badge.role-viewer {
    background: #6c757d;
    color: #fff;
}

/* Permissions */
.member-permissions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 11px;
    color: #999;
}

.permission-item.active {
    background: #d4edda;
    color: #28a745;
}

.permission-item .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.permission-item.active .dashicons {
    color: #28a745;
}

/* Member Actions */
.member-actions {
    display: flex;
    gap: 8px;
}

.member-role-select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.member-remove-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 12px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.member-remove-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.member-remove-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Owner Read-Only Notice */
.owner-readonly-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 12px;
    color: #856404;
    font-weight: 600;
    width: 100%;
}

.owner-readonly-notice .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #ffc107;
}

/* ===========================
   Loading State
   =========================== */
.nowbizplan-team-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .nowbizplan-team-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .nowbizplan-team-stats {
        width: 100%;
        justify-content: space-between;
    }

    .stat-item {
        flex: 1;
        padding: 8px 10px;
    }

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

    .member-permissions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nowbizplan-team-container {
        padding: 15px;
    }

    .nowbizplan-team-title {
        font-size: 20px;
    }

    .stat-value {
        font-size: 18px;
    }

    .member-header {
        flex-wrap: wrap;
    }

    .member-role {
        width: 100%;
        margin-top: 8px;
    }

    .member-actions {
        flex-direction: column;
    }

    .member-role-select,
    .member-remove-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    .member-actions,
    .nowbizplan-toggle-add-member,
    .nowbizplan-add-member-form {
        display: none !important;
    }

    .nowbizplan-team-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
