:root {
    --bg: #0a0a0a;
    --panel: #1a1a1a;
    --muted: #9be7ff;
    --text: #ffffff;
    --text-secondary: #aaaaaa;
    --border: #222222;
    --success: #51cf66;
    --error: #ff6b6b;
    --warning: #ffd43b;
    --info: #339af0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Utility Classes */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-primary {
    background: var(--muted);
    color: #000;
}

.btn-primary:hover {
    background: #ffffff;
}

.btn-secondary {
    background: #333;
    color: #fff;
}

.btn-secondary:hover {
    background: #444;
}

.btn-success {
    background: var(--success);
    color: #000;
}

.btn-danger {
    background: var(--error);
    color: #000;
}

.btn-edit {
    background: #2a4d2a;
    color: #8bc34a;
}

.btn-edit:hover {
    background: #3a5d3a;
}

.btn-delete {
    background: #4d2a2a;
    color: #ff6b6b;
}

.btn-delete:hover {
    background: #5d3a3a;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--muted);
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: #111;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Messages */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.alert-success {
    background: rgba(81, 207, 102, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

/* Card Styles */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.table th {
    background: #1a1a1a;
    color: var(--muted);
    font-weight: bold;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    background-color: var(--panel);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    color: var(--muted);
    font-size: 1.5rem;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #fff;
}

/* Footer Styles */
.site-footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
}

/* Main Content Area */
.main-content {
    min-height: calc(100vh - 200px); /* Assicura che il footer sia in fondo */
    padding: 2rem 0;
}

/* Utility per flexbox */
.flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

/* Text utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--muted);
}

.text-secondary {
    color: var(--text-secondary);
}

/* Spacing utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    background-color: var(--panel);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    color: var(--text);
    position: relative;
}

.modal-content h2 {
    color: var(--muted);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    line-height: 1;
}

.close:hover {
    color: #fff;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(81, 207, 102, 0.1);
    border-color: #51cf66;
    color: #51cf66;
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

/* Button Enhancements */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
}

.btn-primary {
    background: var(--muted);
    color: #000;
}

.btn-primary:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 231, 255, 0.2);
}

.btn-secondary {
    background: #333;
    color: #fff;
}

.btn-secondary:hover {
    background: #444;
    transform: translateY(-2px);
}

.btn-danger {
    background: #4d2a2a;
    color: #ff6b6b;
}

.btn-danger:hover {
    background: #5d3a3a;
    transform: translateY(-2px);
}

.btn-edit {
    background: #2a4d2a;
    color: #8bc34a;
}

.btn-edit:hover {
    background: #3a5d3a;
    transform: translateY(-2px);
}

/* Form Enhancements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--muted);
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: #111;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239be7ff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

/* Stili aggiuntivi per reset password */
.alert {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(81, 207, 102, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-success h3 {
    margin-top: 0;
    color: var(--success);
}

.btn-secondary {
    background: #333;
    color: #fff;
}

.btn-secondary:hover {
    background: #444;
}

/* Stile per i link nei messaggi */
.auth-form-container a {
    color: var(--muted);
    text-decoration: none;
}

.auth-form-container a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Stile per i piccoli testi */
small {
    display: block;
    margin-top: 0.25rem;
}

/* Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--panel);
    border-top: 2px solid var(--muted);
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-content p {
    flex: 1;
    margin: 0;
    color: var(--text);
}

.cookie-content a {
    color: var(--muted);
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Footer Content */
.footer-content {
    text-align: center;
    padding: 1rem 0;
}

.footer-links {
    margin: 0.5rem 0;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.footer-note a {
    color: var(--muted);
    text-decoration: none;
}

.footer-note a:hover {
    text-decoration: underline;
}

/* Pubblicità Styles */
.eadv-ad {
    margin: 1rem auto;
    text-align: center;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    padding: 0.5rem;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .btn-sm {
        flex: 1;
        min-width: 120px;
    }
    
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-links a {
        margin: 0;
    }
}

/* Badge per le tabelle Cookie Policy */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    text-align: center;
    color: #000;
}

.badge-success {
    background: #51cf66;
}

.badge-warning {
    background: #ffd43b;
}

.badge-error {
    background: #ff6b6b;
}

/* Stili per tabelle */
.table th {
    background: rgba(155, 231, 255, 0.1);
    color: var(--muted);
    font-weight: bold;
}

.table td {
    vertical-align: middle;
}

.table-responsive {
    margin: 1rem 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

/* Responsive per tabelle */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Stile per le liste nella Cookie Policy */
.card ul {
    padding-left: 1.5rem;
}

.card ul li {
    margin-bottom: 0.5rem;
    position: relative;
}

.card ul li::before {
    content: "→";
    color: var(--muted);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* Spacing migliorato */
.mb-4 {
    margin-bottom: 2rem;
}

.mt-4 {
    margin-top: 2rem;
}

/* Alert migliorati */
.alert h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: inherit;
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

/* Stili per le sidebar ads */
.ad-sidebar {
    position: fixed;
    top: 150px;
    width: auto; /* Si adatta alla larghezza del contenuto */
    height: auto; /* Si adatta all'altezza del contenuto */
    max-width: 200px; /* Limite massimo di sicurezza */
    z-index: 1500;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ad-sidebar-left {
    left: 120px;
}

.ad-sidebar-right {
    right: 120px;
}

/* Assicurati che il contenuto principale non sia coperto dalle sidebar */
.main-content {
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 15px;
}

/* ECCEZIONE: la sezione hero deve occupare tutta la larghezza */
.hero {
    width: calc(100vw - 10px); /* Sottrae 20px dalla larghezza totale */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow-x: hidden;
}

/* Il contenitore interno dell'hero rimane centrato */
.hero > .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Responsive: nascondi sidebar su schermi piccoli */
@media (max-width: 1199px) {
    .ad-sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Su mobile, l'hero torna al comportamento normale */
    .hero {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        left: auto;
        right: auto;
    }
}

/* Stili per altre ads */
.ad-container {
    margin: 20px 0;
    text-align: center;
    overflow: hidden;
}

.ad-header, .ad-footer, .ad-home-after-hero {
    width: 100%;
    max-width: 728px;
    margin: 10px auto;
}

.ad-before-navbar {
    background: #f8f9fa;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
    width: 100%;
    text-align: center;
}

.ad-after-footer {
    background: #f8f9fa;
    padding: 15px 0;
    border-top: 1px solid #dee2e6;
    margin-top: 20px;
    width: 100%;
    text-align: center;
}

.ad-home-after-hero {
    margin: 30px auto;
    max-width: 970px;
}

/* INIZIO NUOVI STILI PER SISTEMA MESSAGGI E AMICIZIE */

/* Stili per badge notifiche nei bottoni */
.btn .badge {
    margin-left: 0.5rem;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    vertical-align: middle;
}

/* Stili per pulsanti piccoli */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Stili per form di ricerca centrati */
.search-form.centered {
    max-width: 600px;
    margin: 2rem auto;
    display: flex;
    gap: 0.5rem;
}

.search-form.centered .search-input {
    flex: 1;
    padding: 0.75rem;
    background: #111;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}

.search-form.centered .search-button {
    padding: 0.75rem 1.5rem;
    background: var(--muted);
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* Stili per stati vuoti */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border);
}

.empty-state h3 {
    color: var(--muted);
    margin-bottom: 0.5rem;
}

/* Stili per liste di richieste */
.requests-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.request-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.request-item:hover {
    border-color: var(--muted);
    background: #2a2a2a;
}

.request-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.request-avatar {
    width: 40px;
    height: 40px;
    background: rgba(155, 231, 255, 0.2);
    color: var(--muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.request-details {
    flex: 1;
}

.request-username {
    font-weight: bold;
    color: var(--muted);
}

.request-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.request-actions {
    display: flex;
    gap: 0.5rem;
}

/* Stili per schede amici */
.friend-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.friend-card:hover {
    border-color: var(--muted);
    transform: translateY(-3px);
}

.friend-avatar {
    width: 50px;
    height: 50px;
    background: rgba(155, 231, 255, 0.2);
    color: var(--muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 2px solid var(--muted);
}

.friend-info {
    flex: 1;
}

.friend-username {
    font-weight: bold;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.friend-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.friend-actions {
    display: flex;
    gap: 0.5rem;
}

/* Stili per liste di giochi */
.games-list {
    display: grid;
    gap: 0.5rem;
}

.game-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 4px;
    transition: background-color 0.2s;
    border: 1px solid var(--border);
}

.game-item:hover {
    background: #1a1a1a;
    transform: translateX(5px);
}

.game-link {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
}

.game-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.code-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    background: #333;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

/* Responsive per liste */
@media (max-width: 576px) {
    .request-item {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .request-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .friend-card {
        flex-direction: column;
        text-align: center;
    }
    
    .friend-actions {
        width: 100%;
        justify-content: center;
    }
    
    .game-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .code-count {
        align-self: flex-start;
    }
}

/* Stili per formattazione BBCode-like nei messaggi */
.bb-bold {
    font-weight: bold;
}

.bb-italic {
    font-style: italic;
}

.bb-underline {
    text-decoration: underline;
}

.bb-color {
    /* Il colore viene applicato inline */
}

/* Stili per l'editor di messaggi */
.editor-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #1a1a1a;
    border-radius: 6px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
    align-items: center;
}

.btn-format {
    background: #333;
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.btn-format:hover {
    background: #444;
}

.color-picker {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
}

.emoji-picker {
    background: #333;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    min-width: 120px;
}

.char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    background: rgba(0,0,0,0.1);
}

.char-counter.warning {
    color: #ffa500;
}

.char-counter.error {
    color: #ff4757;
}

/* Stili per i messaggi nella inbox */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.message-item:hover {
    border-color: var(--muted);
    background: #1a1a1a;
}

.message-item.unread {
    border-left: 4px solid var(--muted);
    background: rgba(155, 231, 255, 0.05);
}

.message-checkbox {
    flex-shrink: 0;
}

.message-avatar {
    width: 40px;
    height: 40px;
    background: rgba(155, 231, 255, 0.2);
    color: var(--muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    min-width: 0; /* Per evitare overflow */
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-sender {
    font-weight: bold;
    color: var(--muted);
}

.message-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.message-subject {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.message-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Stili per la visualizzazione di un singolo messaggio */
.message-view {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
}

.message-header-full {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.message-from, .message-to {
    color: var(--muted);
    font-weight: bold;
}

.message-timestamp {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.message-subject-full {
    font-size: 1.5rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.message-body {
    line-height: 1.8;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 1.5rem 0;
    min-height: 200px;
}

.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
}

.message-importance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.message-importance i {
    color: #ffd43b;
}

/* Stili per la barra degli strumenti dei messaggi */
.messages-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--panel);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.messages-actions {
    display: flex;
    gap: 0.5rem;
}

.messages-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.messages-filter {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.messages-filter:hover,
.messages-filter.active {
    background: var(--muted);
    color: #000;
    border-color: var(--muted);
}

/* Stili per la paginazione */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-item {
    list-style: none;
}

.page-link {
    display: block;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--muted);
    color: #000;
    border-color: var(--muted);
}

.page-item.active .page-link {
    background: var(--muted);
    color: #000;
    border-color: var(--muted);
    font-weight: bold;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Stili per il bottone del menu mobile (già presente) */
.mobile-menu-toggle {
    display: none;
}

/* Responsive aggiuntivo per messaggi */
@media (max-width: 768px) {
    .messages-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .messages-actions,
    .messages-filters {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .message-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .message-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .message-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .message-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Stili per i bottoni con icone */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stili per i form checkbox */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
}

/* Stili per le etichette dei form */
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--muted);
    font-weight: bold;
}

/* Stili per i contatori */
.counter {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 0.25rem;
}

.counter.warning {
    color: #ffa500;
}

.counter.error {
    color: #ff4757;
}

/* Stili per i badge nelle icone navbar */
.nav-link .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.nav-link {
    position: relative;
}

/* Stili per le sezioni di impostazioni */
.settings-section {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.settings-section h3 {
    color: var(--muted);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* Stili per le action grid nelle impostazioni */
.settings-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Stili per i toggle switch nelle impostazioni */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin-left: 1rem;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--muted);
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

/* Stili per le notifiche toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--info);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Stili per lo scrollbar personalizzato */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* Stili per il carico di immagini */
.image-loading {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.image-loading::before {
    content: "🖼️";
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

/* Stili per i tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--panel);
    color: var(--text);
    text-align: center;
    border-radius: 6px;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Stili per le card delle statistiche */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--muted);
    display: block;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.5rem;
}

/* Fine nuovi stili */