/**
 * Government HRIS Form Enhancement Styles
 * Consistent styling for enhanced forms across the system
 */

/* Enhanced Form Controls */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color, #1e3c72);
    box-shadow: 0 0 0 0.2rem rgba(30, 60, 114, 0.25);
}

.form-control.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.94-.94 1.38 1.38L7.7 4.08 6.76 3.14 4.26 5.64z'/%3e%3c/svg%3e");
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 2.4 2.4M8.2 4.6l-2.4 2.4'/%3e%3c/svg%3e");
}

.form-select.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 6 6 6-6'/%3e%3c/svg%3e"), url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.94-.94 1.38 1.38L7.7 4.08 6.76 3.14 4.26 5.64z'/%3e%3c/svg%3e");
}

.form-select.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 6 6 6-6'/%3e%3c/svg%3e"), url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 2.4 2.4M8.2 4.6l-2.4 2.4'/%3e%3c/svg%3e");
}

/* Enhanced Form Switches */
.form-check-input:checked {
    background-color: var(--primary-color, #1e3c72);
    border-color: var(--primary-color, #1e3c72);
}

.form-check-input:focus {
    border-color: var(--primary-color, #1e3c72);
    box-shadow: 0 0 0 0.25rem rgba(30, 60, 114, 0.25);
}

/* Enhanced Form Labels */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-label .text-danger {
    font-weight: 600;
}

/* Enhanced Form Text */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.form-text i {
    margin-right: 0.25rem;
}

/* Enhanced Invalid Feedback */
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

/* Enhanced Card Headers */
.card-header {
    background: rgba(0,0,0,0.02);
    border-bottom: 1px solid rgba(0,0,0,0.125);
    font-weight: 500;
}

.card-header .card-title {
    color: var(--primary-color, #1e3c72);
    font-weight: 600;
}

/* Enhanced Help Panels */
.help-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.help-panel .card-header {
    background: var(--primary-color, #1e3c72);
    color: white;
    border-bottom: none;
}

.help-panel .card-body {
    padding: 1.5rem;
}

.help-panel h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.help-panel ul {
    margin-bottom: 1rem;
}

.help-panel ul:last-child {
    margin-bottom: 0;
}

.help-panel li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Enhanced Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #1e3c72) 0%, var(--secondary-color, #2a5298) 100%);
    border: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1a3461 0%, #245085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-primary:disabled {
    background: #6c757d;
    transform: none;
    box-shadow: none;
}

/* Enhanced Input Groups */
.input-group-text {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
    font-weight: 500;
}

/* Enhanced Tooltips */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background-color: #343a40;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

/* Enhanced Form Sections */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

.form-section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

.form-section-title {
    color: var(--primary-color, #1e3c72);
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

/* Enhanced Loading States */
.btn .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Enhanced Form Validation Animations */
.form-control.is-valid,
.form-select.is-valid {
    animation: validPulse 0.3s ease-in-out;
}

.form-control.is-invalid,
.form-select.is-invalid {
    animation: invalidShake 0.3s ease-in-out;
}

@keyframes validPulse {
    0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(25, 135, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}

@keyframes invalidShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Enhanced Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
}

.password-strength .progress {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
}

.password-strength .progress-bar {
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* Enhanced Alert Styles */
.alert {
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .form-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .help-panel .card-body {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
}

/* Print Styles */
@media print {
    .help-panel,
    .btn,
    .form-text,
    .invalid-feedback {
        display: none !important;
    }
    
    .form-control,
    .form-select {
        border: 1px solid #000 !important;
        background: transparent !important;
    }
}
