/* Tender Creation Wizard - Fullscreen Multi-Step Form */

/* Hide default footer on wizard page */
.tender-wizard ~ footer,
body:has(.tender-wizard) footer {
    display: none;
}

/* Main wizard container */
.tender-wizard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

/* Wizard Header */
.wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 101;
}

.wizard-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #6c757d;
    border-radius: 50%;
    transition: all 0.2s;
    text-decoration: none;
}

.wizard-cancel:hover {
    background: #f3f4f6;
    color: #000;
}

.wizard-cancel i {
    font-size: 1.125rem;
}

.wizard-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #000;
    letter-spacing: -0.01em;
}

.wizard-header-spacer {
    width: 36px;
}

/* Progress Bar */
.wizard-progress {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 0;
    position: sticky;
    top: 54px; /* Below wizard header */
    z-index: 100;
}

.wizard-progress-inner {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 2rem;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    position: relative;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.progress-step.active .step-number,
.progress-step.completed .step-number {
    background: #000;
    color: #fff;
}

.progress-step.completed .step-number::after {
    content: '✓';
    font-size: 0.625rem;
}

.progress-step.completed .step-number {
    font-size: 0;
}

.step-label {
    font-size: 0.6875rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: color 0.3s ease;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
    color: #000;
}

.progress-bar {
    height: 2px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #000;
    transition: width 0.4s ease;
}

/* Wizard Steps */
.wizard-step {
    display: none;
    flex: 1;
    padding: 4rem 2rem 10rem;
}

.wizard-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.step-content {
    max-width: 600px;
    margin: 0 auto;
}

.step-header {
    margin-bottom: 2.5rem;
    padding-top: 3rem;
    text-align: center;
}

.step-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

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

/* Form Elements */
.tender-wizard .form-group {
    margin-bottom: 2rem;
}

.tender-wizard label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 0.5rem;
}

/* AI Enhance row below editor */
.ai-enhance-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 0.75rem;
    gap: 0.75rem;
}

.ai-enhance-row .form-hint {
    margin: 0;
}

.btn-ai {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6c757d;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    width: auto;
}

.btn-ai:hover {
    color: #fff;
    border-color: #000;
    background: #000;
}

.btn-ai:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-ai i {
    font-size: 0.6875rem;
}

.btn-ai.loading {
    pointer-events: none;
}

.btn-ai.loading i {
    animation: spin 1s linear infinite;
}

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

/* AI Status */
.ai-status {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    display: none;
}

.ai-status.loading {
    display: block;
    background: #f0f7ff;
    color: #0066cc;
}

.ai-status.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
}

.ai-status.error {
    display: block;
    background: #ffebee;
    color: #c62828;
}

.tender-wizard label .optional {
    font-weight: 400;
    color: #6c757d;
}

.tender-wizard .form-hint {
    font-size: 0.8125rem;
    color: #6c757d;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.tender-wizard input[type="text"],
.tender-wizard input[type="number"],
.tender-wizard input[type="date"],
.tender-wizard textarea,
.tender-wizard select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 1px solid #dee2e6;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tender-wizard input:focus,
.tender-wizard textarea:focus,
.tender-wizard select:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.tender-wizard textarea {
    resize: vertical;
    min-height: 150px;
}

/* Quill Editor Styling */
#editor-container {
    background: #fff;
    border: 1px solid #dee2e6;
    min-height: 250px;
}

#editor-container .ql-editor {
    min-height: 200px;
    font-size: 1rem;
    line-height: 1.6;
}

#editor-container .ql-editor.ql-blank::before {
    color: #adb5bd;
    font-style: normal;
}

.tender-wizard .ql-toolbar {
    border: 1px solid #dee2e6;
    border-bottom: none;
    background: #f8f9fa;
}

.tender-wizard .ql-container {
    border: none;
    font-family: inherit;
}

.tender-wizard .ql-editor:focus {
    outline: none;
}

#editor-container:focus-within {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.tender-wizard .ql-toolbar:has(+ .ql-container .ql-editor:focus) {
    border-color: #000;
}

.tender-wizard .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Input with prefix */
.tender-wizard .input-group {
    display: flex;
    align-items: stretch;
}

.tender-wizard .input-prefix {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-right: none;
    color: #6c757d;
    font-weight: 500;
}

.tender-wizard .input-group input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Category Pills */
.tender-wizard .pill-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tender-wizard .pill {
    padding: 0.75rem 1.25rem;
    border: 1px solid #dee2e6;
    background: #fff;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.tender-wizard .pill:hover {
    border-color: #000;
}

.tender-wizard .pill.selected {
    background: #000;
    color: #fff;
    border-color: #000;
}

.tender-wizard .pill.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Location Pills */
.location-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.location-pill {
    cursor: pointer;
}

.location-pill input {
    display: none;
}

.location-pill span {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    border: 1px solid #dee2e6;
    background: #fff;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.location-pill:hover span {
    border-color: #000;
}

.location-pill input:checked + span {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* File Upload */
.tender-wizard .file-upload-area {
    border: 2px dashed #dee2e6;
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.tender-wizard .file-upload-area:hover {
    border-color: #000;
    background: #fafafa;
}

/* Confidential files styling */
.confidential-files-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.confidential-files-section label i {
    margin-right: 0.5rem;
    color: #6c757d;
}

.tender-wizard .file-upload-area.confidential {
    border-color: #ffc107;
    background: #fffdf5;
}

.tender-wizard .file-upload-area.confidential:hover {
    border-color: #e0a800;
    background: #fff9e6;
}

.tender-wizard .file-upload-area.confidential i {
    color: #c79100;
}

.tender-wizard .file-upload-area i {
    font-size: 2rem;
    color: #adb5bd;
    margin-bottom: 0.75rem;
    display: block;
}

.tender-wizard .file-upload-area span {
    color: #6c757d;
    font-size: 0.9375rem;
}

.tender-wizard .file-list {
    margin-top: 1rem;
}

.tender-wizard .file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8f9fa;
    margin-bottom: 0.5rem;
}

.tender-wizard .file-item .file-name {
    font-size: 0.875rem;
    color: #000;
}

.tender-wizard .file-item .file-remove {
    color: #dc3545;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.tender-wizard .file-item .file-view {
    color: #0066cc;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
}

.tender-wizard .file-item .file-view:hover {
    text-decoration: underline;
}

.tender-wizard .file-item.existing {
    background: #e8f4f8;
    border-left: 3px solid #0066cc;
}

.tender-wizard .file-item.confidential {
    background: #fffdf5;
    border-left: 3px solid #ffc107;
}

.tender-wizard .file-item.confidential.existing {
    background: #fff9e6;
}

.tender-wizard .file-item.confidential i {
    color: #c79100;
}

/* Review Section */
.review-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.review-card {
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 1.5rem;
}

.review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.review-card-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #000;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.edit-link {
    background: none;
    border: none;
    color: #0066cc;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
}

.edit-link:hover {
    text-decoration: underline;
}

.review-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.review-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.review-value {
    font-size: 0.9375rem;
    color: #000;
}

.review-description {
    white-space: pre-wrap;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status Options - using toggle switch style */
.publish-options {
    margin-top: 2rem;
}

.publish-options .toggle-switch-group {
    margin-bottom: 0;
}

.publish-options .toggle-option label {
    min-width: 140px;
    text-align: center;
}

/* Navigation */
.wizard-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e9ecef;
    padding: 1rem 0;
    z-index: 100;
}

.wizard-nav-inner {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-wizard {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-wizard:hover {
    border-color: #000;
}

.btn-wizard.btn-primary {
    background: #000;
    color: #fff;
    border-color: #000;
}

.btn-wizard.btn-primary:hover {
    background: #333;
}

.btn-wizard:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error states */
.tender-wizard .is-invalid {
    border-color: #dc3545 !important;
}

#editor-container.is-invalid {
    border-color: #dc3545 !important;
}

#editor-container.is-invalid + .ql-toolbar {
    border-color: #dc3545 !important;
}

.tender-wizard .error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 1rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .wizard-header {
        padding: 0.75rem 1rem;
    }
    
    .wizard-progress {
        top: 50px; /* Adjust for smaller header */
        padding: 0.5rem 0;
    }
    
    .wizard-progress-inner {
        padding: 0 1rem;
    }
    
    .step-label {
        font-size: 0.5625rem;
    }
    
    .step-number {
        width: 22px;
        height: 22px;
        font-size: 0.6875rem;
    }
    
    .wizard-step {
        padding: 3rem 1rem 8rem;
    }
    
    .step-header h1 {
        font-size: 1.5rem;
    }
    
    .tender-wizard .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .wizard-nav-inner {
        padding: 0 1rem;
    }
    
    .btn-wizard {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .location-pills {
        gap: 0.5rem;
    }
    
    .location-pill span {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .step-label {
        display: none;
    }
    
    .progress-steps {
        justify-content: center;
        gap: 2rem;
    }
}

/* Locked Tender State */
.locked-tender-container {
    min-height: calc(100vh - 54px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #fafafa;
}

.locked-tender-card {
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 3rem;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.locked-icon {
    width: 64px;
    height: 64px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.locked-icon i {
    font-size: 1.5rem;
    color: #6c757d;
}

.locked-tender-card h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #000;
}

.locked-tender-card .tender-status-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.locked-tender-card .status-draft {
    background: #e9ecef;
    color: #495057;
}

.locked-tender-card .status-open {
    background: #d4edda;
    color: #155724;
}

.locked-tender-card .status-closed {
    background: #fff3cd;
    color: #856404;
}

.locked-tender-card .status-awarded {
    background: #cce5ff;
    color: #004085;
}

.locked-tender-card .status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.lock-reason {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.tender-summary {
    background: #f8f9fa;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

.summary-label {
    color: #6c757d;
    font-size: 0.875rem;
}

.summary-value {
    font-weight: 500;
    color: #000;
    font-size: 0.875rem;
}

.locked-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.locked-actions .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
}

.btn-danger-outline {
    color: #dc3545;
    border-color: #dc3545;
    background: transparent;
}

.btn-danger-outline:hover {
    background: #dc3545;
    color: #fff;
}

@media (max-width: 768px) {
    .locked-tender-card {
        padding: 2rem 1.5rem;
    }
}
