/* Spese Extra - Stili Specifici */

/* Header della pagina */
.page-header {
    background: #0d0d0d;
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 12px;
}

.header-content {
    text-align: center;
}

.header-content h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.header-subtitle {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Quick Add Section */
.quick-add-section {
    margin-bottom: 2rem;
}

.quick-add-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.quick-add-card h3 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-form .form-row {
    display: grid;
    grid-template-columns: 120px minmax(120px, 1fr) minmax(150px, 1.5fr) 40px 40px;
    gap: 1rem;
    align-items: end;
}

.quick-form .form-group {
    margin-bottom: 0;
    min-width: 0; /* Permette al contenuto di ridursi */
}

/* Assicura che il dropdown custom non si espanda */
.custom-category-select {
    max-width: 100%;
    overflow: visible; /* Permette al menu di aprirsi */
    position: relative;
    z-index: 10;
}

.custom-select-trigger-cat {
    max-width: 100%;
}

.custom-select-trigger-cat .selected-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-form input, .quick-form select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.quick-form input:focus, .quick-form select:focus {
    border-color: #ff7a00;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.1);
}

.quick-amount-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.quick-amount-wrapper .euro-prefix {
    position: absolute;
    left: 12px;
    color: #6b7280;
    font-size: 1rem;
    font-weight: 600;
    pointer-events: none;
    font-family: 'Poppins', sans-serif;
}
#quick-amount {
    font-weight: 600;
    text-align: left;
    font-size: 1.1rem;
    padding-left: 28px !important;
}

/* Modern Button Styles - Colori solidi semplici */
.btn-modern {
    background: #0d0d0d;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-transform: none;
    position: relative;
}

.btn-modern:hover {
    background: #333333;
    transform: translateY(-2px);
}

.btn-modern:active {
    transform: translateY(0);
}

.btn-modern i {
    font-size: 1.1rem;
}

/* Square button variant (solo desktop) */
.btn-modern.btn-square {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.btn-modern.btn-square i {
    margin: 0;
}

/* Orange button variant - Colore solido */
.btn-modern.btn-orange {
    background: #ff7a00;
}

.btn-modern.btn-orange:hover {
    background: #e66900;
}

/* Media query per schermi ridotti - nascondi testo categoria */
@media (max-width: 1100px) {
    .quick-form .form-row {
        grid-template-columns: 100px minmax(60px, 1fr) minmax(150px, 2fr) 40px 40px;
    }

    #quick-category {
        width: 100%;
        min-width: 60px;
        color: transparent;
        font-size: 0;
        text-align: center;
    }

    #quick-category option {
        color: #1a1a1a;
        font-size: 1rem;
        text-align: left;
    }
}

/* Responsive adjustments for modern button */
@media (max-width: 768px) {
    .btn-modern {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    /* Su mobile i pulsanti quadrati tornano rettangolari/full width */
    .btn-modern.btn-square {
        width: 100%;
        height: auto;
        padding: 0.9rem 1.5rem;
    }

    .quick-form .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .quick-form .form-group:last-child {
        margin-top: 0.5rem;
    }

    .btn-modern {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .btn-modern {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .btn-modern.btn-square {
        padding: 0.8rem 1.2rem;
    }
}

/* Stats Grid */
.stats-section {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stats-grid .stat-card {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    border-left: 3px solid #ff7a00;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stats-grid .stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
}

.stat-icon.today {
    background: #ff7a00;
}

.stat-icon.week {
    background: #ff7a00;
}

.stat-icon.month {
    background: #3b82f6;
}

.stat-icon.prediction {
    background: #10b981;
}

.stat-content h4 {
    margin: 0 0 0.25rem 0;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.15rem 0;
    font-family: 'Segoe UI', -apple-system, system-ui, sans-serif;
}

.stat-content small {
    color: #64748b;
    font-size: 0.8rem;
}

/* Budget Section */
.budget-section {
    margin-bottom: 2rem;
}

.budget-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

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

.budget-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.budget-progress {
    margin-top: 1rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.progress-bar {
    height: 12px;
    background-color: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #ff7a00;
    transition: width 0.3s ease;
    border-radius: 6px;
}

.progress-fill.warning {
    background: #f59e0b;
}

.progress-fill.danger {
    background: #ef4444;
}

/* Filters Section */
.filters-section {
    margin-bottom: 2rem;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filters-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group select {
    padding: 0.5rem 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.25rem;
}

.view-toggle .btn-icon {
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #6c757d;
    transition: all 0.3s ease;
}

.view-toggle .btn-icon.active {
    background: #ff7a00;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 122, 0, 0.3);
}

/* Expenses List */
.expenses-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    min-height: 400px;
    max-width: 100%;
    overflow: hidden;
}

.expenses-container {
    padding: 1rem;
    overflow-x: hidden;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: #495057;
}

/* Expense Items - stili in css/spesa-card.css (condiviso con Spese Previste) */

/* Day Groups */
.day-group {
    margin-bottom: 1.5rem;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
}

.day-date {
    font-weight: 600;
    color: #495057;
}

.day-total {
    font-weight: 700;
    color: #dc2626;
}

/* Chart Section */
.chart-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

/* Vista Grafico - Layout compatto e pulito */
#chart-view-section {
    background: white;
    min-height: 0 !important;
    height: auto !important;
}

#expenses-chart {
    width: 100% !important;
    height: 100% !important;
}

#chart-legend {
    /* Stili inline nell'HTML */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.legend-text {
    font-size: 0.9rem;
    color: #495057;
}

/* margin-top gestito dinamicamente da JavaScript in main.js */

/* Responsive Design */
@media (max-width: 768px) {
    .quick-form .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filters-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .view-controls {
        justify-content: space-between;
    }
    
    
    .day-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 1.5rem 0;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .info-badge {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .quick-add-card,
    .budget-card {
        padding: 1rem;
    }
    
    .stats-grid .stat-card {
        padding: 0.75rem 1rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }
}

/* Animazioni */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Stili per categorie */
.category-alimentari { background: #fef2f2; border: 1px solid #fecaca; }
.category-trasporti { background: #f0fdf4; border: 1px solid #bbf7d0; }
.category-ristorazione { background: #fff7ed; border: 1px solid #fed7aa; }
.category-svago { background: #f3f4f6; border: 1px solid #e5e7eb; }
.category-salute { background: #fdf2f8; border: 1px solid #fbcfe8; }
.category-abbigliamento { background: #eff6ff; border: 1px solid #bfdbfe; }
.category-casa { background: #ecfdf5; border: 1px solid #a7f3d0; }
.category-tecnologia { background: #fefce8; border: 1px solid #fde68a; }
.category-regali { background: #f0fdfa; border: 1px solid #99f6e4; }
.category-altro { background: #f8f9fa; border: 1px solid #e5e7eb; }

/* Rimuovo gli stili modali duplicati - ora usa modals-and-buttons.css */