/**
 * Styles frontend - Fabriquez votre livre
 */

:root {
    --fyv-primary: #2c3e50;
    --fyv-secondary: #7f8c8d;
    --fyv-accent: #a00d32;
    --fyv-success: #27ae60;
    --fyv-light: #f8f9fa;
    --fyv-border: #e0e0e0;
    --fyv-text: #333;
    --fyv-radius: 6px;
    --fyv-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Reset */
.fyv-workspace * { box-sizing: border-box; }

/* Container principal */
.fyv-workspace {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--fyv-text);
    line-height: 1.5;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.fyv-workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--fyv-border);
    margin-bottom: 20px;
}

.fyv-workspace-title h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--fyv-primary);
}

.fyv-workspace-user {
    font-size: 14px;
    color: var(--fyv-secondary);
}

.fyv-project-type-badge {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 10px;
    font-weight: 500;
}

.fyv-type-livre {
    background: #e8f4fd;
    color: #1976d2;
}

.fyv-type-coaching {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Layout principal */
.fyv-workspace-layout {
    display: flex;
    gap: 20px;
}

.fyv-workspace-main {
    flex: 1;
    display: flex;
    gap: 20px;
    min-width: 0;
}

/* Sidebar gauche : Menu + Progression */
.fyv-sidebar-left {
    width: 200px;
    flex-shrink: 0;
}

/* Navigation */
.fyv-workspace-nav {
    background: var(--fyv-light);
    border-radius: var(--fyv-radius);
    padding: 15px;
    margin-bottom: 20px;
}

.fyv-workspace-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fyv-workspace-nav li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: var(--fyv-radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.fyv-workspace-nav li:hover {
    background: #fff;
}

.fyv-workspace-nav li.active {
    background: #fff;
    color: var(--fyv-accent);
    font-weight: 500;
    box-shadow: var(--fyv-shadow);
}

.fyv-nav-icon {
    font-size: 18px;
}

/* Sélecteur de projet dans la sidebar */
.fyv-project-selector {
    margin-bottom: 20px;
}

.fyv-project-selector select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--fyv-accent);
    border-radius: var(--fyv-radius);
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: var(--fyv-text);
    cursor: pointer;
}

.fyv-project-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Progression verticale */
.fyv-progress-vertical {
    background: var(--fyv-light);
    border-radius: var(--fyv-radius);
    padding: 15px;
}

.fyv-progress-vertical h4 {
    margin: 0 0 15px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--fyv-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fyv-steps-vertical {
    position: relative;
    padding-left: 20px;
}

/* Ligne verticale de connexion */
.fyv-steps-vertical::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--fyv-border);
}

.fyv-step-v {
    position: relative;
    padding: 6px 0;
    display: flex;
    align-items: center;
}

.fyv-step-dot-v {
    position: absolute;
    left: -20px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--fyv-border);
    z-index: 1;
}

.fyv-step-label-v {
    font-size: 12px;
    color: var(--fyv-secondary);
    line-height: 1.3;
}

/* États des étapes */
.fyv-step-v.completed .fyv-step-dot-v {
    background: var(--fyv-success);
    border-color: var(--fyv-success);
}

.fyv-step-v.completed .fyv-step-label-v {
    color: var(--fyv-success);
}

.fyv-step-v.current .fyv-step-dot-v {
    background: var(--fyv-accent);
    border-color: var(--fyv-accent);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}

.fyv-step-v.current .fyv-step-label-v {
    color: var(--fyv-accent);
    font-weight: 600;
}

/* Contenu des sections */
.fyv-workspace-content {
    flex: 1;
    min-width: 0;
}

.fyv-section {
    display: none;
}

.fyv-section.active {
    display: block;
}

/* Panneau fichiers */
.fyv-files-manager {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.fyv-files-panel {
    background: #fff;
    border: 1px solid var(--fyv-border);
    border-radius: var(--fyv-radius);
    padding: 20px;
}

.fyv-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.fyv-files-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* Liste fichiers texte */
.fyv-files-list {
    min-height: 50px;
}

.fyv-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--fyv-light);
    border-radius: var(--fyv-radius);
    margin-bottom: 8px;
    transition: all 0.2s;
    position: relative;
}

.fyv-file-item:hover {
    background: #eef2f5;
}

.fyv-file-item:last-child {
    margin-bottom: 0;
}

.fyv-file-icon {
    font-size: 24px;
}

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

.fyv-file-name {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fyv-file-meta {
    display: block;
    font-size: 12px;
    color: var(--fyv-secondary);
}

.fyv-file-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.fyv-file-item:hover .fyv-file-actions {
    opacity: 1;
}

.fyv-file-actions button,
.fyv-file-actions a {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    text-decoration: none;
    position: relative;
}

.fyv-file-actions button:hover,
.fyv-file-actions a:hover {
    background: rgba(0,0,0,0.1);
}

/* Tooltips personnalisées pour les boutons d'action */
[data-tip] {
    position: relative;
}

[data-tip]::before,
[data-tip]::after {
    position: absolute;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

[data-tip]::before {
    content: attr(data-tip);
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: #333;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    font-weight: normal;
}

[data-tip]::after {
    content: '';
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

[data-tip]:hover::before,
[data-tip]:hover::after {
    visibility: visible;
    opacity: 1;
}

/* Tooltips pour les images (boutons circulaires) */
.fyv-image-overlay [data-tip]::before {
    bottom: calc(100% + 10px);
}

.fyv-image-overlay [data-tip]::after {
    bottom: calc(100% + 4px);
}

/* Grille images 300x300 */
.fyv-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.fyv-image-card {
    position: relative;
}

.fyv-image-thumb {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    border-radius: var(--fyv-radius);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.fyv-image-thumb:hover {
    transform: scale(1.02);
}

.fyv-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    border-radius: var(--fyv-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.fyv-image-thumb:hover .fyv-image-overlay {
    opacity: 1;
}

.fyv-image-overlay button,
.fyv-image-overlay a {
    background: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    transition: transform 0.2s;
}

.fyv-image-overlay button:hover,
.fyv-image-overlay a:hover {
    transform: scale(1.1);
}

.fyv-image-name {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--fyv-secondary);
}

/* Tooltip personnalisé */
.fyv-tooltip {
    position: fixed;
    background: var(--fyv-primary);
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--fyv-radius);
    font-size: 12px;
    line-height: 1.5;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    max-width: 280px;
}

.fyv-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: var(--fyv-primary);
    transform: rotate(45deg);
}

.fyv-tooltip-line {
    display: block;
    margin-bottom: 2px;
}

.fyv-tooltip-line:first-child {
    font-weight: 600;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

/* Sidebar Chat */
.fyv-chat-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--fyv-border);
    border-radius: var(--fyv-radius);
    display: flex;
    flex-direction: column;
    max-height: 700px;
}

.fyv-chat-header {
    padding: 15px;
    border-bottom: 1px solid var(--fyv-border);
    background: var(--fyv-light);
    border-radius: var(--fyv-radius) var(--fyv-radius) 0 0;
}

.fyv-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.fyv-chat-sidebar .fyv-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #fafafa;
}

.fyv-chat-sidebar .fyv-chat-form {
    padding: 15px;
    border-top: 1px solid var(--fyv-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fyv-chat-sidebar .fyv-chat-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--fyv-border);
    border-radius: var(--fyv-radius);
    font-family: inherit;
    font-size: 14px;
    resize: none;
}

.fyv-chat-sidebar .fyv-chat-form textarea:focus {
    outline: none;
    border-color: var(--fyv-accent);
}

.fyv-chat-sidebar .fyv-chat-form button {
    align-self: flex-end;
}

/* Messages Chat */
.fyv-chat-empty {
    color: var(--fyv-secondary);
    text-align: center;
    padding: 30px 10px;
    font-size: 14px;
}

.fyv-chat-message {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: var(--fyv-radius);
    max-width: 90%;
    font-size: 14px;
}

.fyv-chat-message.is-admin {
    background: var(--fyv-accent);
    color: #fff;
    margin-right: auto;
    border-bottom-left-radius: 2px;
}

.fyv-chat-message.is-user {
    background: #fff;
    border: 1px solid var(--fyv-border);
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

.fyv-chat-text {
    line-height: 1.4;
    word-wrap: break-word;
}

.fyv-chat-meta {
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.7;
}

/* Boutons */
.fyv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border: none !important;
    border-radius: var(--fyv-radius) !important;
    cursor: pointer;
    transition: all 0.2s;
    background: #f0f0f0 !important;
    color: var(--fyv-accent) !important;
    text-decoration: none !important;
}

.fyv-btn:hover {
    background: #e0e0e0 !important;
    color: var(--fyv-primary) !important;
}

.fyv-btn-primary {
    background: var(--fyv-accent) !important;
    color: #fff !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.fyv-btn-primary:hover {
    background: #a00d32 !important;
    color: #fff !important;
}

/* Formulaires */
.fyv-form {
    max-width: 500px;
}

.fyv-form-group {
    margin-bottom: 20px;
}

.fyv-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.fyv-form-group input,
.fyv-form-group select,
.fyv-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--fyv-border);
    border-radius: var(--fyv-radius);
    font-size: 14px;
}

.fyv-form-group input:focus,
.fyv-form-group select:focus,
.fyv-form-group textarea:focus {
    outline: none;
    border-color: var(--fyv-accent);
}

.fyv-form-row {
    display: flex;
    gap: 20px;
}

.fyv-form-row .fyv-form-group {
    flex: 1;
}

/* Modal */
.fyv-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.fyv-modal-content {
    background: #fff;
    border-radius: var(--fyv-radius);
    padding: 25px;
    min-width: 350px;
    max-width: 500px;
    position: relative;
}

.fyv-modal-content.fyv-modal-preview {
    min-width: auto;
    max-width: 90vw;
    max-height: 90vh;
    padding: 15px;
    overflow: auto;
}

.fyv-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--fyv-secondary);
    line-height: 1;
}

.fyv-modal-close:hover {
    color: var(--fyv-text);
}

.fyv-modal h3 {
    margin: 0 0 20px 0;
}

.fyv-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Prévisualisation */
#fyv-preview-content {
    text-align: center;
}

#fyv-preview-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--fyv-radius);
}

#fyv-preview-content .fyv-preview-doc {
    text-align: left;
    padding: 30px;
    background: #fff;
    border: 1px solid var(--fyv-border);
    border-radius: var(--fyv-radius);
    max-height: 60vh;
    overflow: auto;
    font-size: 14px;
    line-height: 1.7;
}

#fyv-preview-content .fyv-preview-doc h1,
#fyv-preview-content .fyv-preview-doc h2,
#fyv-preview-content .fyv-preview-doc h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--fyv-primary);
}

#fyv-preview-content .fyv-preview-doc h1 { font-size: 1.8em; }
#fyv-preview-content .fyv-preview-doc h2 { font-size: 1.5em; }
#fyv-preview-content .fyv-preview-doc h3 { font-size: 1.2em; }

#fyv-preview-content .fyv-preview-doc p {
    margin-bottom: 1em;
}

#fyv-preview-content .fyv-preview-doc ul,
#fyv-preview-content .fyv-preview-doc ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

#fyv-preview-content .fyv-preview-doc table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

#fyv-preview-content .fyv-preview-doc table td,
#fyv-preview-content .fyv-preview-doc table th {
    border: 1px solid var(--fyv-border);
    padding: 8px 12px;
}

#fyv-preview-content .fyv-preview-doc table th {
    background: var(--fyv-light);
    font-weight: 600;
}

#fyv-preview-content .fyv-preview-error {
    text-align: center;
    color: var(--fyv-secondary);
}

#fyv-preview-content .fyv-preview-warnings {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff3cd;
    border-radius: var(--fyv-radius);
    color: #856404;
}

#fyv-preview-content .fyv-preview-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--fyv-border);
    font-size: 13px;
    color: var(--fyv-secondary);
    text-align: left;
}

/* Loader */
.fyv-preview-loading {
    padding: 60px 20px;
    text-align: center;
    color: var(--fyv-secondary);
}

.fyv-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--fyv-light);
    border-top-color: var(--fyv-accent);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: fyv-spin 0.8s linear infinite;
}

@keyframes fyv-spin {
    to { transform: rotate(360deg); }
}

/* Vide */
.fyv-empty {
    color: var(--fyv-secondary);
    text-align: center;
    padding: 30px;
}

/* Documentation */
.fyv-docs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fyv-doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--fyv-border);
    border-radius: var(--fyv-radius);
    transition: border-color 0.2s;
}

.fyv-doc-item:hover {
    border-color: var(--fyv-accent);
}

.fyv-doc-icon {
    font-size: 28px;
}

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

.fyv-doc-name {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fyv-doc-meta {
    font-size: 12px;
    color: var(--fyv-secondary);
}

.fyv-doc-actions {
    display: flex;
    gap: 8px;
}

.fyv-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1200px) {
    .fyv-chat-sidebar {
        width: 280px;
    }
    
    .fyv-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 992px) {
    .fyv-workspace-layout {
        flex-direction: column;
    }
    
    .fyv-workspace-main {
        flex-direction: column;
    }
    
    .fyv-sidebar-left {
        width: 100%;
        display: flex;
        gap: 20px;
    }
    
    .fyv-workspace-nav {
        flex: 1;
        margin-bottom: 0;
    }
    
    .fyv-progress-vertical {
        flex: 1;
    }
    
    .fyv-chat-sidebar {
        width: 100%;
        max-height: 400px;
    }
}

/* Tablettes */
@media (max-width: 768px) {
    .fyv-workspace {
        padding: 15px;
    }
    
    .fyv-workspace-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .fyv-workspace-title h1 {
        font-size: 22px;
    }
    
    .fyv-sidebar-left {
        flex-direction: column;
        gap: 15px;
    }
    
    .fyv-workspace-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .fyv-workspace-nav li {
        flex: 1;
        min-width: calc(33% - 5px);
        justify-content: center;
        padding: 10px;
        font-size: 13px;
    }
    
    .fyv-nav-icon {
        font-size: 16px;
    }
    
    .fyv-progress-vertical {
        display: none;
    }
    
    .fyv-content-area {
        padding: 15px;
    }
    
    .fyv-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .fyv-section-header h2 {
        font-size: 18px;
    }
    
    .fyv-images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .fyv-chat-sidebar {
        position: relative;
        max-height: 350px;
    }
    
    .fyv-chat-messages {
        max-height: 200px;
    }
}

/* Smartphones */
@media (max-width: 576px) {
    .fyv-workspace {
        padding: 10px;
    }
    
    .fyv-workspace-header {
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
    
    .fyv-workspace-title {
        width: 100%;
    }
    
    .fyv-workspace-title h1 {
        font-size: 18px;
        word-break: break-word;
    }
    
    .fyv-workspace-user {
        font-size: 13px;
    }
    
    .fyv-project-type-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    /* Sélecteur de projet */
    .fyv-project-selector {
        margin-bottom: 15px;
    }
    
    .fyv-project-selector select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* Navigation horizontale compacte */
    .fyv-workspace-nav {
        margin-bottom: 15px;
    }
    
    .fyv-workspace-nav ul {
        display: flex;
        gap: 5px;
    }
    
    .fyv-workspace-nav li {
        flex: 1;
        min-width: auto;
        padding: 8px 5px;
        font-size: 11px;
        flex-direction: column;
        gap: 3px;
        text-align: center;
    }
    
    .fyv-nav-icon {
        font-size: 18px;
    }
    
    /* Zone de contenu */
    .fyv-content-area {
        padding: 12px;
    }
    
    .fyv-section-header h2 {
        font-size: 16px;
    }
    
    .fyv-btn-upload {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Fichiers texte */
    .fyv-file-item {
        padding: 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .fyv-file-icon {
        font-size: 24px;
    }
    
    .fyv-file-name {
        font-size: 13px;
    }
    
    .fyv-file-size {
        font-size: 11px;
    }
    
    .fyv-file-actions {
        width: 100%;
        justify-content: flex-end;
        opacity: 1;
        gap: 5px;
    }
    
    .fyv-file-actions button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Grille d'images */
    .fyv-images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .fyv-image-card {
        border-radius: 6px;
    }
    
    .fyv-image-thumb {
        height: 100px;
    }
    
    .fyv-image-name {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .fyv-image-actions {
        opacity: 1;
        gap: 3px;
        padding: 5px;
    }
    
    .fyv-image-actions button {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* Paramètres projet */
    .fyv-project-form label {
        font-size: 13px;
    }
    
    .fyv-project-form input,
    .fyv-project-form textarea,
    .fyv-project-form select {
        padding: 10px;
        font-size: 14px;
    }
    
    .fyv-project-form textarea {
        min-height: 80px;
    }
    
    /* Documentation */
    .fyv-doc-list {
        gap: 8px;
    }
    
    .fyv-doc-item {
        padding: 10px;
        flex-wrap: wrap;
    }
    
    .fyv-doc-icon {
        font-size: 22px;
    }
    
    .fyv-doc-name {
        font-size: 13px;
    }
    
    .fyv-doc-meta {
        font-size: 11px;
    }
    
    .fyv-doc-actions {
        width: 100%;
        margin-top: 8px;
        justify-content: flex-end;
    }
    
    .fyv-doc-actions .fyv-btn-small {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    /* Chat sidebar */
    .fyv-chat-sidebar {
        border-radius: 8px;
        max-height: 300px;
    }
    
    .fyv-chat-sidebar h3 {
        font-size: 15px;
        padding: 12px;
    }
    
    .fyv-chat-messages {
        max-height: 150px;
        padding: 10px;
    }
    
    .fyv-chat-message {
        max-width: 90%;
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .fyv-message-meta {
        font-size: 10px;
    }
    
    .fyv-chat-form {
        padding: 10px;
    }
    
    .fyv-chat-form textarea {
        font-size: 14px;
        padding: 8px 10px;
        min-height: 40px;
    }
    
    .fyv-chat-form button {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    /* Modales */
    .fyv-modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
        padding: 15px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .fyv-modal-content h2 {
        font-size: 18px;
    }
    
    /* Page de connexion */
    .fyv-login-box {
        padding: 20px;
        margin: 10px;
    }
    
    .fyv-login-box h2 {
        font-size: 20px;
    }
    
    /* Preview modal */
    .fyv-preview-modal img {
        max-height: 60vh;
    }
}

/* Très petits écrans */
@media (max-width: 380px) {
    .fyv-workspace-nav li {
        padding: 6px 3px;
        font-size: 10px;
    }
    
    .fyv-nav-icon {
        font-size: 16px;
    }
    
    .fyv-images-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .fyv-image-thumb {
        height: 80px;
    }
    
    .fyv-file-actions button,
    .fyv-image-actions button {
        padding: 4px 6px;
        font-size: 10px;
    }
}
