/* Preventivi iocos - Frontend Styles */

#preventivatore-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Step Navigation */
.preventivatore-step {
    display: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preventivatore-step.active {
    display: block;
}

.preventivatore-step h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Servizi Grid */
.servizi-grid, .opzioni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.servizio-option, .opzione-option {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
    position: relative;
}

.servizio-option:hover, .opzione-option:hover {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,115,170,0.15);
}

.servizio-option input[type="checkbox"], .opzione-option input[type="checkbox"] {
    display: none;
}

.servizio-option input[type="checkbox"]:checked + .servizio-content .servizio-name,
.opzione-option input[type="checkbox"]:checked + .opzione-name {
    color: #0073aa;
    font-weight: bold;
}

.servizio-option input[type="checkbox"]:checked,
.opzione-option input[type="checkbox"]:checked {
    display: block;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    background: #0073aa;
    border-radius: 50%;
    z-index: 10;
}

.servizio-option input[type="checkbox"]:checked::after,
.opzione-option input[type="checkbox"]:checked::after {
    content: '✓';
    color: white;
    font-size: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
}

.servizio-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.servizio-name, .opzione-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.servizio-descrizione {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 10px;
}

.servizio-price, .opzione-price {
    font-size: 20px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.servizio-esente-iva {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.servizio-option input[type="checkbox"]:checked + .servizio-content .servizio-esente-iva {
    background: #218838;
}

/* Form Elements */
.quantita-section, .dettagli-cliente {
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.form-group input, .form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

/* Buttons */
.btn-next, .btn-prev, .btn-submit {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-right: 10px;
}

.btn-next:hover, .btn-prev:hover, .btn-submit:hover {
    background: #005a87;
}

.btn-prev {
    background: #666;
}

.btn-prev:hover {
    background: #555;
}

/* Totale */
.preventivatore-totale {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0073aa;
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
}

.totale-label {
    font-size: 14px;
    margin-bottom: 5px;
}

.totale-amount {
    font-size: 24px;
    font-weight: bold;
}

/* Dettaglio IVA */
.dettaglio-iva {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    font-size: 14px;
}

/* Messaggio nessun servizio */
.no-servizi-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    color: #856404;
}

.no-servizi-message ul {
    margin: 10px 0;
    padding-left: 20px;
}

.no-servizi-message a {
    color: #0073aa;
    text-decoration: none;
    font-weight: bold;
}

.no-servizi-message a:hover {
    text-decoration: underline;
}

.iva-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 4px 0;
}

.iva-row.totale {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 8px;
    margin-top: 8px;
    font-size: 16px;
}

.iva-row:last-child {
    margin-bottom: 0;
}

/* Loading and Success States */
#preventivatore-loading, #preventivatore-success {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

#preventivatore-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Preventivo Display */
#preventivo-display {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preventivo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e1e1e1;
}

.preventivo-header h2 {
    color: #333;
    margin: 0;
}

.stato-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
}

.stato-bozza { background: #f8f9fa; color: #6c757d; }
.stato-inviato { background: #cce5ff; color: #0066cc; }
.stato-accettato { background: #d4edda; color: #155724; }
.stato-rifiutato { background: #f8d7da; color: #721c24; }
.stato-pagato { background: #d1ecf1; color: #0c5460; }

.preventivo-content {
    display: grid;
    gap: 30px;
}

.dettagli-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.dettaglio-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.dettaglio-item strong {
    color: #333;
    margin-bottom: 5px;
}

.servizi-list, .opzioni-list, .quantita-list {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
}

.servizi-list h4, .opzioni-list h4, .quantita-list h4 {
    margin-top: 0;
    color: #333;
}

.servizi-list ul, .opzioni-list ul, .quantita-list ul {
    list-style: none;
    padding: 0;
}

.servizi-list li, .opzioni-list li, .quantita-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e1e1e1;
}

.servizi-list li:last-child, .opzioni-list li:last-child, .quantita-list li:last-child {
    border-bottom: none;
}

.preventivo-totale {
    text-align: center;
    background: #0073aa;
    color: white;
    padding: 30px;
    border-radius: 8px;
}

.preventivo-totale h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.totale-amount {
    font-size: 36px;
    font-weight: bold;
}

.preventivo-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 20px;
    border-radius: 4px;
}

.preventivo-azioni {
    text-align: center;
    padding: 20px 0;
}

.btn-accetta, .btn-paga {
    background: #28a745;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s ease;
}

.btn-accetta:hover, .btn-paga:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

.btn-paga {
    background: #0073aa;
}

.btn-paga:hover {
    background: #005a87;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .servizi-grid, .opzioni-grid {
        grid-template-columns: 1fr;
    }
    
    .preventivo-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .dettagli-grid {
        grid-template-columns: 1fr;
    }
    
    .preventivatore-totale {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 20px;
    }
}

/* Admin Styles */
.preventivi-info-box {
    background: #f1f1f1;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-top: 30px;
}

.preventivi-info-box h3 {
    margin-top: 0;
}

.preventivi-info-box code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

/* Meta Box Styles */
.servizio-item, .opzione-item, .quantita-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.remove-servizio, .remove-opzione, .remove-quantita {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.remove-servizio:hover, .remove-opzione:hover, .remove-quantita:hover {
    background: #c82333;
}

