/* Import del sistema modali e pulsanti */
@import url('modals-and-buttons.css');
@import url('forms.css');

/* Reset CSS e stili di base */
* {
    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: #f8f9fa;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 480px) {
    .container {
        width: 100%;
        padding: 0 8px;
    }
}

/* Header e navigazione */
header {
    background-color: #0d0d0d;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

/* Layout desktop: titolo sopra, menu sotto */
.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
    flex: 1;
}

.logo h1 a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.logo h1 a:hover {
    cursor: pointer;
}

/* Pulsante hamburger (nascosto su desktop) */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Animazione hamburger quando attivo */
.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Navigazione desktop - centrata sotto il titolo */
nav {
    width: 100%;
    display: flex;
    justify-content: center;
}

nav ul {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    justify-content: center;
    gap: 5px;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    transition: background-color 0.3s;
    white-space: nowrap;
}

nav ul li a i {
    margin-right: 4px;
}

nav ul li a:hover, nav ul li a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* RESPONSIVE: Menu mobile */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        align-items: center;
    }
    
    .header-top {
        margin-bottom: 0;
        flex: 1;
    }
    
    .logo h1 {
        text-align: left;
        font-size: 1.5rem;
    }
    
    .hamburger {
        display: flex;
    }
    
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: #2c3e50;
        transition: right 0.3s ease;
        z-index: 1000;
        padding-top: 80px;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
        justify-content: flex-start;
    }
    
    nav.active {
        right: 0;
    }
    
    nav ul {
        flex-direction: column;
        height: 100%;
        padding: 0;
        margin: 0;
        justify-content: flex-start;
        gap: 0;
    }
    
    nav ul li {
        margin: 0;
        border-bottom: 1px solid #34495e;
    }
    
    nav ul li:last-child {
        border-bottom: none;
    }
    
    nav ul li a {
        padding: 15px 20px;
        font-size: 1rem;
        border-radius: 0;
        justify-content: flex-start;
        transition: all 0.3s ease;
        color: #e5e7eb !important;
    }

    nav ul li a:hover {
        background-color: #f3f4f6;
        color: #1f2937 !important;
        padding-left: 25px;
    }

    nav ul li a.active {
        background-color: var(--brand-orange);
        color: #ffffff !important;
        padding-left: 20px;
    }
    
    nav ul li a i {
        margin-right: 10px;
        width: 20px;
        text-align: center;
    }
}

/* Overlay per chiudere il menu cliccando fuori */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.menu-overlay.active {
    display: block;
}

@media (min-width: 769px) {
    .menu-overlay {
        display: none !important;
    }
}

/* Aggiustamenti per tablet */
@media (max-width: 768px) {
    /* margin-top gestito dinamicamente da JavaScript */
}

/* Miglioramenti per schermi molto piccoli */
@media (max-width: 480px) {
    nav ul li a {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    
    /* Aggiusta margine per mobile - gestito dinamicamente da JavaScript */
}

/* Miglioramenti per schermi molto grandi */
@media (min-width: 1200px) {
    .logo h1 {
        font-size: 2rem;
    }
    
    nav ul li a {
        font-size: 1rem;
        padding: 10px 15px;
    }
}

/* Main content */
main {
    padding: 2rem 0;
    /* margin-top gestito dinamicamente da JavaScript */
}

/* Classe specifica per contenuto principale */
.main-content {
    /* margin-top gestito dinamicamente da JavaScript */
}

section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid #f1f1f1;
    padding-bottom: 0.5rem;
}

h3 {
    color: #0d0d0d;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Cards per dashboard */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.2rem;
    border-left: 4px solid #0d0d0d;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.card h3 i {
    margin-right: 8px;
    color: #0d0d0d;
}

.card .amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.card .description {
    font-size: 0.85rem;
    color: #95a5a6;
}

/* Charts container */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.2rem;
}

.chart-placeholder {
    background-color: #f8f9fa;
    height: 200px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #95a5a6;
}

/* Tabella transazioni */
.recent-transactions {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #7f8c8d;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

.expense {
    color: #e74c3c;
}

.income {
    color: #0d0d0d;
}

/* Footer */
footer {
    background-color: #34495e;
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
}

/* Stili per le notifiche */
.notifications-container {
    margin: 2rem 0;
}

.notifications-container h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.notifications-container h3 i {
    margin-right: 0.5rem;
    color: #e74c3c;
}

.notification-list {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.notification-item {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.3s;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 1rem;
    color: white;
}

.notification-icon.positive {
    background-color: #0d0d0d;
}

.notification-icon.negative {
    background-color: #e74c3c;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: #2c3e50;
}

.notification-description {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 3px;
}

.notification-account {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: 3px;
}

.empty-notifications {
    padding: 2rem;
    text-align: center;
    color: #7f8c8d;
}

.loading {
    padding: 1rem;
    text-align: center;
    color: #7f8c8d;
}

.view-all-notifications {
    display: block;
    padding: 1rem;
    text-align: center;
    color: #0d0d0d;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
}

.view-all-notifications:hover {
    background-color: #f8f9fa;
}

/* Stili per l'avviso imposta di bollo */
.imposta-bollo-warning {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

.imposta-bollo-warning i {
    color: #ffc107;
    font-size: 1rem;
}

.imposta-bollo-warning strong {
    color: #d39e00;
    font-weight: 600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}