/* Styles généraux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Contenu principal */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Carte */
.map-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

#map {
    height: 600px;
    width: 100%;
}

/* Panneau de messages */
.message-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.message-panel h2 {
    margin-bottom: 20px;
    color: #4a5568;
    font-size: 1.5em;
}

.message-panel h3 {
    margin-bottom: 15px;
    color: #4a5568;
    font-size: 1.2em;
}

/* Formulaire */
#messageForm {
    margin-bottom: 30px;
}

#userMessage {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1em;
    resize: vertical;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

#userMessage:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.char-count {
    text-align: right;
    margin-top: 5px;
    font-size: 0.9em;
    color: #718096;
}

#submitBtn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 15px;
}

#submitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

#submitBtn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Liste des messages */
#messagesContainer {
    max-height: 300px;
    overflow-y: auto;
}

.message-item {
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    animation: fadeIn 0.5s ease-in;
}

.message-item .timestamp {
    font-size: 0.8em;
    color: #a0aec0;
    margin-bottom: 5px;
}

.message-item .message-text {
    color: #2d3748;
    line-height: 1.5;
}

.message-item .ip-info {
    font-size: 0.8em;
    color: #e53e3e;
    margin-top: 5px;
}

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

/* Popups personnalisés */
.custom-popup {
    font-family: inherit;
    max-width: 250px;
}

.custom-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.custom-popup .leaflet-popup-content {
    margin: 15px;
    line-height: 1.5;
}

.custom-popup .leaflet-popup-tip {
    background: white;
}

/* Indicateurs de chargement */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    header h1 {
        font-size: 2em;
    }

    #map {
        height: 400px;
    }

    .message-panel {
        padding: 20px;
    }
}
