/* ================================================
   Prospect Application Wizard Styles
   Bootstrap 4.6.2 Compatible
   ================================================ */

/* Wizard Container */
#wizard-application {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

/* Progress Indicator */
.wizard-progress {
    margin-bottom: 2rem;
    width: 100%;
}

.progress-container {
    position: relative;
    width: 100%;
}

.progress {
    background-color: #e9ecef;
    border-radius: 50px;
    overflow: visible;
    width: 100%;
}

.progress-bar {
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    border-radius: 50px;
    transition: width 0.6s ease;
}

/* Step Indicators */
.step-indicators {
    position: relative;
    margin-top: -4px;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #6c757d;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

/* Fallback step numbers when icons don't load */
.step-circle[data-step="1"]:empty::before { content: "1"; }
.step-circle[data-step="2"]:empty::before { content: "2"; }
.step-circle[data-step="3"]:empty::before { content: "3"; }
.step-circle[data-step="4"]:empty::before { content: "4"; }
.step-circle[data-step="5"]:empty::before { content: "5"; }
.step-circle[data-step="6"]:empty::before { content: "6"; }

.step-indicator.active .step-circle {
    border-color: #007bff;
    color: #007bff;
    background: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
}

.step-indicator.completed .step-circle {
    background: #28a745;
    border-color: #28a745;
    color: #ffffff;
}

.step-indicator.completed .step-circle i::before {
    content: "\f00c"; /* Check mark */
}

.step-label {
    margin-top: 8px;
    font-weight: 500;
    color: #6c757d;
    text-align: center;
    transition: color 0.3s ease;
}

.step-indicator.active .step-label {
    color: #007bff;
    font-weight: 600;
}

.step-indicator.completed .step-label {
    color: #28a745;
}

/* Mobile Step Indicators */
@media (max-width: 768px) {
    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .step-indicator.active .step-circle {
        transform: scale(1.05);
    }
}

/* Wizard Card */
.wizard-content .card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.wizard-content .card-body {
    padding: 2.5rem;
    min-height: 500px;
}

@media (max-width: 768px) {
    .wizard-content .card-body {
        padding: 1.5rem;
        min-height: 400px;
    }
}

/* Wizard Steps */
.wizard-step {
    animation: fadeIn 0.5s ease-in-out;
}

.wizard-step.d-none {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step Headers */
.step-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.step-title {
    color: #495057;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.step-description {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 0;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control, .form-select, select.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #495057;
    line-height: 1.5;
}

.form-select, select.form-control {
    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 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Improve dropdown option visibility */
select.form-control option {
    color: #495057;
    background-color: #ffffff;
    padding: 0.5rem;
}

select.form-control option:first-child {
    color: #6c757d;
    font-style: italic;
}

/* Fix placeholder-like first option styling */
select.form-control.has-placeholder,
select.form-select.has-placeholder {
    color: #495057 !important;
    font-style: italic;
    opacity: 0.7;
    height: 50px;
}

select.form-control:not(.has-placeholder),
select.form-select:not(.has-placeholder) {
    color: #495057 !important;
    font-style: normal;
    opacity: 1;
    height: 50px;
}

/* Also target by value for immediate visibility */
select.form-control[value=""],
select.form-select[value=""] {
    color: #495057 !important;
    font-style: italic;
    opacity: 0.7;
    height: 50px;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background-color: #ffffff;
    color: #495057;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-valid {
    border-color: #28a745;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Fieldsets */
.wizard-fieldset {
    border: none;
    padding: 0;
    margin-bottom: 2rem;
}

.wizard-fieldset legend {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    border: none;
    padding: 0 0 1rem 0;
    margin-bottom: 1.5rem;
    width: 100%;
    display: flex;
    align-items: center;
}

.wizard-fieldset legend i {
    margin-right: 0.75rem;
    color: #007bff;
    font-size: 1.1em;
}

/* Navigation Buttons */
.wizard-navigation {
    background: #ffffff;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.wizard-navigation .btn {
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Ensure right column buttons are aligned to the right */
.wizard-navigation .col-6.text-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

/* Remove the default margin from Bootstrap's me-2 class and use gap instead */
.wizard-navigation .btn-outline-primary {
    margin-right: 0 !important;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #1e7e34);
    border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-outline-primary {
    border: 2px solid #007bff;
    color: #007bff;
}

.btn-outline-primary:hover {
    background: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    transform: translateY(-1px);
}

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

/* Specific styling for disabled save button */
#btn-save-resume:disabled, #btn-save-resume.disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #ffffff;
}

/* Auto-save Status */
/* Auto-save status styles removed - now using Toastify-js */
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading States */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Modal Customization */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

.modal-title {
    color: #495057;
    font-weight: 600;
}

/* Input Groups */
.input-group .btn {
    border-radius: 0 8px 8px 0;
}

.input-group .form-control {
    border-radius: 8px 0 0 8px;
}

/* Input Group Button Alignment Fix */
.input-group .btn {
    height: calc(1.5em + 1.5rem + 4px); /* Match form-control height exactly */
    padding: 0.75rem 1rem; /* Adjust padding for alignment */
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group .form-control {
    height: calc(1.5em + 1.5rem + 4px); /* Explicit height for consistency */
}

/* Modal input group styling */
.modal .input-group .btn {
    border: 2px solid #e9ecef;
    border-left: none;
    background: #f8f9fa;
    color: #495057;
    font-size: 1rem;
    min-width: 48px;
    padding: 0.75rem 0.75rem;
}

.modal .input-group .btn:hover {
    background: #e9ecef;
    border-color: #007bff;
    color: #007bff;
}

.modal .input-group .form-control:focus + .btn {
    border-color: #007bff;
}

/* Responsive Design */
@media (max-width: 576px) {
    .wizard-content .card-body {
        padding: 1rem;
    }
    
    .wizard-navigation {
        padding: 1rem 0;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .step-title {
        font-size: 1.25rem;
    }
    
    .step-description {
        font-size: 0.875rem;
    }
}

/* Custom Checkbox and Radio Styling */
.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.form-check-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

/* Address Fields Styling */
.address-group {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #007bff;
}

/* Same Address Checkbox */
.same-address-check {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 2px solid #bbdefb;
}

/* Country/State Dependent Fields */
.dependent-field {
    transition: all 0.3s ease;
}

.dependent-field.hidden {
    opacity: 0;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Success States */
.step-completed {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-left: 4px solid #28a745;
}

/* Review Step Styling */
.review-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.review-section h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.review-section h5 i {
    margin-right: 0.5rem;
    color: #007bff;
}

.review-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.review-item:last-child {
    border-bottom: none;
}

.review-label {
    font-weight: 500;
    color: #6c757d;
}

.review-value {
    color: #495057;
    text-align: right;
}

/* Modern Date Input Styling */
.input-group input[type="date"] {
    position: relative;
}

.input-group input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.input-group-text .fa-calendar-alt {
    color: #007bff;
    pointer-events: none;
}

/* Date input focus styling */
.input-group input[type="date"]:focus + .input-group-append .input-group-text {
    border-color: #007bff;
    color: #007bff;
}

/* Signature Pad Styles */
.signature-pad-container {
    position: relative;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.signature-canvas {
    width: 100%;
    height: 200px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: #fafafa;
    cursor: crosshair;
    touch-action: none;
}

.signature-canvas:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.signature-canvas.signing {
    border-color: #28a745;
    background: #f8fff9;
}

.signature-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.signature-controls .btn {
    border-radius: 6px;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.signature-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#signature-status {
    font-size: 0.875rem;
    font-style: italic;
}

#signature-status.signed {
    color: #28a745 !important;
}

#signature-status.empty {
    color: #dc3545 !important;
}

/* Responsive signature pad */
@media (max-width: 576px) {
    .signature-canvas {
        height: 150px;
    }
    
    .signature-pad-container {
        padding: 0.75rem;
    }
    
    .signature-controls {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .signature-controls .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* High DPI support */
@media (min-resolution: 2dppx) {
    .signature-canvas {
        /* High DPI handling will be done in JavaScript */
    }
}

/* Print Styles */
@media print {
    .wizard-navigation,
    .wizard-progress {
        display: none !important;
    }
    
    .wizard-content .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .signature-controls {
        display: none !important;
    }
}