/* 
 * responsive.css - Styles responsifs additionnels pour l'application de chat
 */

/* Tablettes */
@media (max-width: 992px) {
    .sidebar {
        width: 280px;
    }
    
    .message {
        max-width: 75%;
    }
}

/* Mobiles */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 100vh;
        position: fixed;
        z-index: 10;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-chat {
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: block !important;
    }
    
    .chat-header .back-btn {
        display: block !important;
    }
    
    .message {
        max-width: 85%;
    }
    
    .auth-container {
        margin: 40px auto;
        padding: 20px;
    }
}

/* Petits mobiles */
@media (max-width: 480px) {
    .chat-header .user-status {
        display: none;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-input {
        padding: 10px;
    }
    
    .auth-container {
        margin: 20px auto;
        padding: 15px;
    }
    
    .auth-header h1 {
        font-size: 20px;
    }
}

/* Orientation paysage sur mobile */
@media (max-height: 480px) and (orientation: landscape) {
    .auth-container {
        margin: 20px auto;
    }
    
    .chat-messages {
        padding: 10px;
    }
    
    .message {
        padding: 8px 12px;
        margin-bottom: 8px;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    body.auto-theme {
        --color-bg-light: #121212;
        --color-bg-main: #1e1e1e;
        --color-bg-dark: #2d2d2d;
        --color-text-primary: #e0e0e0;
        --color-text-secondary: #a0a0a0;
        --color-text-muted: #707070;
        --color-border: #3d3d3d;
        --color-message-sent: #2a2a2a;
        --color-message-received: #323232;
    }
}

/* Classes pour le mode sombre manuel */
body.dark-theme {
    --color-bg-light: #121212;
    --color-bg-main: #1e1e1e;
    --color-bg-dark: #2d2d2d;
    --color-text-primary: #e0e0e0;
    --color-text-secondary: #a0a0a0;
    --color-text-muted: #707070;
    --color-border: #3d3d3d;
    --color-message-sent: #2a2a2a;
    --color-message-received: #323232;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

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

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* Styles pour les éléments de focus pour l'accessibilité */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Styles pour l'impression */
@media print {
    .sidebar, .chat-input, .chat-header {
        display: none !important;
    }
    
    .main-chat {
        width: 100% !important;
    }
    
    .chat-messages {
        overflow: visible !important;
    }
    
    .message {
        break-inside: avoid;
    }
}
