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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.header h1 {
    color: #1e5a7d;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.intro {
    font-size: 1.1rem;
    color: #555;
    max-width: 900px;
    margin: 0 auto 30px;
    line-height: 1.8;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #124E78 0%, #0d3a5a 100%);
    color: white;
    padding: 15px 40px;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 50px;
    margin: 20px 0;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(18, 78, 120, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(18, 78, 120, 0.4);
}

.subtitle {
    font-size: 1rem;
    color: #666;
    margin: 20px 0;
}

.social-share {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.social-icon {
    font-size: 1.8rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.social-icon:hover {
    transform: scale(1.2);
}

/* Messages Grid - AVEC CSS GRID AU LIEU DE COLUMNS */
/* Messages Grid - Masonry avec columns */
.messages-grid {
    column-count: 3;
    column-gap: 20px;
    margin-top: 40px;
    padding: 0 20px;
}

@media (max-width: 1024px) {
    .messages-grid {
        column-count: 2;
    }
}

@media (max-width: 640px) {
    .messages-grid {
        column-count: 1;
    }
}

/* Formulaire de soumission */
.submission-form {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid #124E78;
    break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}

.form-content textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.form-content textarea:focus {
    outline: none;
    border-color: #124E78;
}

.form-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

/* Avatar */
.avatar-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-display {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f7fafc;
    border: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.avatar-display:hover {
    border-color: #124E78;
    transform: scale(1.05);
}

.avatar-emoji {
    font-size: 2.5rem;
}

.camera-icon {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
}

.avatar-instruction {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.avatar-picker {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    margin-top: 10px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    max-width: 300px;
}

.avatar-option {
    font-size: 2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
}

.avatar-option:hover {
    background: #f7fafc;
    transform: scale(1.2);
}

/* Inputs */
.form-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.form-inputs input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    width: 100%;
}

.form-inputs input:focus {
    outline: none;
    border-color: #124E78;
}

.submit-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #124E78 0%, #0d3a5a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(18, 78, 120, 0.3);
    width: 100%;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(18, 78, 120, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status Message */
.status-message {
    margin-top: 15px;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.status-message.success {
    background: #c6f6d5;
    color: #22543d;
}

.status-message.error {
    background: #fed7d7;
    color: #742a2a;
}

/* Message Cards */
.message-card {
    background: white;
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
    overflow: hidden;
}

.message-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.message-content {
    margin-bottom: 0;
}

/* Cartes avec texte uniquement (sans média) */
.message-card:not(:has(.message-media)) .message-content {
    padding: 30px 25px;
    min-height: 200px;
}

.message-card:not(:has(.message-media)) .message-text-wrapper {
    padding: 0;
}

/* Texte avec limitation et bouton "Voir plus" */
.message-text-wrapper {
    position: relative;
    padding: 20px;
}

.message-text {
    color: #2d3748;
    line-height: 1.7;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-height: 20em;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
}

.message-text.expanded {
    max-height: none;
}

.message-text:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(to bottom, transparent, white);
}

.read-more-btn {
    background: none;
    border: none;
    color: #124E78;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 5px 0;
    margin-top: 8px;
    transition: color 0.2s ease;
}

.read-more-btn:hover {
    color: #0d3a5a;
    text-decoration: underline;
}

/* Médias */
.message-media {
    margin-bottom: 0;
    border-radius: 0;
    overflow: hidden;
    background: #000;
}

.message-media img,
.message-media video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    background: #000;
}

/* Auteur */
.message-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    background: white;
}

.internal-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.author-avatar {
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-info strong {
    color: #2d3748;
    font-size: 1rem;
    word-wrap: break-word;
}

.author-info span {
    color: #718096;
    font-size: 0.85rem;
    word-wrap: break-word;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .intro {
        font-size: 1rem;
    }

    .cta-button {
        font-size: 1.1rem;
        padding: 12px 30px;
    }

    .container {
        padding: 20px 0;
    }

    .messages-grid {
        padding: 0 15px;
    }
}