/* ==============================================
   Notes Module Styles
   ============================================== */

/* Page Layout */
.notes-page {
    padding: var(--spacing-xl);
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
}

.notes-page .page-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.notes-page .page-title svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
}

.notes-page .page-subtitle {
    color: var(--text-tertiary);
    font-size: 14px;
    margin: 4px 0 0 0;
}

/* Header Actions */
.page-header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.notes-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.notes-search-wrapper svg {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    stroke: var(--text-tertiary);
    fill: none;
    stroke-width: 2;
    pointer-events: none;
}

.notes-search-input {
    padding: 10px 14px 10px 38px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    width: 250px;
    transition: all 0.2s ease;
}

.notes-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.notes-search-input::placeholder {
    color: var(--text-tertiary);
}

/* Tabs */
.notes-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--spacing-sm);
}

.notes-tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notes-tab svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.notes-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.notes-tab.active {
    background: var(--accent);
    color: white;
}

.notes-tab.active svg {
    stroke: white;
}

.tab-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.notes-tab:not(.active) .tab-count {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
}

/* Container */
.notes-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: var(--spacing-lg);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Notes List */
.notes-list {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.notes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xxl);
    text-align: center;
    color: var(--text-tertiary);
    flex: 1;
}

.notes-empty svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-tertiary);
    fill: none;
    stroke-width: 1.5;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.notes-empty p {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-secondary);
}

.notes-empty span {
    font-size: 13px;
}

/* Note Item */
.note-item {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.note-item:hover {
    background: var(--bg-card-hover);
}

.note-item.active {
    background: rgba(0, 122, 255, 0.1);
    border-left: 3px solid var(--accent);
}

.note-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: 6px;
}

.note-item-subject {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-item-preview {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.note-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-tertiary);
}

.note-item-author {
    font-weight: 500;
}

.note-item-date {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Player Info Item */
.player-info-item .note-item-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.player-info-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
}

.player-info-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-info-avatar .avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.player-info-header-content {
    flex: 1;
    min-width: 0;
}

.player-info-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 2px;
}

/* Player Info Detail */
.player-info-detail-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(0, 122, 255, 0.05) 100%);
    border-bottom: 1px solid var(--border);
}

.player-info-detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 3px solid var(--accent);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.player-info-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-info-detail-avatar .avatar-fallback-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.player-info-detail-player {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-info-detail-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.player-info-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.player-info-link:hover {
    text-decoration: underline;
}

/* Note Detail */
.note-detail {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.note-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-tertiary);
}

.note-detail-empty svg {
    width: 64px;
    height: 64px;
    stroke: var(--text-tertiary);
    fill: none;
    stroke-width: 1.5;
    margin-bottom: var(--spacing-md);
    opacity: 0.3;
}

.note-detail-empty p {
    font-size: 14px;
    margin: 0;
}

.note-detail-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.note-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.note-detail-subject {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    flex: 1;
}

.note-detail-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.note-detail-actions .btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.btn-danger-hover:hover {
    color: var(--danger) !important;
}

.note-detail-meta {
    display: flex;
    gap: var(--spacing-lg);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-secondary);
    font-size: 12px;
    color: var(--text-tertiary);
}

.note-detail-body {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Modal Form */
.note-modal-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.note-modal-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.note-modal-form .form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.note-modal-form .form-input {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.note-modal-form .form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.note-modal-form .form-textarea {
    resize: vertical;
    min-height: 150px;
    font-family: inherit;
}

/* Responsive */
@media (max-width: 1024px) {
    .notes-container {
        grid-template-columns: 280px 1fr;
    }
}

@media (max-width: 768px) {
    .notes-page {
        padding: 8px 0 0 0;
        height: calc(100vh - 60px);
        overflow: hidden;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        margin: 0;
        border: none;
    }

    .notes-page .page-header {
        flex-direction: column;
        gap: 8px;
        flex-shrink: 0;
        padding: 0 12px;
        margin-bottom: 8px;
        border-bottom: none;
        padding-bottom: 0;
    }

    .notes-page .page-header-content {
        width: 100%;
    }

    .notes-page .page-title {
        font-size: 18px;
    }

    .notes-page .page-subtitle {
        display: none;
    }

    .page-header-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .page-header-actions .notes-search-wrapper {
        flex: 1;
        min-width: 100px;
    }

    .page-header-actions .filter-group {
        flex: 1;
        min-width: 80px;
    }

    .page-header-actions .filter-group .form-select {
        width: 100%;
        min-width: unset;
        font-size: 12px;
        padding: 8px 24px 8px 8px;
    }

    .notes-search-input {
        width: 100%;
        font-size: 12px;
        padding: 8px 10px 8px 32px;
    }

    .page-header-actions > .btn {
        width: 100%;
        justify-content: center;
        font-size: 12px;
        padding: 8px 12px;
    }

    /* Tabs responsive - bord à bord */
    .notes-tabs {
        display: flex;
        gap: 0;
        padding: 0;
        margin: 0 0 8px 0;
        flex-shrink: 0;
        flex-wrap: nowrap;
        overflow: hidden;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }

    .notes-tab {
        flex: 1;
        padding: 10px 4px;
        font-size: 11px;
        white-space: nowrap;
        justify-content: center;
        min-width: 0;
        border-radius: 0;
        border-bottom: 2px solid transparent;
        margin-bottom: -1px;
    }

    .notes-tab.active {
        background: transparent;
        color: var(--accent);
        border-bottom-color: var(--accent);
    }

    .notes-tab svg {
        display: none;
    }

    .tab-count {
        font-size: 9px;
        padding: 1px 4px;
    }

    /* Container - bord à bord */
    .notes-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        overflow: hidden;
        flex: 1;
        min-height: 0;
        gap: 0;
        margin: 0;
        padding: 0;
    }

    /* Discussions container mobile */
    .discussions-container {
        grid-template-columns: 1fr !important;
        flex: 1;
        min-height: 0;
        overflow: hidden;
        gap: 0;
        margin: 0 !important;
        padding: 0 !important;
    }

    .discussion-thread {
        display: none;
    }

    /* Listes - bord à bord complet */
    .discussions-list {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        border-radius: 0;
        border: none !important;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .notes-list {
        max-height: none;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        border-radius: 0;
        border: none !important;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .note-item:last-child,
    .discussion-item:last-child {
        border-bottom: none;
    }

    /* Items - padding interne */
    .note-item {
        padding: 12px;
        border-radius: 0;
        margin: 0;
    }

    .discussion-item {
        padding: 12px;
        margin: 0;
    }

    /* Hide detail panel on mobile - use bottom sheet instead */
    .note-detail {
        display: none;
    }

    /* Bottom Sheet */
    .note-bottom-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 85vh;
        background: #ffffff;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    [data-theme="dark"] .note-bottom-sheet {
        background: #1e293b;
    }

    .note-bottom-sheet.open {
        transform: translateY(0);
    }

    .note-bottom-sheet-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .note-bottom-sheet-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .note-bottom-sheet-handle {
        display: flex;
        justify-content: center;
        padding: 12px;
        cursor: grab;
    }

    .note-bottom-sheet-handle::before {
        content: '';
        width: 40px;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
    }

    .note-bottom-sheet-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0 var(--spacing-lg) var(--spacing-md);
        border-bottom: 1px solid var(--border);
    }

    .note-bottom-sheet-title {
        font-size: 18px;
        font-weight: 700;
        margin: 0;
        flex: 1;
        padding-right: var(--spacing-md);
    }

    .note-bottom-sheet-actions {
        display: flex;
        gap: var(--spacing-xs);
    }

    .note-bottom-sheet-meta {
        display: flex;
        gap: var(--spacing-md);
        padding: var(--spacing-sm) var(--spacing-lg);
        background: var(--bg-secondary);
        font-size: 12px;
        color: var(--text-tertiary);
    }

    .note-bottom-sheet-body {
        flex: 1;
        padding: var(--spacing-lg);
        overflow-y: auto;
        font-size: 14px;
        line-height: 1.7;
        color: var(--text-primary);
    }
}

/* Dark mode */
[data-theme="dark"] .note-item.active {
    background: rgba(0, 122, 255, 0.15);
}

/* Light mode */
[data-theme="light"] .notes-list,
[data-theme="light"] .note-detail {
    background: var(--bg-primary);
}

[data-theme="light"] .note-detail-meta {
    background: var(--bg-secondary);
}

/* ==============================================
   Filter in Header
   ============================================== */

.page-header-actions .filter-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.page-header-actions .form-select {
    padding: 10px 32px 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.page-header-actions .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* ==============================================
   Delete Message Button
   ============================================== */

.btn-delete-message {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
    margin-left: auto;
}

.message:hover .btn-delete-message {
    opacity: 0.6;
}

.btn-delete-message:hover {
    opacity: 1 !important;
    background: rgba(239, 68, 68, 0.1);
}

.btn-delete-message svg {
    width: 14px;
    height: 14px;
    stroke: var(--danger);
    fill: none;
    stroke-width: 2;
}

.message-own .btn-delete-message svg {
    stroke: rgba(255, 255, 255, 0.8);
}

.message-own .btn-delete-message:hover {
    background: rgba(255, 255, 255, 0.15);
}

.message-own .btn-delete-message:hover svg {
    stroke: white;
}

/* Message Actions Container */
.message-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

/* Edit Message Button */
.btn-edit-message {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
}

.message:hover .btn-edit-message {
    opacity: 0.6;
}

.btn-edit-message:hover {
    opacity: 1 !important;
    background: rgba(0, 122, 255, 0.1);
}

.btn-edit-message svg {
    width: 14px;
    height: 14px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
}

.message-own .btn-edit-message svg {
    stroke: rgba(255, 255, 255, 0.8);
}

.message-own .btn-edit-message:hover {
    background: rgba(255, 255, 255, 0.15);
}

.message-own .btn-edit-message:hover svg {
    stroke: white;
}

@media (max-width: 768px) {
    .btn-edit-message {
        opacity: 0.6;
    }
}

/* ==============================================
   Bottom Sheet for Discussions (Mobile)
   ============================================== */

.bottom-sheet-messages {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    max-height: calc(60vh - 120px);
    overflow-y: auto;
}

.bottom-sheet-reply-box {
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
    margin-top: var(--spacing-md);
}

.bottom-sheet-reply-box .reply-input-container {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-end;
}

.bottom-sheet-reply-box .reply-input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 14px;
    color: var(--text-primary);
    resize: none;
    min-height: 40px;
    max-height: 100px;
    font-family: inherit;
    line-height: 1.5;
}

.bottom-sheet-reply-box .reply-input:focus {
    outline: none;
    border-color: var(--accent);
}

.bottom-sheet-reply-box .btn-send {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bottom-sheet-reply-box .btn-send svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Messages in bottom sheet */
.note-bottom-sheet-body .message {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 85%;
}

.note-bottom-sheet-body .message-own {
    flex-direction: row-reverse;
    margin-left: auto;
}

.note-bottom-sheet-body .message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-bottom-sheet-body .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.note-bottom-sheet-body .message-avatar .avatar-fallback {
    color: white;
    font-size: 11px;
    font-weight: 600;
}

.note-bottom-sheet-body .message-bubble {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm) var(--spacing-md);
}

.note-bottom-sheet-body .message-own .message-bubble {
    background: var(--accent);
    color: white;
}

.note-bottom-sheet-body .message-parent .message-bubble {
    border: 2px solid var(--accent);
}

.note-bottom-sheet-body .message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: 2px;
}

.note-bottom-sheet-body .message-author {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
}

.note-bottom-sheet-body .message-own .message-author {
    color: rgba(255, 255, 255, 0.9);
}

.note-bottom-sheet-body .message-time {
    font-size: 10px;
    color: var(--text-tertiary);
}

.note-bottom-sheet-body .message-own .message-time {
    color: rgba(255, 255, 255, 0.7);
}

.note-bottom-sheet-body .message-content {
    font-size: 13px;
    line-height: 1.4;
}

/* ==============================================
   Player Info in Discussions ("On en parle")
   ============================================== */

.player-info-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: #8b5cf6;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: var(--spacing-xs);
}

.player-info-discussion .discussion-avatar.player-avatar {
    border: 2px solid #8b5cf6;
}

.player-info-discussion .discussion-subject {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

/* Player Info Thread Header */
.player-info-thread-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.player-info-thread-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 3px solid #8b5cf6;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.player-info-thread-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-info-thread-avatar .avatar-fallback-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #8b5cf6;
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.player-info-thread-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-info-thread-info .thread-subject {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.player-info-thread-info .player-info-badge {
    width: fit-content;
}

/* Player Info Card in Thread */
.player-info-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.player-info-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-bottom: 1px solid var(--border);
}

.player-info-card-label {
    font-size: 14px;
    font-weight: 600;
    color: #8b5cf6;
}

.player-info-card-author {
    font-size: 12px;
    color: var(--text-tertiary);
}

.player-info-card-content {
    padding: var(--spacing-lg);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Thread Reply Hint */
.thread-reply-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
    margin-bottom: var(--spacing-md);
}

/* Bottom Sheet Actions for Player Info */
.bottom-sheet-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
}

.bottom-sheet-actions .btn {
    flex: 1;
    justify-content: center;
}

/* ==============================================
   Onglet "Tout" — colonne unique de gauche
   ============================================== */

.note-item.all-item .note-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.all-item-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.all-item-badge.badge-note {
    background: rgba(10, 132, 255, 0.15);
    color: var(--primary);
}
.all-item-badge.badge-info {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}
.all-item-badge.badge-discussion {
    background: rgba(175, 82, 222, 0.15);
    color: var(--purple);
}

.notes-list-all .note-item.all-item .note-item-subject {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==============================================
   PIÈCES JOINTES (PDF / Image / Lien URL)
   ============================================== */

.note-attach-picker {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.note-attach-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.note-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.note-attach-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.note-attach-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.note-attach-link-row {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.note-attach-link-row .form-input {
    flex: 1 1 160px;
    min-width: 0;
    font-size: 0.85rem;
}

.note-attach-pending {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.note-attach-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 240px;
    padding: 4px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.note-attach-chip svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.note-attach-chip .chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-attach-chip .chip-remove {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.note-attach-chip .chip-remove:hover {
    color: var(--danger, #e5484d);
}

/* Affichage des pièces jointes */
.note-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.note-attachment {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 260px;
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.note-attachment:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.note-attachment svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.note-attachment .note-attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-attachment-image {
    padding: 0;
    overflow: hidden;
    width: 110px;
    height: 90px;
}

.note-attachment-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.note-attachment-remove {
    position: absolute;
    top: 2px;
    right: 3px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 1;
    font-size: 0.85rem;
    cursor: pointer;
    display: none;
}

.note-attachment:hover .note-attachment-remove {
    display: block;
}

.note-attachment-file .note-attachment-remove,
.note-attachment-link .note-attachment-remove {
    position: static;
    display: inline-block;
    background: none;
    color: var(--text-tertiary);
    width: auto;
    height: auto;
}

.note-attachment-file:hover .note-attachment-remove:hover,
.note-attachment-link:hover .note-attachment-remove:hover {
    color: var(--danger, #e5484d);
}

.thread-reply-box .note-attach-picker {
    margin-bottom: var(--spacing-sm);
}

.thread-reply-box .note-attach-picker.compact .note-attach-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
}
