/* ===================================================================
   TeamWorkspace.css — Premium team collaboration workspace styling.
   Glass/gradient dark aesthetic with micro-animations.
   =================================================================== */

/* ====================== TEAM HEADER ====================== */

.team-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(var(--accent)) 100%);
    border: 1px solid hsl(var(--border));
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.team-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, hsl(var(--primary) / 0.05) 100%);
    pointer-events: none;
}

.team-header-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: hsl(var(--foreground));
}

.team-header-desc {
    font-size: 11px;
    color: hsl(var(--muted-foreground));
}

/* ====================== MEMBERS PANEL ====================== */

.members-panel {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    animation: slideDown 0.2s ease-out;
}

.members-panel .member-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    transition: background 0.15s;
    border-radius: 6px;
}

.members-panel .member-row:hover {
    background: hsl(var(--accent) / 0.5);
}

.member-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid hsl(var(--border));
    object-fit: cover;
    flex-shrink: 0;
}

.member-avatar-fallback {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, hsl(var(--primary) / 0.3), hsl(var(--primary) / 0.1));
    color: hsl(var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
    border: 1px solid hsl(var(--primary) / 0.2);
}

/* ====================== EDITOR ====================== */

.team-editor {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    padding: 14px 16px 10px;
    margin-bottom: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.team-editor:focus-within {
    border-color: hsl(var(--primary) / 0.5);
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.08);
}

.team-editor textarea {
    width: 100%;
    min-height: 48px;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-size: 13px;
    line-height: 1.6;
    color: hsl(var(--foreground));
    font-family: inherit;
}

.team-editor textarea::placeholder {
    color: hsl(var(--muted-foreground) / 0.5);
}

/* ====================== SEARCH ====================== */

.team-search {
    position: relative;
    margin-bottom: 12px;
}

.team-search input {
    width: 100%;
    padding: 7px 12px 7px 32px;
    font-size: 12px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    color: hsl(var(--foreground));
    outline: none;
    transition: border-color 0.2s;
}

.team-search input:focus {
    border-color: hsl(var(--primary) / 0.4);
}

.team-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: hsl(var(--muted-foreground));
}

/* ====================== TABS ====================== */

.team-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 14px;
    background: hsl(var(--accent) / 0.3);
    border-radius: 8px;
    padding: 3px;
}

.team-tab {
    flex: 1;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: hsl(var(--muted-foreground));
    background: transparent;
}

.team-tab.active {
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    box-shadow: 0 1px 3px hsl(0 0% 0% / 0.1);
}

.team-tab:hover:not(.active) {
    color: hsl(var(--foreground));
}

/* ====================== MEMO CARDS ====================== */

.team-memo-card {
    position: relative;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    cursor: default;
}

.team-memo-card:hover {
    border-color: hsl(var(--primary) / 0.25);
    box-shadow: 0 2px 12px hsl(var(--primary) / 0.05);
}

.team-memo-card.pinned {
    border-left: 3px solid hsl(var(--primary) / 0.6);
}

.team-memo-card.pending {
    border-left: 3px solid hsl(220 80% 60% / 0.6);
}

.team-memo-card.approved {
    border-left: 3px solid hsl(140 60% 50% / 0.6);
}

/* Card header */
.memo-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.memo-card-author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.memo-card-author-name {
    font-size: 12px;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.memo-card-time {
    font-size: 10px;
    color: hsl(var(--muted-foreground));
}

.memo-card-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}

.team-memo-card:hover .memo-card-actions {
    opacity: 1;
}

.memo-action-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    color: hsl(var(--muted-foreground));
}

.memo-action-btn:hover {
    background: hsl(var(--accent));
    color: hsl(var(--foreground));
}

.memo-action-btn.danger:hover {
    color: hsl(0 70% 60%);
    background: hsl(0 70% 60% / 0.1);
}

.memo-action-btn.success:hover {
    color: hsl(140 60% 50%);
    background: hsl(140 60% 50% / 0.1);
}

.memo-action-btn.info:hover {
    color: hsl(220 80% 60%);
    background: hsl(220 80% 60% / 0.1);
}

/* Content */
.memo-card-content {
    font-size: 13px;
    line-height: 1.65;
    color: hsl(var(--foreground) / 0.9);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 6px;
}

/* Tags */
.memo-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.memo-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 4px;
    background: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
    transition: background 0.15s;
    cursor: pointer;
}

.memo-tag:hover {
    background: hsl(var(--primary) / 0.2);
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.status-badge.status-draft {
    background: hsl(0 0% 50% / 0.15);
    color: hsl(0 0% 55%);
}

.status-badge.status-pending {
    background: hsl(220 80% 60% / 0.15);
    color: hsl(220 80% 65%);
}

.status-badge.status-approved {
    background: hsl(140 60% 50% / 0.15);
    color: hsl(140 60% 55%);
}

.status-badge.status-merged {
    background: hsl(160 50% 45% / 0.15);
    color: hsl(160 50% 50%);
}

/* ====================== REACTIONS ====================== */

.reaction-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid hsl(var(--border));
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
    color: hsl(var(--muted-foreground));
}

.reaction-pill:hover {
    border-color: hsl(var(--primary) / 0.4);
    color: hsl(var(--foreground));
}

.reaction-pill.active {
    border-color: hsl(var(--primary) / 0.5);
    background: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
}

.reaction-picker {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    display: none;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
    box-shadow: 0 4px 16px hsl(0 0% 0% / 0.15);
    z-index: 10;
}

.reaction-add:hover .reaction-picker {
    display: flex;
}

.reaction-pick-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 13px;
}

.reaction-pick-btn:hover {
    background: hsl(var(--accent));
}

/* ====================== COMMENTS ====================== */

.comment-thread {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid hsl(var(--border) / 0.5);
    animation: slideDown 0.15s ease-out;
}

.comment-item {
    display: flex;
    gap: 8px;
    padding: 4px 0;
}

.comment-item .comment-delete {
    opacity: 0;
    transition: opacity 0.15s;
}

.comment-item:hover .comment-delete {
    opacity: 1;
}

.comment-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.comment-input-row input {
    flex: 1;
    padding: 5px 10px;
    font-size: 12px;
    background: hsl(var(--accent) / 0.4);
    border: 1px solid hsl(var(--border));
    border-radius: 6px;
    color: hsl(var(--foreground));
    outline: none;
    transition: border-color 0.2s;
}

.comment-input-row input:focus {
    border-color: hsl(var(--primary) / 0.4);
}

/* ====================== EDIT MODE ====================== */

.edit-textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.6;
    background: hsl(var(--accent) / 0.3);
    border: 1px solid hsl(var(--primary) / 0.3);
    border-radius: 8px;
    color: hsl(var(--foreground));
    outline: none;
    resize: none;
    font-family: inherit;
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
}

.edit-btn {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.edit-btn.cancel {
    background: hsl(var(--accent));
    color: hsl(var(--muted-foreground));
    border: 1px solid hsl(var(--border));
}

.edit-btn.cancel:hover {
    background: hsl(var(--accent) / 0.8);
}

.edit-btn.save {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.edit-btn.save:hover {
    opacity: 0.9;
}

/* ====================== SECTION LABELS ====================== */

.section-label {
    padding: 12px 2px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: hsl(var(--muted-foreground) / 0.4);
    user-select: none;
}

/* ====================== EMPTY STATE ====================== */

.team-empty {
    padding: 48px 0;
    text-align: center;
    font-size: 13px;
    color: hsl(var(--muted-foreground));
}

/* ====================== REVIEW DIALOG ====================== */

.review-dialog {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid hsl(0 60% 50% / 0.3);
    border-radius: 8px;
    background: hsl(0 60% 50% / 0.05);
    animation: slideDown 0.15s ease-out;
}

.review-dialog input {
    width: 100%;
    padding: 5px 10px;
    font-size: 12px;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: 6px;
    color: hsl(var(--foreground));
    outline: none;
    margin: 6px 0;
}

/* ====================== ANIMATIONS ====================== */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================== INVITE CODE ====================== */

.invite-code {
    font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 2px 8px;
    background: hsl(var(--accent));
    border-radius: 4px;
    letter-spacing: 0.04em;
    user-select: all;
}
