* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
      Roboto, sans-serif;
}

body {
    background: #ffffff;
    min-height: 100vh;
    padding: 2rem;
    color: #000000;
}

h1 {
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 600;
    color: #171717;
    text-align: center;
}

/* Container principal */
.container {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 150px);
}

/* Section Chat (Gauche) */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    max-width: 600px;
}

#chatbox {
    flex: 1;
    background: #fafafa;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 1rem;
    overflow-y: auto;
    margin-bottom: 1rem;
    display: none;
}

.login-container {
    width: 100%;
    background: #fafafa;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1rem;
}

/* Section Localisation (Droite) */
.location-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 300px;
}

.map-container {
    flex: 2;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    overflow: hidden;
}

#map {
    height: 100%;
    min-height: 300px;
}

.users-list {
    flex: 1;
    background: #fafafa;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 1rem;
    overflow-y: auto;
}

.users-list h3 {
    margin-bottom: 1rem;
    color: #171717;
    font-size: 1.1rem;
}

#usersList {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-item {
    background: #ffffff;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-item .user-name {
    font-weight: 500;
}

.user-item .user-location {
    color: #666666;
    font-size: 0.9rem;
}

.timestamp {
    color: #666666;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

#chatbox::-webkit-scrollbar {
    width: 6px;
}

#chatbox::-webkit-scrollbar-track {
    background: #fafafa;
}

#chatbox::-webkit-scrollbar-thumb {
    background: #eaeaea;
    border-radius: 3px;
}

#chatbox div {
    background: #f5f5f5;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    animation: fadeIn 0.2s ease-in;
    color: #171717;
    font-size: 0.95rem;
    border: 1px solid #eaeaea;
}

.input-container {
    width: 100%;
    display: flex;
    gap: 0.75rem;
    display: none;
}

#message,
#username {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    background: #ffffff;
    color: #171717;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

#message::placeholder,
#username::placeholder {
    color: #999999;
}

#message:focus,
#username:focus {
    border-color: #000000;
}

button {
    padding: 0.75rem 1.5rem;
    border: 1px solid #000000;
    border-radius: 8px;
    background: #000000;
    color: #ffffff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

button:hover {
    background: #171717;
}

button:active {
    transform: scale(0.98);
}

.system-message {
    background: #fafafa !important;
    border: 1px solid #eaeaea !important;
    color: #666666 !important;
    font-size: 0.9rem !important;
}

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

/* Responsive */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        height: auto;
    }

    .chat-section,
    .location-section {
        max-width: 100%;
    }

    .map-container {
        height: 300px;
    }

    .users-list {
        max-height: 300px;
    }

    .input-container {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}

/* Nouveaux styles pour la section vidéo */
.video-section {
    width: 100%;
    margin-top: 2rem;
    background: #fafafa;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 1.5rem;
}

.video-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#startVideoCall {
    background: #4CAF50;
    border: 1px solid #4CAF50;
}

#stopVideoCall {
    background: #dc3545;
    border: 1px solid #dc3545;
}

.video-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    width: 100%;
}

#localVideo {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    background: #000;
    transform: scaleX(-1);
}

#remoteVideos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

#remoteVideos video {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    background: #000;
}

@media (max-width: 900px) {
    .video-controls {
        flex-direction: column;
    }

    .video-container {
        grid-template-columns: 1fr;
    }
}