/**
 * SOS Storytelling - Collaboration Styles
 * Styles pour workspaces, team, comments, notifications
 */

/* ============ TOASTS ============ */
.collab-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.collab-toast.show {
    transform: translateX(-50%) translateY(0);
}

.collab-toast-success { background: linear-gradient(135deg, #10b981, #059669); }
.collab-toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.collab-toast-info { background: linear-gradient(135deg, #667eea, #764ba2); }

.collab-toast-icon {
    font-size: 1.2em;
}

/* ============ WORKSPACE SWITCHER ============ */
.workspace-switcher {
    position: relative;
    margin-right: 10px;
}

.workspace-switcher.hidden {
    display: none;
}

.workspace-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.workspace-current:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.workspace-logo {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
}

.workspace-logo img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
}

.workspace-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-role-badge {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.workspace-role-badge.admin {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.workspace-role-badge.member {
    background: #e0e0e0;
    color: #666;
}

.workspace-arrow {
    font-size: 0.7em;
    color: #999;
    transition: transform 0.2s;
}

.workspace-dropdown.show .workspace-arrow {
    transform: rotate(180deg);
}

.workspace-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1000;
    margin-top: 8px;
    padding: 8px;
    display: none;
    animation: dropdownFade 0.2s ease;
}

.workspace-dropdown.show {
    display: block;
}

.workspace-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
}

.workspace-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.workspace-dropdown-item:hover {
    background: #f5f5f5;
}

.workspace-dropdown-item.active {
    background: linear-gradient(135deg, #f8f9ff, #f0f4ff);
    border: 1px solid #e0e5ff;
}

.workspace-dropdown-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.workspace-dropdown-item-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.workspace-dropdown-item-role {
    font-size: 0.75em;
    color: #888;
}

.workspace-check {
    color: #10b981;
    font-weight: bold;
}

.workspace-dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
}

.workspace-dropdown-action {
    color: #667eea;
}

.workspace-dropdown-action:hover {
    background: linear-gradient(135deg, #f8f9ff, #f0f4ff);
}

.workspace-dropdown-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 0.9em;
}

/* ============ NOTIFICATIONS ============ */
.notification-btn {
    position: relative;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1em;
    transition: all 0.2s;
}

.notification-btn:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.notification-btn.hidden {
    display: none;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.65em;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    max-height: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1000;
    margin-top: 8px;
    display: none;
    animation: dropdownFade 0.2s ease;
    overflow: hidden;
}

.notification-dropdown.show {
    display: block;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.notification-header h3 {
    font-size: 1em;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-mark-all {
    background: none;
    border: none;
    color: #667eea;
    font-size: 0.85em;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.2s;
}

.notification-mark-all:hover {
    background: #f5f5f5;
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
}

.notification-item:hover {
    background: #f9f9f9;
}

.notification-item.unread {
    background: linear-gradient(135deg, #f8f9ff, #fff);
}

.notification-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-title {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
    line-height: 1.3;
}

.notification-body {
    color: #666;
    font-size: 0.8em;
    line-height: 1.4;
}

.notification-time {
    color: #999;
    font-size: 0.75em;
}

.notification-unread-dot {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.notification-empty-icon {
    font-size: 2.5em;
    opacity: 0.5;
}

/* ============ TEAM MODAL ============ */
.collab-modal {
    max-width: 600px;
    width: 95%;
}

.collab-modal-small {
    max-width: 400px;
}

.team-invite-section {
    background: linear-gradient(135deg, #f8f9ff, #f0f4ff);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 2px solid #e0e5ff;
}

.team-invite-section h3 {
    font-size: 1em;
    color: #333;
    margin-bottom: 15px;
}

.team-invite-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.team-invite-form .collab-input {
    flex: 1;
    min-width: 200px;
}

.team-section {
    margin-bottom: 25px;
}

.team-section h3 {
    font-size: 0.95em;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.team-member-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 12px;
    transition: all 0.2s;
}

.team-member-card:hover {
    background: #f5f5f5;
}

.team-member-card.invitation {
    background: linear-gradient(135deg, #fff8f0, #fff5eb);
    border: 1px dashed #f5a623;
}

.team-member-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.team-member-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1em;
}

.team-member-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team-member-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.team-member-email {
    color: #666;
    font-size: 0.8em;
}

.team-member-role {
    color: #888;
    font-size: 0.8em;
}

.team-member-role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 600;
    margin-top: 3px;
}

.team-member-role-badge.admin {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.team-member-role-badge.member {
    background: #e0e0e0;
    color: #666;
}

.team-member-meta {
    color: #888;
    font-size: 0.75em;
}

.team-member-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-info {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 12px;
}

.team-limits {
    display: flex;
    gap: 30px;
}

.team-limit-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-limit-label {
    color: #888;
    font-size: 0.85em;
}

.team-limit-value {
    font-weight: 700;
    color: #333;
    font-size: 1.1em;
}

/* ============ COMMENTS PANEL ============ */
.comments-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    background: white;
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.comments-panel.show {
    right: 0;
}

.comments-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.comments-panel-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comments-panel-title span:first-child {
    font-weight: 700;
    font-size: 1.1em;
}

.comments-panel-subtitle {
    font-size: 0.85em;
    opacity: 0.9;
}

.comments-panel-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.2s;
}

.comments-panel-close:hover {
    background: rgba(255,255,255,0.3);
}

.comments-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.comments-panel-input {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.comments-panel-input textarea {
    flex: 1;
    min-height: 40px;
    max-height: 100px;
    resize: vertical;
}

.comments-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    text-align: center;
}

.comments-empty-icon {
    font-size: 3em;
    opacity: 0.4;
    margin-bottom: 10px;
}

.comments-empty-hint {
    font-size: 0.85em;
    color: #bbb;
    margin-top: 5px;
}

.comment-item {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 12px;
    margin-bottom: 15px;
}

.comment-item.resolved {
    opacity: 0.7;
    background: #f5fff5;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85em;
}

.comment-avatar.small {
    width: 24px;
    height: 24px;
    font-size: 0.7em;
}

.comment-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.comment-author {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.comment-time {
    color: #999;
    font-size: 0.75em;
}

.comment-resolved-badge {
    margin-left: auto;
    background: #10b981;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 600;
}

.comment-body {
    color: #333;
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.comment-actions {
    display: flex;
    gap: 10px;
}

.comment-action-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 0.8em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 5px;
    transition: all 0.2s;
}

.comment-action-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.comment-action-delete:hover {
    background: #fee;
    color: #e53935;
}

.comment-reply {
    margin-left: 40px;
    padding: 12px;
    background: white;
    border-radius: 10px;
    margin-top: 10px;
    border-left: 3px solid #667eea;
}

.comment-reply-input {
    margin-top: 10px;
    margin-left: 40px;
}

.comment-reply-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* ============ COMMON COMPONENTS ============ */
.collab-input {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95em;
    transition: all 0.2s;
    width: 100%;
}

.collab-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.collab-textarea {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9em;
    resize: vertical;
    min-height: 60px;
    width: 100%;
    transition: all 0.2s;
}

.collab-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.collab-textarea.small {
    min-height: 40px;
    font-size: 0.85em;
}

.collab-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95em;
    background: white;
    cursor: pointer;
    min-width: 120px;
}

.collab-select:focus {
    outline: none;
    border-color: #667eea;
}

.collab-select-small {
    padding: 6px 10px;
    font-size: 0.8em;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
}

.collab-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.collab-btn:hover {
    transform: translateY(-2px);
}

.collab-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.collab-btn-primary:hover {
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.collab-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.collab-btn-secondary:hover {
    background: #e0e0e0;
}

.collab-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.collab-btn-danger-small {
    background: #fee;
    color: #e53935;
    padding: 6px 12px;
    font-size: 0.8em;
    border-radius: 8px;
}

.collab-btn-danger-small:hover {
    background: #fdd;
}

.collab-btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 8px;
}

.collab-btn-full {
    width: 100%;
}

.collab-loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
    font-weight: 600;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .workspace-switcher {
        order: -1;
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
    }

    .workspace-current {
        width: 100%;
        justify-content: center;
    }

    .workspace-dropdown {
        width: 100%;
        left: 0;
        right: 0;
    }

    .notification-dropdown {
        width: 100%;
        right: 0;
        left: 0;
        margin: 8px;
        width: calc(100% - 16px);
    }

    .comments-panel {
        width: 100%;
        right: -100%;
    }

    .team-invite-form {
        flex-direction: column;
    }

    .team-member-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .team-member-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .team-limits {
        flex-direction: column;
        gap: 15px;
    }
}
