/* Styles specific to the SetupWizard section */
.setup-wizard-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e0f2fe; /* Changed to a solid light background color */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    /* backdrop-filter: blur(5px); -- REMOVED this line */
    padding: 20px;
    box-sizing: border-box;
}

.wizard-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 800px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.3s, box-shadow 0.3s;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* NEW: Styles for the intro section containing logo, h1, p */
.wizard-intro-section {
    text-align: center;
    margin-bottom: 50px; /* Increased space below the intro section for buffer */
    width: 100%; /* Ensure it takes full width for centering */
}

/* New: Progress Bar Container */
.progress-container {
    width: 90%; /* Wider to accommodate labels */
    height: 8px; /* Height of the bar */
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 60px; /* Increased space below the progress bar */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0; /* Remove padding to make lines flush */
    box-sizing: border-box;
}

/* New: Actual Progress Bar Fill */
.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #34d399, #10b981); /* Green gradient for completed */
    border-radius: 4px;
    width: 0%; /* Starts empty */
    transition: width 0.5s ease-in-out; /* Smooth transition for width change */
    z-index: 1; /* Below step items */
}

/* New: Wrapper for step items to control their layout */
.step-indicators-wrapper {
    display: flex;
    justify-content: space-between;
    width: 100%;
    position: absolute; /* Position relative to .progress-container */
    top: 50%;
    transform: translateY(-50%);
    z-index: 2; /* Above the progress bar */
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1; /* Distribute space evenly */
    position: relative; /* For connector lines and status text */
    padding: 0 10px; /* Padding for text content */
    box-sizing: border-box;
}

/* Connector Lines - Fix: Adjusted left and width calculation */
.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px; /* Half height of circle */
    left: calc(50% + 15px); /* Start after the current circle's center + half its width */
    width: calc(100% - 30px); /* Span the full width of the gap between circles minus the circles' width */
    height: 3px;
    background-color: #e0e0e0; /* Inactive line color */
    /* Removed transform as it's no longer needed with corrected left/width */
    transition: background-color 0.5s ease-in-out;
    z-index: -1; /* Behind circles */
}


/* Active/Completed Connector Lines */
.step-item.active:not(:last-child)::after,
.step-item.completed:not(:last-child)::after {
    background: linear-gradient(90deg, #34d399, #10b981); /* Green gradient for active/completed lines */
}


.step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e5e7eb; /* Inactive circle color */
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
    z-index: 3; /* Above everything */
    border: 3px solid transparent; /* Transparent border by default */
    margin-bottom: 10px; /* Space between circle and label */
    position: relative; /* For checkmark icon */
}

/* Active Step Circle */
.step-circle.active {
    background: white; /* White background for active circle */
    border-color: #2563eb; /* Blue border for active circle */
    color: #2563eb; /* Blue number for active circle */
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    transform: scale(1.1);
}

/* Completed Step Circle */
.step-circle.completed {
    background: #10b981; /* Green background for completed circle */
    color: white;
    border-color: #10b981; /* Green border for completed circle */
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Checkmark for completed steps */
.step-circle.completed::before {
    content: '\2713'; /* CORRECTED: This is the proper CSS code for a checkmark */
    position: absolute;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}
/* Hide number when checkmark is present */
.step-circle.completed {
    font-size: 0; /* Hide number */
}


/* New: Step Labels */
.step-label {
    font-size: 1rem;
    font-weight: 600;
    color: #4b5563; /* Default label color */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s;
    margin-bottom: 4px; /* Space between label and status */
}

/* New: Step Status (Completed, In Progress, Pending) */
.step-status {
    font-size: 0.85rem;
    font-weight: 500;
    color: #9ca3af; /* Default status color */
    transition: color 0.3s;
}

/* Status specific colors */
.step-item.completed .step-label,
.step-item.completed .step-status {
    color: #10b981; /* Green for completed text */
}

.step-item.active .step-label,
.step-item.active .step-status {
    color: #2563eb; /* Blue for active text */
}


#wizardStep1, #wizardStep2, #wizardStep3 {
    width: 100%;
}

.wizard-content .form-group {
    width: 100%;
    text-align: left;
    margin-bottom: 25px;
}
.wizard-content .label {
    text-align: left;
    width: 100%;
    display: block;
}
.wizard-content h2 {
    margin-bottom: 25px; /* Ensure sufficient space below h2 */
    width: 100%;
    text-align: left;
}
/* Adjust margin and font for h1 specifically within the wizard intro */
.wizard-intro-section h1 {
    margin-top: 25px !important; /* More space above h1 */
    margin-bottom: 10px !important; /* Less space below h1, more for p */
    text-align: center; /* Ensure it remains centered */
    font-size: 1.1rem; /* Match font size of p */
    font-weight: 600; /* Make it bold */
}
/* Increased font-size and margin-bottom for p tags (intro text) */
.wizard-intro-section p {
    width: 100%;
    text-align: center;
    font-size: 1.1rem; /* Increased font size for better readability */
    font-weight: 500; /* Adjusted to NOT be bold */
    color: #6b7280; /* Default color for light theme */
    margin-bottom: 30px; /* Space below this paragraph */
}

/* Styles for the logo upload area */
.logo-upload-area {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-height: 120px;
    gap: 10px;
    position: relative; /* Essential for positioning the clear button */
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 30px; /* Increased space below logo upload area */
}
.logo-upload-area:hover {
    background: #e0f2fe;
    border-color: #60a5fa;
}
.logo-upload-area.drag-over {
    background: #dbeafe;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4);
}
.logo-upload-area .uploaded-logo { /* Corrected class name here */
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
    border-radius: 8px;
}
.logo-upload-area .default-icon {
    font-size: 2em; /* Adjusted to 2em, was 32px */
    color: #3b82f6;
    transition: color 0.3s;
}
.logo-upload-area .upload-text {
    font-size: 0.9rem;
    color: #6b7280;
    transition: color 0.3s;
}

/* NEW: Styles for the Clear Logo Button */
.clear-logo-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(239, 68, 68, 0.8); /* Red background with some transparency */
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    opacity: 0; /* Hidden by default */
    visibility: hidden; /* Hidden by default */
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 10; /* Ensure it's above the image */
}

/* Show the clear button on hover of the logo upload area */
.logo-upload-area:hover .clear-logo-btn {
    opacity: 1;
    visibility: visible;
}

/* Hide the clear button if the default icon is visible (meaning no logo is uploaded) */
.logo-upload-area:has(.default-icon:not(.hidden)) .clear-logo-btn {
    opacity: 0;
    visibility: hidden;
}

/* Dark Theme for Clear Logo Button */
body.dark-theme .clear-logo-btn {
    background-color: rgba(220, 38, 38, 0.9); /* Slightly darker red for dark theme */
}


/* Specific styles for multi-select dropdown */
.multi-select-container {
    position: relative;
}
.multi-select-dropdown {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px;
    max-height: 150px;
    overflow-y: auto;
    background-color: white;
    position: absolute;
    width: 100%;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.multi-select-dropdown label {
    display: block;
    padding: 6px 10px;
    cursor: pointer;
}
.multi-select-dropdown label:hover {
    background-color: #f3f4f6;
    transition: background-color 0.3s;
}
.multi-select-dropdown input[type="checkbox"] {
    margin-right: 8px;
}
.selected-trades-display {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    min-height: 40px;
    cursor: pointer;
    background-color: white;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    transition: background-color 0.3s, border-color 0.3s;
}
.selected-trade-tag {
    background-color: #e0f2fe;
    color: #1e40af;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.3s, color 0.3s;
}
.selected-trade-tag .remove-tag {
    cursor: pointer;
    font-weight: bold;
    color: #94a3b8;
    transition: color 0.3s;
}

/* Styles for dynamic labor rate inputs in wizard */
.trade-labor-rates-group {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #fcfcfc;
    transition: background-color 0.3s, border-color 0.3s;
}
.trade-labor-rates-group h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.25rem;
    color: #1f2937;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
    transition: color 0.3s, border-color 0.3s;
}

.skill-level-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px; /* Maintain gap between elements */
    padding-bottom: 10px;
    border-bottom: 1px dashed #e5e7eb;
    justify-content: space-between; /* Keep space-between */
    transition: border-color 0.3s;
}
.skill-level-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.skill-name-display {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
    flex-basis: 160px; /* Give it a base width */
    flex-grow: 1;      /* Allow it to grow */
    flex-shrink: 1;    /* Allow it to shrink */
    min-width: 0;      /* Crucial for shrinking flex items */
    white-space: nowrap; /* Keep on one line */
    overflow: hidden;    /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for hidden text */
    transition: color 0.3s;
}

.rate-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1; /* Allows the group to take available space */
    justify-content: flex-end;
    min-width: 0; /* Ensures the group can shrink */
}
.rate-label {
    white-space: nowrap;
    font-weight: 600;
    color: #4b5563;
    font-size: 15px;
    margin-right: 0;
    flex-shrink: 0; /* Prevent label from shrinking */
    min-width: fit-content; /* Make sure label takes its necessary width */
    transition: color 0.3s;
}
.rate-input {
    width: 100px;
    flex-shrink: 0;
}
.skill-name-input.editable {
    width: 150px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.3s, color 0.3s;
    flex-shrink: 0;
    box-sizing: border-box;
}
.skill-name-input.editable:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

.remove-skill-btn {
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
    margin-bottom: 0;
    margin-left: 0;
    position: static;
    top: auto;
}
.remove-skill-btn:hover {
    background-color: #dc2626;
}

.advanced-link-wrapper {
    width: 100%;
    text-align: left;
    margin-top: 20px;
}
.advanced-link {
    color: #2563eb;
    text-decoration: underline;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.2s ease;
}
.advanced-link:hover {
    color: #1D4ED8;
}

/* Dark Theme Specifics for Wizard Elements */
body.dark-theme .setup-wizard-container {
    background: #1a202c; /* Changed to a solid dark background color */
}
body.dark-theme .wizard-content {
    background: #2d3748;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

/* Dark Theme for New Progress Bar */
body.dark-theme .progress-container {
    background-color: #4a5568;
}

body.dark-theme .progress-bar {
    background: linear-gradient(90deg, #34d399, #10b981); /* Green gradient for dark theme */
}

body.dark-theme .step-circle {
    background: #6b7280; /* Inactive circle in dark theme */
    color: #e2e8f0;
    border-color: #2d3748; /* Dark border for dark theme circles */
}
body.dark-theme .step-circle.active {
    background: #2d3748; /* Active circle background in dark theme */
    border-color: #4299e1; /* Active circle border in dark theme */
    color: #4299e1; /* Active number in dark theme */
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.4);
}
body.dark-theme .step-circle.completed {
    background: #065f46; /* Darker green for completed in dark theme */
    border-color: #065f46;
}


body.dark-theme .wizard-content h1,
body.dark-theme .wizard-content h2,
body.dark-theme .wizard-content h4,
body.dark-theme .wizard-content .label {
    color: #e2e8f0;
}
/* NEW: Dark theme for the intro section paragraph */
body.dark-theme .wizard-intro-section p {
    color: #a0aec0; /* Lighter grey for dark theme intro text */
}

body.dark-theme .wizard-content .input-field {
    background-color: #4a5568;
    border-color: #4a5568;
    color: #e2e8f0;
}
body.dark-theme .input-field:focus {
    border-color: #63b3ed;
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.3);
}
body.dark-theme .selected-trades-display,
body.dark-theme .multi-select-dropdown {
    background-color: #4a5568;
    border-color: #4a5568;
}
body.dark-theme .selected-trade-tag {
    background-color: #4299e1;
    color: white;
}
body.dark-theme .selected-trade-tag .remove-tag {
    color: #a0aec0;
}
body.dark-theme .multi-select-dropdown label:hover {
    background-color: #2d3748;
}
body.dark-theme .trade-labor-rates-group {
    background-color: #2d3748;
    border-color: #4a5568;
}
body.dark-theme .trade-labor-rates-group h3 {
    border-color: #4a5568;
}
body.dark-theme .skill-level-row {
    border-color: #4a5568;
}
body.dark-theme .advanced-link {
    color: #63b3ed;
}
body.dark-theme .advanced-link:hover {
    color: #90cdf4;
}
body.dark-theme .logo-upload-area {
    background: #2d3748;
    border-color: #4a5568;
}
body.dark-theme .logo-upload-area:hover {
    background: #4a5568;
    border-color: #63b3ed;
}
body.dark-theme .logo-upload-area.drag-over {
    background: #4a5568;
    border-color: #63b3ed;
    box-shadow: 0 0 0 4px rgba(99, 179, 237, 0.4);
}
body.dark-theme .logo-upload-area .default-icon {
    color: #63b3ed;
}
/* Dark theme for step labels and statuses */
body.dark-theme .step-label,
body.dark-theme .step-status {
    color: #a0aec0;
}
body.dark-theme .step-item.completed .step-label,
body.dark-theme .step-item.completed .step-status {
    color: #10b981; /* Still green for completed */
}
body.dark-theme .step-item.active .step-label,
body.dark-theme .step-item.active .step-status {
    color: #4299e1; /* Blue for active */
}

/* --- NEW/UPDATED STYLES FOR SKILL LEVEL ROW LABELS --- */

/* Ensure skill-name-display and skill-name-input.editable have proper width and no overlap */
.skill-name-display,
.skill-name-input.editable {
    /* Removed flex-basis: 160px; as it was too restrictive and causing overlap */
    flex-grow: 1;      /* Allow it to grow */
    flex-shrink: 1;    /* Allow it to shrink */
    min-width: 0;      /* Crucial for shrinking flex items */
    white-space: nowrap; /* Keep on one line */
    overflow: hidden;    /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for hidden text */
    transition: color 0.3s;
}

/* Hide the rate-label when in advanced mode (skill-name-input is present) */
/* This targets the label within the rate-input-group when the editable input is active */
.skill-level-row .skill-name-input.editable + .rate-input-group .rate-label {
    display: none; /* Hide the label when the editable input is active */
}

/* Hide the rate-label when the skill-name-display (span) is present and not in advanced mode */
/* This is the new rule to fix the overlap in basic mode */
.skill-level-row .skill-name-display + .rate-input-group .rate-label {
    display: none; /* Hide the label when the skill name is a display span */
}


/* Adjust the rate-input width when the label is hidden */
.skill-level-row .skill-name-input.editable + .rate-input-group .rate-input,
.skill-level-row .skill-name-display + .rate-input-group .rate-input { /* Apply to both cases */
    width: 100%; /* Allow the input to take full width if the label is hidden */
    max-width: 150px; /* Maintain a reasonable max-width */
}

/* Ensure the rate-input-group itself behaves correctly */
.rate-input-group {
    display: flex;
    align-items: center;
    gap: 8px; /* Maintain gap for consistency */
    flex-grow: 1; /* Allows the group to take available space */
    justify-content: flex-end; /* Align content to the right */
    min-width: 120px; /* Ensure a minimum width for the rate input group */
}

/* Adjust gap in skill-level-row to be more flexible */
.skill-level-row {
    gap: 10px; /* Slightly reduce gap if needed, or keep 15px if it looks good */
}

/* Ensure remove button doesn't cause overflow */
.remove-skill-btn {
    flex-shrink: 0; /* Prevent shrinking */
    margin-left: 5px; /* Small margin to separate from input */
}

