/* ============================================ */
/* INVOICE/PROPOSAL FORMS STYLES */
/* Styles for create, edit, and version forms */
/* ============================================ */

/* Form Sections */
.form-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.form-section-subtitle {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Input Fields */
.form-input,
.form-select,
.form-textarea {
    border: 1px solid #d1d5db;
    padding: 0.5rem;
    width: 100%;
    border-radius: 0.375rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    ring: 2px;
    ring-color: #3b82f64d;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Grid Layouts */
.form-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .form-grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-teal {
    background-color: #14b8a6;
    color: white;
}

.btn-teal:hover {
    background-color: #0d9488;
}

.btn-purple {
    background-color: #9333ea;
    color: white;
}

.btn-purple:hover {
    background-color: #7e22ce;
}

.btn-outline {
    border: 1px solid #d1d5db;
    background-color: transparent;
}

.btn-outline:hover {
    background-color: #f9fafb;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Section Chips/Tags */
.section-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background-color: #ccfbf1;
    border: 1px solid: #5eead4;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.section-chip-remove {
    color: #dc2626;
    cursor: pointer;
}

.section-chip-remove:hover {
    color: #991b1b;
}

/* Scope Display Areas */
.scope-display {
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background-color: #f9fafb;
}

.scope-empty-message {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Items Container */
.items-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 0.5rem;
    align-items: start;
}

.item-remove-btn {
    color: #dc2626;
    cursor: pointer;
    padding: 0.5rem;
}

.item-remove-btn:hover {
    color: #991b1b;
}

/* Indicators */
.section-edited-indicator {
    color: #f97316;
}

.section-label {
    cursor: pointer;
    flex: 1;
}

.section-label:hover {
    color: #3b82f6;
}

/* Checkboxes */
input[type="checkbox"] {
    border-radius: 0.25rem;
    cursor: pointer;
}

/* Financial Summary */
.financial-summary-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 768px) {
    .financial-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Help Text */
.help-text {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.help-text-primary {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Feature Highlight Box */
.feature-highlight {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: #1f2937;
}

.feature-highlight strong {
    display: block;
    margin-bottom: 0.25rem;
}

.feature-highlight ul {
    list-style-type: disc;
    list-style-position: inside;
    margin-top: 0.25rem;
}

.feature-highlight li {
    margin-top: 0.25rem;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .item-row {
        grid-template-columns: 1fr;
    }
    
    .form-section {
        padding: 1rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Disabled State */
.disabled,
[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid #3b82f6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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