/**
 * Calcolatore IVA Module - Styles
 * Basato sul design di CalcoloIVAOnline.it
 */

/* ============================================
   VARIABILI CSS - Mantenute dal design originale
   ============================================ */
:root {
    /* Color Palette - Modern & Trustworthy */
    --primary: #4F46E5; /* Indigo 600 */
    --primary-hover: #4338CA; /* Indigo 700 */
    --secondary: #10B981; /* Emerald 500 */
    --background: #F9FAFB; /* Gray 50 */
    --surface: #FFFFFF;
    --text-main: #111827; /* Gray 900 */
    --text-muted: #6B7280; /* Gray 500 */
    --border: #E5E7EB; /* Gray 200 */
    --error: #EF4444;
    --success: #10B981;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Spacing & Radius */
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

/* ============================================
   MODULO CALCOLATORE IVA - Container principale
   ============================================ */
.calcolatore-iva-module {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.calcolatore-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.calcolatore-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    text-align: center;
}

.calcolatore-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

/* ============================================
   FORM STYLING
   ============================================ */
.iva-form {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: var(--surface);
    color: var(--text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control.readonly-field {
    background-color: #F3F4F6;
    cursor: not-allowed;
}

/* ============================================
   BUTTONS
   ============================================ */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    text-decoration: none;
    flex: 1;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: #E0E7FF;
    color: var(--primary);
}

.btn-secondary:hover {
    background-color: #C7D2FE;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-danger {
    background-color: #EF4444;
    color: white;
}

.btn-success {
    background-color: #10B981;
    color: white;
}

/* ============================================
   STORICO CALCOLI - History Table
   ============================================ */
.storico-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.storico-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.storico-header h4 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-main);
}

.storico-actions {
    display: flex;
    gap: 0.5rem;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history-table th,
.history-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.history-table th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: #F9FAFB;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tbody tr:hover {
    background-color: #F9FAFB;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .calcolatore-card {
        padding: 1.5rem;
    }
    
    .calcolatore-title {
        font-size: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .storico-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .storico-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .history-table {
        font-size: 0.8rem;
    }
    
    .history-table th,
    .history-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .calcolatore-iva-module {
        margin: 1rem;
    }
    
    .calcolatore-card {
        padding: 1rem;
    }
    
    .history-table {
        display: block;
        overflow-x: auto;
    }
}

/* ============================================
   BADGE COMPONENT (da custom.css)
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-primary {
    color: var(--primary);
    background-color: #EEF2FF;
}

.badge-secondary {
    color: var(--secondary);
    background-color: #ECFDF5;
}

.badge-danger {
    color: #DC2626;
    background-color: #FEF2F2;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}
