/**
 * Team Management Styles
 * Multi-user label system UI
 * Dark theme compatible
 */

/* =============================================================================
   Dark Theme Variables Override
   ============================================================================= */

:root {
    --card-bg: #121212;
    --bg-subtle: #1a1a1a;
    --hover-bg: rgba(255, 255, 255, 0.05);
    --border-color: #2a2a2a;
    --border-color-light: #1f1f1f;
    --text-primary: #e5e5e5;
    --text-secondary: #808080;
    --text-muted: #666;
    --primary-color: #8B4513;
    --primary-hover: #A0522D;
    --warning-bg: rgba(234, 179, 8, 0.15);
    --warning-text: #eab308;
}

/* =============================================================================
   Team Page Layout
   ============================================================================= */

.team-page {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.team-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 0;
}

.team-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary, #666);
}

.team-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-stat-value {
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

/* =============================================================================
   Members Table
   ============================================================================= */

.members-table-container {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 2rem;
}

.members-table {
    width: 100%;
    border-collapse: collapse;
}

.members-table th {
    text-align: left;
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
}

.members-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color-light);
    vertical-align: middle;
    color: var(--text-primary);
}

.members-table tr:last-child td {
    border-bottom: none;
}

.members-table tr:hover {
    background: var(--hover-bg);
}

/* Member Cell */
.member-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-subtle, #f0f0f0);
}

.member-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color, #007bff);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.member-info {
    display: flex;
    flex-direction: column;
}

.member-name {
    font-weight: 500;
    color: var(--text-primary);
}

.member-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Role Badge */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.role-badge.owner {
    background: #fef3cd;
    color: #856404;
}

.role-badge.admin {
    background: #d4edda;
    color: #155724;
}

.role-badge.member {
    background: #cce5ff;
    color: #004085;
}

.role-badge.readonly {
    background: #e2e3e5;
    color: #383d41;
}

/* Role Select */
.role-select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--bg-subtle);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 120px;
}

.role-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Action Buttons */
.member-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-btn.remove {
    background: #fee2e2;
    color: #dc2626;
}

.action-btn.remove:hover {
    background: #fecaca;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================================================
   Invite Form
   ============================================================================= */

.invite-section {
    background: var(--card-bg, white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.invite-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-primary, #1a1a1a);
}

.invite-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

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

.form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    font-size: 0.875rem;
    min-width: 200px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted, #999);
}

.invite-btn {
    padding: 0.625rem 1.25rem;
    background: var(--primary-color, #007bff);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.invite-btn:hover {
    background: var(--primary-hover, #0056b3);
}

.invite-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =============================================================================
   Pending Invitations
   ============================================================================= */

.pending-invitations {
    background: var(--card-bg, white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
}

.pending-invitations h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-primary, #1a1a1a);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pending-count {
    background: var(--warning-bg, #fef3cd);
    color: var(--warning-text, #856404);
    padding: 0.125rem 0.5rem;
    border-radius: 100px;
    font-size: 0.75rem;
}

.invitation-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.invitation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-subtle, #f8f9fa);
    border-radius: 8px;
}

.invitation-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.invitation-email {
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
}

.invitation-meta {
    font-size: 0.75rem;
    color: var(--text-secondary, #666);
}

.cancel-invite-btn {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary, #666);
    cursor: pointer;
}

.cancel-invite-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* =============================================================================
   Invitation Accept Page
   ============================================================================= */

.invite-accept-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle, #f5f5f5);
    padding: 2rem;
}

.invite-accept-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.invite-accept-card .logo {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary, #1a1a1a);
}

.invite-accept-card h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.invite-accept-card .label-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color, #007bff);
}

.invite-details {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-subtle, #f8f9fa);
    border-radius: 8px;
}

.invite-details p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary, #666);
}

.invite-details strong {
    color: var(--text-primary, #1a1a1a);
}

.invite-form-full {
    text-align: left;
    margin-top: 1.5rem;
}

.invite-form-full .form-group {
    margin-bottom: 1rem;
}

.invite-form-full input {
    width: 100%;
    box-sizing: border-box;
}

.accept-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color, #007bff);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
}

.accept-btn:hover {
    background: var(--primary-hover, #0056b3);
}

.invite-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.invite-expired {
    color: var(--text-secondary, #666);
}

/* =============================================================================
   Empty States
   ============================================================================= */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary, #666);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary, #1a1a1a);
}

.empty-state p {
    margin: 0;
    font-size: 0.875rem;
}

/* =============================================================================
   Toasts / Notifications
   ============================================================================= */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #d4edda;
    color: #155724;
}

.toast.error {
    background: #f8d7da;
    color: #721c24;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 768px) {
    .team-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .invite-form {
        flex-direction: column;
        align-items: stretch;
    }

    .form-group input,
    .form-group select {
        min-width: auto;
        width: 100%;
    }

    .members-table th:nth-child(3),
    .members-table td:nth-child(3) {
        display: none;
    }

    .member-email {
        display: none;
    }
}
