/* Stili generali */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

h1,
h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Stili header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 30px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-container {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.avatar-container:hover .avatar-overlay {
    opacity: 1;
}

.avatar-change-label {
    color: white;
    font-size: 0.7em;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
}

.avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Stili form login/register */
.tabs {
    display: flex;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    cursor: pointer;
    font-size: 16px;
    outline: none;
}

.tab-btn.active {
    background-color: #fff;
    font-weight: bold;
}

.tab-content {
    display: none;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 5px 5px;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input[type="file"] {
    padding: 8px;
    background-color: #f9f9f9;
}

.help-text {
    font-size: 0.8em;
    color: #7f8c8d;
    margin-top: 5px;
}

/* Stili bottoni */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Stili messaggi di alert */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Stili forum */
.forum-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.message-form {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-form textarea {
    width: 100%;
    height: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 15px;
    font-family: inherit;
    font-size: 16px;
}

.messages {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message {
    padding: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.message:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.message-info {
    display: flex;
    flex-direction: column;
}

.message-author {
    font-weight: bold;
    color: #2c3e50;
}

.message-date {
    font-size: 0.8em;
    color: #7f8c8d;
}

.message-content {
    line-height: 1.5;
}

.no-messages {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }
}