/**
 * Fichier: assets/css/prouteau-chat.css
 * Styles complets pour Prouteau Chat
 * Design inspiré Instagram/WhatsApp/Messenger
 */

/* ========================================
   VARIABLES & RESET
======================================== */

:root {
    --chat-primary: #0084ff;
    --chat-secondary: #e4e6eb;
    --chat-accent: #00a8ff;
    --chat-success: #00c851;
    --chat-danger: #ff4444;
    --chat-warning: #ffbb33;
    --chat-text: #050505;
    --chat-text-secondary: #65676b;
    --chat-bg: #ffffff;
    --chat-bg-secondary: #f0f2f5;
    --chat-border: #e4e6eb;
    --chat-shadow: rgba(0, 0, 0, 0.1);
    --chat-bubble-own: var(--chat-primary);
    --chat-bubble-other: var(--chat-secondary);
}

.sasprouteau-chat {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
}

/* ========================================
   NAVIGATION PRINCIPALE
======================================== */

.chat-main-nav {
    display: flex;
    background: var(--chat-bg);
    border-bottom: 1px solid var(--chat-border);
    box-shadow: 0 1px 2px var(--chat-shadow);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover {
    background: var(--chat-bg-secondary);
}

.nav-item.active {
    color: var(--chat-primary);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--chat-primary);
}

.nav-icon {
    font-size: 1.5rem;
}

.nav-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--chat-secondary) center/cover no-repeat;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 600;
}

/* ========================================
   CONTENU PRINCIPAL
======================================== */

.chat-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.chat-view {
    position: absolute;
    inset: 0;
    display: none;
    overflow: auto;
}

.chat-view.active {
    display: block;
}

/* ========================================
   LAYOUT MESSAGERIE
======================================== */

.chat-layout {
    display: flex;
    height: 100%;
}

/* Sidebar conversations */
.conversations-sidebar {
    width: 360px;
    background: var(--chat-bg);
    border-right: 1px solid var(--chat-border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--chat-border);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--chat-bg-secondary);
    border-radius: 50%;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--chat-border);
    transform: scale(1.05);
}

/* Recherche conversations */
.sidebar-search {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--chat-border);
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: none;
    background: var(--chat-bg-secondary);
    border-radius: 1.25rem;
    font-size: 0.875rem;
}

.search-input:focus {
    outline: none;
    background: var(--chat-border);
}

/* Liste conversations */
.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.conversation-item:hover {
    background: var(--chat-bg-secondary);
}

.conversation-item.active {
    background: var(--chat-bg-secondary);
}

.conversation-item.pinned {
    background: #fffbf0;
}

.pin-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.75rem;
}

.conversation-avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--chat-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

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

.conversation-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-last-message {
    font-size: 0.875rem;
    color: var(--chat-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--chat-text-secondary);
}

.conversation-unread {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chat-primary);
    color: white;
    border-radius: 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ========================================
   ZONE CONVERSATION
======================================== */

.conversation-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
}

.no-conversation-selected {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--chat-text-secondary);
}

.no-conversation-selected .empty-icon {
    font-size: 5rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Header conversation */
.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--chat-border);
    background: var(--chat-bg);
}

.conversation-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.conversation-avatar-large {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--chat-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    overflow: hidden;
}

.conversation-header-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.conversation-status {
    font-size: 0.75rem;
    color: var(--chat-text-secondary);
}

.conversation-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Messages container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    background: var(--chat-bg-secondary);
    display: flex;
    flex-direction: column;
}

.loading-messages,
.error-state,
.empty-state-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.date-separator {
    text-align: center;
    margin: 1rem 0;
}

.date-separator span {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--chat-bg);
    border-radius: 1rem;
    font-size: 0.75rem;
    color: var(--chat-text-secondary);
    box-shadow: 0 1px 2px var(--chat-shadow);
}

/* Messages */
.chat-message {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.chat-message.own-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--chat-secondary) center/cover no-repeat;
    flex-shrink: 0;
    align-self: flex-end;
}

.message-content {
    max-width: 65%;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.own-message .message-content {
    align-items: flex-end;
}

.message-author {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--chat-text-secondary);
    padding: 0 0.75rem;
}

.message-bubble {
    padding: 0.625rem 0.875rem;
    border-radius: 1.125rem;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.other-message .message-bubble {
    background: var(--chat-bubble-other);
    color: var(--chat-text);
    border-bottom-left-radius: 0.25rem;
}

.own-message .message-bubble {
    background: var(--chat-bubble-own);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.message-text {
    line-height: 1.4;
}

.message-time {
    font-size: 0.6875rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.message-edited {
    font-style: italic;
    margin-left: 0.25rem;
}

/* Médias dans messages */
.message-image,
.message-video {
    margin-bottom: 0.5rem;
}

.message-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image img:hover {
    transform: scale(1.02);
}

.message-video video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.75rem;
}

/* Actions messages */
.message-actions {
    position: absolute;
    top: 0;
    right: -2.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-message:hover .message-actions {
    display: flex;
}

.message-action {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--chat-bg);
    border-radius: 50%;
    font-size: 0.875rem;
    cursor: pointer;
    box-shadow: 0 2px 4px var(--chat-shadow);
    transition: all 0.2s;
}

.message-action:hover {
    background: var(--chat-bg-secondary);
    transform: scale(1.1);
}

/* ========================================
   INPUT MESSAGE
======================================== */

.message-input-area {
    padding: 0.875rem 1.25rem;
    background: var(--chat-bg);
    border-top: 1px solid var(--chat-border);
}

.message-input-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.message-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background: var(--chat-bg-secondary);
    border-radius: 1.25rem;
    padding: 0.5rem 0.75rem;
}

.message-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    max-height: 150px;
    font-size: 0.9375rem;
    line-height: 1.4;
    font-family: inherit;
}

.message-input:focus {
    outline: none;
}

.btn-send {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--chat-primary);
    color: white;
    border-radius: 50%;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-send:hover {
    background: var(--chat-accent);
    transform: scale(1.05);
}

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

/* ========================================
   FIL D'ACTUALITÉ
======================================== */

.feed-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.feed-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.feed-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Post card */
.post-card {
    background: var(--chat-bg);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px var(--chat-shadow);
    overflow: hidden;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--chat-secondary) center/cover no-repeat;
}

.post-author {
    font-weight: 600;
    font-size: 0.9375rem;
}

.post-time {
    font-size: 0.8125rem;
    color: var(--chat-text-secondary);
}

.post-delete-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    font-size: 1.125rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.post-delete-btn:hover {
    background: var(--chat-bg-secondary);
}

.post-content {
    padding: 0 1rem 0.875rem;
}

.post-content p {
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.post-media {
    margin-top: 0.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.25rem;
}

.post-media img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-media img:hover {
    opacity: 0.9;
}

.post-stats {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--chat-border);
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--chat-text-secondary);
}

.post-actions {
    display: flex;
    padding: 0.25rem 0.5rem;
}

.post-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--chat-text-secondary);
    cursor: pointer;
    transition: background 0.2s;
}

.post-action-btn:hover {
    background: var(--chat-bg-secondary);
}

.action-icon {
    font-size: 1.125rem;
}

/* ========================================
   STORIES
======================================== */

.stories-container {
    padding: 1.5rem 1rem;
}

.stories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.story-item {
    cursor: pointer;
    text-align: center;
}

.story-ring {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 0.5rem;
    padding: 0.25rem;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-item.viewed .story-ring {
    background: var(--chat-border);
}

.story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--chat-bg);
    background: var(--chat-secondary) center/cover no-repeat;
}

.story-author {
    font-size: 0.8125rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   AMIS
======================================== */

.friends-container {
    padding: 1.5rem 1rem;
}

.friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.friends-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.625rem 1.25rem;
    border: none;
    background: var(--chat-bg);
    border-radius: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background: var(--chat-bg-secondary);
}

.tab-btn.active {
    background: var(--chat-primary);
    color: white;
}

.badge {
    padding: 0.125rem 0.5rem;
    background: var(--chat-bg-secondary);
    border-radius: 0.625rem;
    font-size: 0.75rem;
}

.badge-green {
    background: var(--chat-success);
    color: white;
}

.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.friend-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    background: var(--chat-bg);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px var(--chat-shadow);
}

.friend-card-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--chat-secondary) center/cover no-repeat;
    position: relative;
    flex-shrink: 0;
}

.online-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0.875rem;
    height: 0.875rem;
    background: var(--chat-success);
    color: var(--chat-success);
    border: 2px solid var(--chat-bg);
    border-radius: 50%;
}

.friend-card-info {
    flex: 1;
}

.friend-card-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9375rem;
}

.friend-card-info p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--chat-text-secondary);
}

.friend-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* ========================================
   PROFIL
======================================== */

.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    background: var(--chat-bg);
    border-radius: 0.75rem;
    overflow: hidden;
    margin: 1.5rem 1rem;
    box-shadow: 0 1px 2px var(--chat-shadow);
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.profile-info-main {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 0 1.5rem 1.5rem;
    margin-top: -3rem;
}

.profile-avatar-large {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    border: 4px solid var(--chat-bg);
    background: var(--chat-secondary) center/cover no-repeat;
    position: relative;
}

.edit-avatar-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--chat-bg);
    background: var(--chat-bg-secondary);
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
}

.profile-details h2 {
    margin: 0.5rem 0 0.25rem 0;
}

.profile-username {
    color: var(--chat-text-secondary);
    margin-bottom: 1rem;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 1.5rem;
    background: var(--chat-bg);
    border-radius: 0.75rem;
    margin: 0 1rem 1.5rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--chat-text-secondary);
}

.profile-sections {
    padding: 0 1rem;
}

.profile-section {
    background: var(--chat-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-section h3 {
    margin: 0 0 1rem 0;
}

/* ========================================
   BOUTONS
======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--chat-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--chat-accent);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--chat-bg-secondary);
    color: var(--chat-text);
}

.btn-secondary:hover {
    background: var(--chat-border);
}

.btn-danger {
    background: var(--chat-danger);
    color: white;
}

.btn-danger:hover {
    background: #cc0000;
}

/* ========================================
   MODALS
======================================== */

.sasprouteau-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    background: var(--chat-bg);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--chat-border);
}

.modal-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.modal-close {
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--chat-bg-secondary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--chat-border);
}

/* ========================================
   FORMULAIRES
======================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--chat-text);
}

.form-label.required::after {
    content: ' *';
    color: var(--chat-danger);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--chat-border);
    background: var(--chat-bg);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--chat-primary);
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ========================================
   SÉLECTION AMIS/PARTICIPANTS
======================================== */

.friends-select-list,
.participants-select-list {
    max-height: 300px;
    overflow-y: auto;
}

.friend-select-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.friend-select-item:hover {
    background: var(--chat-bg-secondary);
}

.friend-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--chat-secondary) center/cover no-repeat;
}

.friend-name {
    flex: 1;
    font-weight: 500;
}

.online-badge {
    position: absolute;
    top: 0.875rem;
    left: 2.25rem;
    width: 0.75rem;
    height: 0.75rem;
    background: var(--chat-success);
    border: 2px solid var(--chat-bg);
    border-radius: 50%;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.participant-item:hover {
    background: var(--chat-bg-secondary);
}

.participant-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.participant-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--chat-secondary) center/cover no-repeat;
}

.participant-name {
    flex: 1;
}

/* ========================================
   PARAMÈTRES CONVERSATION
======================================== */

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    font-weight: 600;
    font-size: 0.875rem;
}

.theme-colors {
    display: flex;
    gap: 0.75rem;
}

.theme-color {
    width: 3rem;
    height: 3rem;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-color:hover {
    transform: scale(1.1);
}

.theme-color.active {
    border-color: var(--chat-text);
}

/* ========================================
   CRÉATION POST
======================================== */

.post-media-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.post-media-preview img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.post-actions {
    display: flex;
    gap: 1rem;
}

.btn-icon-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    background: var(--chat-bg-secondary);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-icon-text:hover {
    background: var(--chat-border);
}

/* ========================================
   CRÉATION STORY
======================================== */

.story-creator {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.story-preview {
    width: 100%;
    aspect-ratio: 9/16;
    background: var(--chat-bg-secondary);
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-preview img,
.story-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-upload-zone {
    text-align: center;
    padding: 2rem;
}

.upload-icon {
    font-size: 4rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 1rem;
}

/* ========================================
   VIEWER D'IMAGES
======================================== */

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.viewer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.image-viewer img {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.viewer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 2rem;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

/* ========================================
   NOTIFICATIONS
======================================== */

.sasprouteau-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--chat-bg);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sasprouteau-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--chat-success);
}

.notification-error {
    border-left: 4px solid var(--chat-danger);
}

.notification-info {
    border-left: 4px solid var(--chat-primary);
}

.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-weight: bold;
}

.notification-success .notification-icon {
    color: var(--chat-success);
}

.notification-error .notification-icon {
    color: var(--chat-danger);
}

.notification-info .notification-icon {
    color: var(--chat-primary);
}

.notification-message {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ========================================
   ÉTATS VIDES
======================================== */

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

.empty-state-small {
    padding: 2rem 1rem;
}

.empty-icon {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--chat-text);
}

.empty-state p,
.empty-state-small p {
    margin: 0 0 1rem 0;
}

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

/* ========================================
   LOADING
======================================== */

.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   SCROLLBAR PERSONNALISÉE
======================================== */

.conversations-list::-webkit-scrollbar,
.messages-container::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.conversations-list::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.conversations-list::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: var(--chat-border);
    border-radius: 4px;
}

.conversations-list::-webkit-scrollbar-thumb:hover,
.messages-container::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--chat-text-secondary);
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 1024px) {
    .conversations-sidebar {
        width: 300px;
    }
    
    .message-content {
        max-width: 75%;
    }
}

@media (max-width: 768px) {
    .chat-layout {
        position: relative;
    }
    
    .conversations-sidebar {
        width: 100%;
        position: absolute;
        inset: 0;
        z-index: 10;
    }
    
    .conversation-main {
        width: 100%;
    }
    
    .conversation-main:not(:has(.no-conversation-selected)) {
        position: absolute;
        inset: 0;
        z-index: 20;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message-actions {
        position: static;
        flex-direction: row;
        margin-top: 0.5rem;
    }
    
    .chat-message:hover .message-actions {
        display: flex;
    }
    
    .nav-label {
        display: none;
    }
    
    .friends-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-container {
        width: 95%;
        max-height: 95vh;
    }
}

@media (max-width: 480px) {
    .chat-main-nav {
        padding: 0.5rem 0;
    }
    
    .nav-item {
        padding: 0.5rem;
    }
    
    .conversation-avatar {
        width: 3rem;
        height: 3rem;
    }
    
    .message-bubble {
        max-width: 90%;
    }
    
    .post-media {
        grid-template-columns: 1fr;
    }
    
    .stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.chat-message {
    animation: fadeIn 0.3s ease-out;
}

.own-message .message-bubble {
    animation: slideInRight 0.3s ease-out;
}

.other-message .message-bubble {
    animation: slideInLeft 0.3s ease-out;
}

/* ========================================
   MODE SOMBRE
======================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --chat-text: #e4e6eb;
        --chat-text-secondary: #b0b3b8;
        --chat-bg: #18191a;
        --chat-bg-secondary: #242526;
        --chat-border: #3a3b3c;
        --chat-shadow: rgba(0, 0, 0, 0.3);
        --chat-bubble-other: #3a3b3c;
    }
    
    .conversation-item.pinned {
        background: #2d2d2d;
    }
    
    .story-ring {
        border-color: var(--chat-bg);
    }
}

/* ========================================
   PRINT
======================================== */

@media print {
    .sasprouteau-chat {
        display: none;
    }
}

/* ========================================
   UTILITAIRES
======================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

/* ========================================
   FIN DU FICHIER CSS
======================================== */