/* ============================================================================
   SMARTCRM 360 - QUOTE FORM ENHANCEMENTS V20.2.0
   Enhanced professional styling for quote forms
   ============================================================================ */

/* Enhanced Pricing Controls with Better Visual Hierarchy */
.pricing-controls-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 32px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.08);
}

.pricing-controls-section .quote-form-section-title {
    font-size: 20px;
    color: #1e293b;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

.pricing-controls-section .quote-form-section-title i {
    font-size: 24px;
    color: #667eea;
}

/* Enhanced Pricing Control Items */
.pricing-control-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pricing-control-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pricing-control-item:hover {
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.pricing-control-item:hover::before {
    opacity: 1;
}

/* Enhanced Labels */
.pricing-control-label {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-control-label i {
    font-size: 16px;
    color: #667eea;
}

/* Enhanced Input Fields */
.pricing-control-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.pricing-control-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: #f8fafc;
}

.pricing-control-input:hover:not(:focus) {
    border-color: #cbd5e1;
}

.pricing-control-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

/* Enhanced Help Text */
.quote-form-help {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.5;
}

.quote-form-help::before {
    content: 'ℹ️';
    font-size: 14px;
}

/* Enhanced Info Badges */
.info-badge {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid #fb923c;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(251, 146, 60, 0.1);
}

.info-badge i {
    font-size: 20px;
    color: #ea580c;
    margin-top: 2px;
}

.info-badge strong {
    color: #9a3412;
}

/* Enhanced Special Discount Section - V21.4.0: Changed to neutral white/gray */
.special-discount-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(71, 85, 105, 0.08) !important;
}

.special-discount-section .quote-form-section-title {
    color: #1e293b;
    border-bottom-color: #cbd5e1;
}

.special-discount-section .quote-form-section-title i {
    color: #3b82f6;
}

.special-discount-input {
    width: 100%;
    padding: 18px 20px;
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    border: 3px solid #cbd5e1;
    border-radius: 12px;
    background: white;
    text-align: center;
    transition: all 0.3s ease;
}

.special-discount-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15);
}

/* Enhanced Products Section - V21.4.0: Changed to neutral white/gray */
.products-search-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(71, 85, 105, 0.08) !important;
}

.products-search-section .quote-form-section-title {
    color: #1e293b;
    border-bottom-color: #cbd5e1;
}

.products-search-section .quote-form-section-title i {
    color: #10b981;
}

/* Enhanced Product Search Input */
.product-search-wrapper {
    position: relative;
    width: 100%;
}

.product-search-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
    border: 3px solid #10b981;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
}

.product-search-input:focus {
    border-color: #059669;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.15);
    outline: none;
}

.product-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #059669;
}

.product-search-count {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: #059669;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Enhanced Add Product Button */
.product-add-button {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.product-add-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.product-add-button:active:not(:disabled) {
    transform: translateY(0);
}

.product-add-button:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
}

.product-add-button i {
    font-size: 18px;
}

/* Enhanced Items Table */
.items-table-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 2px solid #e2e8f0;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.items-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.items-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.items-table thead th {
    padding: 16px 12px;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.items-table thead th:first-child {
    border-radius: 10px 0 0 0;
}

.items-table thead th:last-child {
    border-radius: 0 10px 0 0;
}

.items-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.items-table tbody tr:hover {
    background: #f8fafc;
}

.items-table tbody td {
    padding: 14px 12px;
    font-size: 14px;
    color: #334155;
}

/* Enhanced Summary Cards */
.summary-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.summary-card {
    background: linear-gradient(135deg, #f8fafc 0%, white 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.summary-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
}

.summary-card-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.summary-card-value.highlight {
    color: #667eea;
}

/* Enhanced Modal Footer */
#newQuoteModal .modal-footer,
#editQuoteModal .modal-footer {
    background: #f8fafc;
    padding: 24px 40px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 20px 20px;
}

/* Enhanced Buttons */
.btn-modern {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn-modern-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-modern-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}

.btn-modern-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-modern-secondary:hover {
    background: #cbd5e1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #newQuoteModal .modal-content,
    #editQuoteModal .modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    #newQuoteModal .modal-header,
    #editQuoteModal .modal-header {
        padding: 24px 20px;
    }
    
    #newQuoteModal .modal-header h2,
    #editQuoteModal .modal-header h2 {
        font-size: 22px;
    }
    
    #newQuoteModal .modal-body,
    #editQuoteModal .modal-body {
        padding: 20px;
    }
    
    .quote-form-section {
        padding: 20px;
    }
    
    .pricing-controls-grid {
        grid-template-columns: 1fr !important;
    }
    
    .summary-cards-container {
        grid-template-columns: 1fr;
    }
}

/* Loading State */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 16px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error States */
.state-success {
    border-color: #10b981 !important;
    background: #f0fdf4;
}

.state-error {
    border-color: #ef4444 !important;
    background: #fef2f2;
}

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

.quote-form-section {
    animation: fadeIn 0.4s ease forwards;
}

.quote-form-section:nth-child(1) { animation-delay: 0.05s; }
.quote-form-section:nth-child(2) { animation-delay: 0.1s; }
.quote-form-section:nth-child(3) { animation-delay: 0.15s; }
.quote-form-section:nth-child(4) { animation-delay: 0.2s; }
.quote-form-section:nth-child(5) { animation-delay: 0.25s; }
