* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.header {
    background: #667eea;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.auth-links a {
    color: white;
    text-decoration: none;
    margin-left: 15px;
    padding: 8px 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    transition: 0.3s;
}

.auth-links a:hover {
    background: rgba(255,255,255,0.3);
}

.messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

.message {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.message-pseudo {
    font-weight: bold;
    color: #667eea;
}

.admin-badge {
    background: #ff6b6b;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
}

.guest-badge {
    background: #95a5a6;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
}

.message-time {
    font-size: 12px;
    color: #999;
    margin-left: auto;
}

.message-content {
    color: #333;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.admin-actions {
    margin-top: 10px;
    display: flex;
    gap: 5px;
}

.admin-actions a {
    font-size: 11px;
    padding: 4px 8px;
    background: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 3px;
}

.admin-actions a:hover {
    background: #c0392b;
}

.message-form {
    padding: 20px;
    background: white;
    border-top: 1px solid #ddd;
}

.form-group {
    display: flex;
    gap: 10px;
}

.form-group textarea {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    resize: vertical;
    min-height: 50px;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group button {
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.form-group button:hover {
    background: #5568d3;
}

.error {
    background: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 20px;
}

.errors {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.errors ul {
    list-style: none;
}

.errors li {
    margin-bottom: 5px;
}

.success {
    background: #2ecc71;
    color: white;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-page .container {
    padding: 40px;
    max-width: 450px;
    width: 100%;
}

.auth-page h1 {
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
}

.auth-page .form-group {
    margin-bottom: 20px;
    display: block;
}

.auth-page label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: bold;
}

.auth-page input[type="text"],
.auth-page input[type="password"],
.auth-page input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: 0.3s;
}

.auth-page input[type="text"]:focus,
.auth-page input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.auth-page button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.auth-page button:hover {
    background: #5568d3;
}

.links {
    text-align: center;
    margin-top: 20px;
}

.links a {
    color: #667eea;
    text-decoration: none;
    margin: 0 10px;
}

.links a:hover {
    text-decoration: underline;
}

.note {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.avatar-preview {
    margin-top: 10px;
    max-width: 100px;
    max-height: 100px;
    display: none;
    border-radius: 5px;
}