/* Styles pour le générateur de factures - Frontend Simplifié */

.invoice-generator-form {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.invoice-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 3px solid #007cba;
}

.invoice-header h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 32px;
    font-weight: 700;
}

.intro-text {
    color: #666;
    font-size: 18px;
    margin: 0;
    line-height: 1.5;
}

.form-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 5px solid #007cba;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 22px;
    font-weight: 600;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 250px;
}

.form-group.half {
    flex: 0 0 calc(50% - 10px);
}

.form-group.third {
    flex: 0 0 calc(33.333% - 14px);
}

.form-group.quarter {
    flex: 0 0 calc(25% - 15px);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Articles */
.item-row {
    background: white;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
    position: relative;
    transition: all 0.3s ease;
}

.item-row:hover {
    border-color: #007cba;
    box-shadow: 0 2px 10px rgba(0, 124, 186, 0.1);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e5e9;
}

.item-header h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.remove-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.remove-item:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.total-display {
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    font-weight: 700;
    text-align: center;
    color: #007cba;
    font-size: 16px;
    border: 2px solid #e1e5e9;
}

#add-item {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

#add-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.4);
}

/* Section totaux */
.total-section {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-left-color: #28a745;
    border: 2px solid #28a745;
}

.total-summary {
    max-width: 350px;
    margin-left: auto;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e1e5e9;
    font-size: 16px;
}

.total-row.grand-total {
    font-size: 20px;
    font-weight: 700;
    border-bottom: 3px solid #333;
    color: #333;
    padding: 15px 0;
    margin-top: 10px;
}

/* Actions */
.form-actions {
    text-align: center;
    margin-top: 40px;
}

#generate-invoice {
    background: linear-gradient(135deg, #007cba 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 124, 186, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#generate-invoice:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(0, 124, 186, 0.4);
}

#generate-invoice:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Résultat */
.invoice-result {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 8px;
    text-align: center;
}

.result-message {
    margin-bottom: 20px;
    color: #155724;
    font-weight: 600;
    font-size: 16px;
}

#download-link {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

#download-link:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.4);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    margin-top: 25px;
    font-size: 18px;
    font-weight: 600;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Boutons */
.button-primary {
    background: linear-gradient(135deg, #007cba 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 124, 186, 0.2);
}

.button-primary:hover {
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 124, 186, 0.3);
}

.button-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(108, 117, 125, 0.2);
}

.button-secondary:hover {
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(108, 117, 125, 0.3);
}

/* Messages d'erreur */
.error-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    padding: 12px 15px;
    border: 2px solid #dc3545;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .invoice-generator-form {
        padding: 20px;
        margin: 15px;
    }
    
    .invoice-header h2 {
        font-size: 26px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group.half,
    .form-group.third,
    .form-group.quarter {
        flex: 1;
    }
    
    .total-summary {
        max-width: none;
    }
    
    .item-row {
        padding: 20px;
    }
    
    #generate-invoice {
        padding: 15px 30px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .invoice-generator-form {
        padding: 15px;
        margin: 10px;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .invoice-header h2 {
        font-size: 22px;
    }
    
    .intro-text {
        font-size: 16px;
    }
}

