* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #25D366;
    --primary-dark: #075E54;
    --primary-light: #128C7E;
    --secondary-color: #22BF5A;
    --background-color: #ECE5DD;
    --surface-color: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #667781;
    --border-color: #E9EDEF;
    --error-color: #e74c3c;
    --success-color: #25D366;
    --warning-color: #f39c12;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-small: 8px;
    --border-radius-medium: 12px;
    --border-radius-large: 20px;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ÉCRAN DE CONNEXION */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 50%, var(--primary-color) 100%);
    padding: 20px;
}

.login-container {
    background: var(--surface-color);
    border-radius: var(--border-radius-large);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.6s ease-out;
}

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

.login-header i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: block;
}

.login-header h1 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.login-header p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.login-form {
    margin-bottom: 30px;
}

.login-form input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    margin-bottom: 20px;
    transition: var(--transition-smooth);
    outline: none;
}

.login-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.login-form button {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-form button:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

.login-form button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.login-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.feature i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.error-message {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 10px;
    padding: 10px;
    background: #fdf0f0;
    border-radius: var(--border-radius-small);
    display: none;
}

.switch-form {
    margin-top: 10px;
    text-align: center;
}

.switch-form a {
    color: var(--primary-color);
    text-decoration: none;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* APPLICATION PRINCIPALE */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--background-color);
}

/* Header */
.app-header {
    background: var(--primary-dark);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 600;
    font-size: 1.1rem;
}

.status {
    font-size: 0.85rem;
    opacity: 0.8;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-btn {
    background: none;
    border: none;
    color: white;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-btn.disconnect:hover {
    background: rgba(231, 76, 60, 0.2);
    color: var(--error-color);
}

/* Contenu principal */
.app-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-dark);
    color: white;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-count {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.users-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border-bottom: 1px solid var(--border-color);
}

.user-item:hover {
    background: #f8f9fa;
}

.user-item-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    margin-right: 15px;
}

.user-item-info {
    flex: 1;
}

.user-item-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.user-item-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.user-item-actions {
    display: flex;
    gap: 5px;
}

.action-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-secondary);
    font-size: 1rem;
}

.action-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.action-btn.audio:hover {
    color: var(--primary-color);
}

.action-btn.video:hover {
    color: #3498db;
}

.no-users {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.no-users i {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.create-room-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.create-room-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

/* Zone de chat */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    height: 100vh;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header h2 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.chat-action-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-secondary);
    font-size: 1rem;
}

.chat-action-btn:hover {
    background: var(--border-color);
    color: var(--error-color);
}

.messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #f8f9fa, var(--surface-color));
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.welcome-message {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.welcome-message i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.welcome-message h3 {
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.message {
    margin-bottom: 15px;
    animation: messageSlide 0.3s ease-out;
    width: 100%;
}

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

.message.own {
    display: flex;
    justify-content: flex-end;
}

.message.other {
    display: flex;
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.message.own .message-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.other .message-bubble {
    background: var(--surface-color);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.85rem;
    opacity: 0.8;
}

.message-username {
    font-weight: 600;
    margin-right: 8px;
}

.message-time {
    font-size: 0.75rem;
}

.message-content {
    line-height: 1.4;
    word-wrap: break-word;
}

.typing-indicator {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-style: italic;
    color: var(--text-secondary);
    animation: fadeIn 0.3s ease-in;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingAnimation 1.5s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.message-input-container {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--surface-color);
    flex-shrink: 0;
}

.message-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    transition: var(--transition-smooth);
}

.message-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.input-action-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.input-action-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 0;
    font-size: 1rem;
    background: transparent;
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

#recordVoiceButton {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

#recordVoiceButton.recording {
    background-color: var(--error-color);
    animation: pulse 1s infinite;
}

#recordVoiceButton:hover {
    opacity: 0.8;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* MODALS */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--border-radius-small);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.modal-header h3 {
    margin: 0;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    transition: var(--transition-smooth);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.form-group select[multiple] {
    height: 150px;
    padding: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.form-group select[multiple] option {
    padding: 8px;
}

.form-group select[multiple] option:checked {
    background: var(--primary-color);
    color: white;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-small);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.btn-secondary {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #ddd;
}

/* Modals d'appels */
.call-modal .modal-content {
    max-width: 400px;
    text-align: center;
}

.caller-info,
.call-info {
    padding: 30px 20px;
}

.caller-avatar,
.peer-avatar {
    width: 100px;
    height: 100px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    margin: 0 auto 20px;
    animation: pulse 2s infinite;
}

.caller-info h3,
.call-info h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.caller-info p,
.call-info p {
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.call-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 20px;
}

.call-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.call-btn.accept:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.call-btn.reject {
    background: var(--error-color);
    color: white;
}

.call-btn.reject:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.call-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 1.2rem;
    background: var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    transform: scale(1.1);
}

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

.control-btn.end-call {
    background: var(--error-color);
    color: white;
}

.control-btn.end-call:hover {
    background: #c0392b;
}

.video-container {
    position: relative;
    background: #000;
    border-radius: var(--border-radius-small);
    overflow: hidden;
    margin: 20px;
}

.remote-video {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.local-video {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--border-radius-small);
    border: 2px solid white;
}

.share-info {
    margin-bottom: 30px;
}

.url-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.url-container input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
    background: #f8f9fa;
}

.btn-copy {
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-copy:hover {
    background: var(--secondary-color);
}

.qr-code {
    text-align: center;
    padding: 20px 0;
}

#qrCode {
    margin-top: 15px;
    display: inline-block;
}

.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.notification {
    background: var(--surface-color);
    border-radius: var(--border-radius-small);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    margin-bottom: 10px;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid var(--primary-color);
}

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

.notification.error {
    border-left-color: var(--error-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    font-weight: 600;
}

.notification-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.loading-spinner p {
    font-size: 1.2rem;
}

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

.users-list::-webkit-scrollbar,
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.users-list::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.users-list::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.3);
    border-radius: 3px;
}

.users-list::-webkit-scrollbar-thumb:hover,
.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.5);
}

.user-item.calling {
    background: rgba(37, 211, 102, 0.1);
    border-left: 4px solid var(--primary-color);
}

.message.system {
    text-align: center;
    margin: 20px 0;
}

.message.system .message-bubble {
    background: rgba(128, 128, 128, 0.1);
    color: var(--text-secondary);
    border-radius: var(--border-radius-large);
    font-size: 0.9rem;
    font-style: italic;
}

.message-content.voice-message {
    display: flex;
    align-items: center;
}

.message-content audio {
    max-width: 200px;
}

/* Styles pour les statuts */
#statusSection {
    padding: 10px;
}

.status-item {
    border: 1px solid #ccc;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
}

.status-item img,
.status-item video {
    max-width: 200px;
    border-radius: 5px;
}

#statusType,
#statusText,
#statusFile {
    margin: 5px 0;
    padding: 8px;
    width: 100%;
    max-width: 300px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#statusSection button {
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#statusSection button:hover {
    background: var(--secondary-color);
}

/* RESPONSIVE DESIGN */

/* Tablettes et petits écrans */
@media (max-width: 768px) {
    .app-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 200px;
        order: 2;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }
    
    .chat-area {
        order: 1;
        flex: 1;
    }
    
    .users-list {
        max-height: 150px;
    }
    
    .header-content {
        padding: 0 10px;
    }
    
    .user-info {
        gap: 10px;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .username {
        font-size: 1rem;
    }
    
    .status {
        font-size: 0.8rem;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .login-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .call-actions {
        gap: 15px;
    }
    
    .call-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .local-video {
        width: 100px;
        height: 75px;
        top: 15px;
        right: 15px;
    }
}

/* Smartphones */
@media (max-width: 480px) {
    .app-header {
        padding: 10px 15px;
    }
    
    .sidebar {
        height: 150px;
    }
    
    .sidebar-header {
        padding: 15px;
    }
    
    .sidebar-header h3 {
        font-size: 1rem;
    }
    
    .user-item {
        padding: 12px 15px;
    }
    
    .user-item-avatar {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .chat-header h2 {
        font-size: 1.1rem;
    }
    
    .messages-container {
        padding: 15px;
    }
    
    .message-input-container {
        padding: 15px;
    }
    
    .welcome-message {
        padding: 20px;
    }
    
    .welcome-message i {
        font-size: 2rem;
    }
    
    .login-features {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .notifications-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        min-width: auto;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .url-container {
        flex-direction: column;
    }
    
    .url-container input {
        margin-bottom: 10px;
    }
    
    #recordVoiceButton,
    .send-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .input-action-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .message-input-wrapper {
        padding: 6px;
        gap: 8px;
    }
    
    #messageInput {
        font-size: 0.9rem;
    }
}

/* Très petits écrans */
@media (max-width: 320px) {
    .login-container {
        padding: 20px 15px;
    }
    
    .login-header i {
        font-size: 2.5rem;
    }
    
    .login-header h1 {
        font-size: 1.3rem;
    }
    
    .sidebar {
        height: 120px;
    }
    
    .user-item {
        padding: 10px 12px;
    }
    
    .user-item-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
        margin-right: 10px;
    }
    
    .user-item-name {
        font-size: 0.9rem;
    }
    
    .user-item-status {
        font-size: 0.75rem;
    }
    
    .message-bubble {
        max-width: 90%;
        padding: 10px 14px;
    }
    
    .chat-header h2 {
        font-size: 1rem;
    }
    
    .welcome-message i {
        font-size: 1.8rem;
    }
    
    .caller-avatar,
    .peer-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .call-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}

/* Mode paysage pour petits écrans */
@media (max-height: 500px) and (orientation: landscape) {
    .login-container {
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px;
    }
    
    .login-header i {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .login-features {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .sidebar {
        height: 40vh;
    }
    
    .caller-avatar,
    .peer-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #0B141A;
        --surface-color: #1f2937;
        --text-primary: #f3f4f6;
        --text-secondary: #9ca3af;
        --border-color: #374151;
    }
    
    body {
        background: #0B141A;
        color: var(--text-primary);
    }
    
    .login-container {
        background: var(--surface-color);
        color: var(--text-primary);
    }
    
    .login-header h1 {
        color: var(--text-primary);
    }
    
    .app-container {
        background: #0B141A;
    }
    
    .sidebar,
    .chat-area,
    .modal-content {
        background: var(--surface-color);
        color: var(--text-primary);
    }
    
    .message.other .message-bubble {
        background: #374151;
        border-color: #4b5563;
        color: var(--text-primary);
    }
    
    .user-item:hover {
        background: #374151;
    }
    
    .message-input-wrapper {
        background: var(--surface-color);
        border-color: var(--border-color);
    }
    
    .form-group input,
    .form-group select {
        background: var(--surface-color);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .notification {
        background: var(--surface-color);
        color: var(--text-primary);
    }
}

/* Animations et transitions fluides */
@keyframes smoothSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-item,
.message,
.notification {
    animation: smoothSlide 0.2s ease-out;
}

/* Optimisations pour les performances */
.messages-container,
.users-list {
    will-change: scroll-position;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.message-bubble,
.user-item-avatar,
.user-avatar {
    will-change: transform;
}

/* Support pour les préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Support pour les écrans haute densité */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .user-avatar,
    .user-item-avatar,
    .caller-avatar,
    .peer-avatar {
        border: 0.5px solid rgba(255, 255, 255, 0.1);
    }
}