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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e4e8;
}

h1 {
    color: #2563eb;
    margin-bottom: 10px;
}

h2 {
    color: #374151;
    margin-bottom: 15px;
}

.hidden {
    display: none;
}

/* Boutons */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, transform 0.1s;
}

.btn:hover {
    transform: translateY(-2px);
}

.primary-btn {
    background-color: #2563eb;
    color: white;
}

.primary-btn:hover {
    background-color: #1d4ed8;
}

.secondary-btn {
    background-color: #e5e7eb;
    color: #374151;
}

.secondary-btn:hover {
    background-color: #d1d5db;
}

/* Page d'accueil */
.actions {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.qr-container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 30px;
}

#qrcode {
    margin: 20px auto;
    width: 200px;
    height: 200px;
}

.channels-list {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

.channel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e1e4e8;
}

.channel-item:last-child {
    border-bottom: none;
}

.channel-info {
    flex-grow: 1;
}

.channel-title {
    font-weight: bold;
    color: #1f2937;
}

.channel-date {
    font-size: 14px;
    color: #6b7280;
}

.channel-actions button {
    margin-left: 10px;
}

#noChannels {
    text-align: center;
    color: #6b7280;
    padding: 20px;
}

/* Page de canal */
.back-link {
    display: inline-block;
    margin-top: 10px;
    color: #2563eb;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.channel-main {
    display: flex;
    flex-direction: column;
    min-height: 20vh;
}

.message-container {
    flex-grow: 1;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    overflow-y: auto;
    height: 400px; /* Fixed height to enable scrolling */
    max-height: 60vh; /* Use viewport height for responsiveness */
    scroll-behavior: smooth; /* Add smooth scrolling */
}

.no-message {
    display: flex;
    flex-direction: column;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.no-message p {
    text-align: center;
 }

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.no-message p:nth-child(2) {
    margin-top: 20px;
    font-size: 12px;
}


.message {
    padding: 15px;
    border-radius: 8px;
    max-width: 80%;
    position: relative;
    word-break: break-word;
}

.message.my-message {
    background-color: #e3f2fd;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.message.other-message {
    background-color: #f3f4f6;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.message-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.message-time {
    font-size: 12px;
    color: #6b7280;
}

.message-body {
    word-break: break-word;
}

.message-form {
    display: flex;
    gap: 10px;
    position: sticky;
    bottom: 0;
    background-color: #f5f7fa;
    padding: 10px 0;
    z-index: 10;
}

#newMessage {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    resize: none;
    height: 80px;
    max-height: 120px;
    font-family: inherit;
    font-size: 16px; /* Prevent iOS zoom on focus */
}

/* Ensure the send button is always visible */
#sendMessageBtn {
    align-self: flex-end;
    height: 44px;
    min-width: 80px;
}

/* Responsive adjustments for small screens */
@media (max-width: 480px) {
    .message-form {
        flex-direction: column;
    }
    
    #newMessage {
        width: 100%;
        height: 60px;
    }
    
    #sendMessageBtn {
        align-self: flex-end;
        margin-top: 5px;
    }
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e1e4e8;
    color: #6b7280;
    font-size: 14px;
}

footer a {
    color: #2563eb;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Styles pour la page Conditions Générales */
.content-section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.content-section h2 {
    color: #2563eb;
    margin-bottom: 15px;
    border-bottom: 1px solid #e1e4e8;
    padding-bottom: 10px;
}

.content-section p {
    margin-bottom: 15px;
}

.content-section ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.content-section li {
    margin-bottom: 8px;
}
