/* ==================================================
   EDIT TEXT CONTENT MODAL STYLES - Company Intro Page Specific
   ==================================================

   This file contains SPECIFIC styles for the Edit Text Content Modal
   (#editTextModal) used on the company intro page. It inherits base
   modal styles from ../shared/modals.css and adds text editing
   specific functionality.

   IMPORTANT: This file works WITH modals.css, not instead of it!

   Features:
   - Multi-step text editing form
   - Progress indicator with steps
   - Company information editing
   - Services and approach editing
   - Proposal content editing
   - Form validation and styling
   - Professional text editing interface

   Last Updated: [Current Date]
   ================================================== */

/* ==================================================
   1. EDIT TEXT MODAL Z-INDEX (Required for proper layering)
   ================================================== */

#editTextModal {
    z-index: 10000 !important;
}

#editTextModal .modal-dialog {
    z-index: 10000 !important;
}

#editTextModal .modal-content {
    z-index: 10000 !important;
}

/* ==================================================
   2. EDIT TEXT MODAL LAYOUT & STRUCTURE
   ================================================== */

/* Edit Text Modal Dialog */
#editTextModal .modal-dialog {
    max-width: 700px; /* Increased from 550px for better text editing space */
    max-height: 90vh;
    margin: 80px auto 20px auto !important; /* Consistent top positioning */
    align-items: flex-start !important;
    min-height: auto !important;
}

/* Edit Text Modal Content - Shared Styling */
#editTextModal .modal-content {
    background: linear-gradient(135deg, #ffffff, #f0f4f8) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
    border: 1px solid #e0e4e8 !important;
    overflow: hidden !important;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

/* Edit Text Modal Header - classic gray */
#editTextModal .modal-header {
    background: #e5e7eb !important;
    color: #374151 !important;
    padding: 10px 16px !important;
    border-bottom: 1px solid #d1d5db !important;
    box-shadow: none !important;
    border-radius: 16px 16px 0 0 !important;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Edit Text Modal Header Content */
#editTextModal .modal-header .header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

/* Edit Text Modal Header Icon */
#editTextModal .modal-header .header-icon {
    font-size: 20px !important;
    opacity: 0.9;
    color: #4b5563;
}

/* Edit Text Modal Header Text */
#editTextModal .modal-header .header-text {
    flex: 1;
    position: relative;
}

/* Edit Text Modal Title Main */
#editTextModal .modal-header .title-main {
    display: block;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-bottom: 2px !important;
    color: #1f2937;
    letter-spacing: -0.3px;
    line-height: 1.3;
    position: relative;
}

/* Edit Text Modal Title Subtitle */
#editTextModal .modal-header .title-subtitle {
    display: block;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    letter-spacing: 0.2px;
    line-height: 1.35;
    position: relative;
    padding-left: 18px;
    opacity: 1 !important;
}

/* Decorative accent line before subtitle */
#editTextModal .modal-header .title-subtitle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 1.5px;
    background: #9ca3af;
    border-radius: 2px;
}

/* Edit Text Modal Close Button */
#editTextModal .modal-header .close {
    color: #6b7280 !important;
    opacity: 0.9;
    font-size: 20px;
    padding: 4px;
    margin: -4px -4px 0 0;
    background: #d1d5db;
    border: 1px solid #9ca3af;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
}

#editTextModal .modal-header .close:hover {
    opacity: 1;
    background: #e5e7eb;
    color: #374151 !important;
}

#editTextModal .modal-header .close:focus {
    outline: none;
    box-shadow: 0 0 0 2px #9ca3af;
}

/* Edit Text Modal Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes lineExpand {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 16px;
        opacity: 1;
    }
}

@keyframes closeButtonFloat {
    0%, 100% { 
        transform: translateY(0) translateZ(0);
    }
    50% { 
        transform: translateY(-2px) translateZ(5px);
    }
}

/* Edit Text Modal Body */
#editTextModal .modal-body {
    padding: 8px 12px !important;
    background-color: #ffffff !important;
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

/* Edit Text Modal Footer - Match Cover Image Manager */
#editTextModal .modal-footer {
    background-color: #f1f5f9 !important;
    padding: 6px 12px !important;
    border-top: 1px solid #e0e4e8 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    flex-shrink: 0;
}

/* ==================================================
   3. PROGRESS STEPS STYLING
   ================================================== */

/* Progress Steps Container - Simple matching */
#editTextModal .progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    margin-bottom: 8px;
    padding: 8px 30px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

/* Remove all lines */
#editTextModal .progress-steps::before,
#editTextModal .progress-steps::after {
    display: none !important;
    content: none !important;
}

#editTextModal .step {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

/* Remove any connector lines */
#editTextModal .step:not(:last-child)::after,
#editTextModal .step::before {
    display: none !important;
    content: none !important;
}

#editTextModal .step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: #64748b;
    transition: all 0.3s ease;
}

#editTextModal .step.active .step-number {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

#editTextModal .step.completed .step-number {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

/* Hide step labels */
#editTextModal .step-label {
    display: none;
}

/* ==================================================
   4. FORM STEPS STYLING
   ================================================== */

/* Text Edit Form Container - Match Company Info container */
#text-edit-form,
.customer-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.05);
    position: relative;
}

/* Individual Form Step */
.form-step {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.form-step.active {
    display: block;
}

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

/* Step Header */
.step-header {
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

.step-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1px;
}

.step-header h6 {
    color: #374151;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.step-header h6 i {
    color: #667eea;
    width: 20px;
}

/* ==================================================
   5. CONTACT OPTIONS (FIELD CONTAINERS)
   ================================================== */

/* Contact Option Container - Match Company Info styling */
#editTextModal .contact-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 8px;
    margin-bottom: 8px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#editTextModal .contact-option:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

#editTextModal .contact-option:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Step-specific field styling with colored left border - Match Company Info colors */
/* Step 1: Company Introduction Field - Purple */
#editTextModal .step1-company-field {
    border-left: 4px solid #667eea;
}

/* Step 2: Services Field - Orange */
#editTextModal .step2-services-field {
    border-left: 4px solid #f59e0b;
}

/* Step 2: Proposal Field - Cyan */
#editTextModal .step2-proposal-field {
    border-left: 4px solid #06b6d4;
}

/* Character counter */
#editTextModal .char-counter {
    font-size: 11px;
    color: #6b7280;
    text-align: right;
    margin-top: 4px;
}

/* Focus effect bottom line - Match Company Info */
#editTextModal .contact-option::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 1px;
}

#editTextModal .contact-option:focus-within::after {
    width: 100%;
}

/* ==================================================
   6. OPTION HEADER & LABELS
   ================================================== */

/* Option Header */
.option-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

/* Option Label - Match Company Info labels */
.option-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: color 0.3s ease;
    margin-bottom: 6px;
}

.option-label i {
    width: 16px;
    font-size: 14px;
    flex-shrink: 0;
}

/* Match icon colors to border colors */
#editTextModal .step1-company-field .option-label i {
    color: #667eea;
}

#editTextModal .step1-approach-field .option-label i {
    color: #10b981;
}

#editTextModal .step2-services-field .option-label i {
    color: #f59e0b;
}

#editTextModal .step2-proposal-field .option-label i {
    color: #06b6d4;
}

/* Focus state label color */
#editTextModal .contact-option:focus-within .option-label {
    color: #667eea;
}

/* Required Indicator */
.required {
    color: #ef4444;
    font-weight: 700;
    margin-left: 4px;
}

/* Option Description */
.option-description {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 8px;
    font-style: italic;
    padding-left: 26px;
}

/* ==================================================
   7. FORM GROUPS & INPUT STYLING
   ================================================== */

/* Customer Form Group */
.customer-form-group {
    position: relative;
    margin-bottom: 0;
}

/* Customer Input Fields - Match Company Info inputs */
.customer-input {
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
    color: #374151;
    background: #ffffff;
    transition: all 0.3s ease;
    font-weight: 500;
    resize: vertical;
    min-height: 35px;
}

.customer-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    background: #fafbff;
}

.customer-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Textarea specific styling */
.customer-input[rows] {
    min-height: 50px;
    line-height: 1.4;
}

/* Input Focus Border Effect */
.input-focus-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.customer-input:focus + .input-focus-border {
    width: 100%;
}

/* Form Text Help - Uses centralized styles from modals.css */
.form-text {
    margin-top: 10px !important; /* Consistent with all modals */
    margin-bottom: 0;
    padding: 6px 10px;
    background: linear-gradient(135deg, #f8faff 0%, #e6f0fa 100%);
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.form-text i {
    color: #667eea;
    width: 14px;
}

/* ==================================================
   8. MODAL FOOTER BUTTONS - CENTRALIZED STYLING
   ================================================== */

/* All button styles are centralized in ../../shared/button-styles.css */
/* This ensures consistent button styling across ALL modals */

/* Disabled state override */
#editTextModal .modal-footer .btn:disabled {
    background: #cccccc !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ==================================================
   9. STEP NAVIGATION BUTTONS
   ================================================== */

/* Step Navigation Container */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.step-navigation .btn {
    min-width: 120px;
}

/* Previous/Next Button Styling */
.btn-step-nav {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #374151;
    border: 2px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-step-nav:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.btn-step-nav:disabled {
    background: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==================================================
   10. VALIDATION STATES
   ================================================== */

/* Valid Input State */
.customer-input.valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.customer-input.valid + .input-focus-border {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Invalid Input State */
.customer-input.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.customer-input.invalid + .input-focus-border {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Validation Message */
.validation-message {
    font-size: 12px;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.validation-message.error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.validation-message.success {
    color: #059669;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.validation-message i {
    width: 14px;
}

/* ==================================================
   11. RESPONSIVE DESIGN
   ================================================== */

/* Tablet responsiveness */
@media (max-width: 768px) {
    #editTextModal .modal-header {
        padding: 10px 14px !important;
    }
    
    #editTextModal .modal-header .header-icon {
        font-size: 18px !important;
    }
    
    #editTextModal .modal-header .title-main {
        font-size: 15px !important;
    }
    
    #editTextModal .modal-header .title-subtitle {
        font-size: 11px !important;
        padding-left: 16px;
    }
    
    #editTextModal .modal-header .title-subtitle::before {
        width: 10px;
    }
    
    #editTextModal .modal-header .close {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
    
    #editTextModal .modal-dialog {
        max-width: 95vw;
        margin: 10px;
    }

    #editTextModal .modal-body {
        padding: 20px 15px !important;
    }

    #editTextModal .progress-steps {
        padding: 15px 30px;
        margin-bottom: 20px;
        justify-content: space-between;
        gap: 0;
    }

    .progress-steps::before {
        left: 40px;
        right: 40px;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .step-label {
        font-size: 11px;
    }

    .contact-option {
        padding: 15px;
        margin-bottom: 15px;
    }

    .option-description {
        padding-left: 25px;
    }

    .step-header h6 {
        font-size: 1.1rem;
    }

    .step-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .step-navigation .btn {
        width: 100%;
        min-width: auto;
    }
}

/* Mobile responsiveness */
@media (max-width: 576px) {
    #editTextModal .modal-header {
        padding: 10px 12px !important;
    }
    
    #editTextModal .modal-header .header-icon {
        font-size: 18px !important;
    }
    
    #editTextModal .modal-header .title-main {
        font-size: 15px !important;
    }
    
    #editTextModal .modal-header .title-subtitle {
        font-size: 11px !important;
        padding-left: 16px;
    }
    
    #editTextModal .modal-header .title-subtitle::before {
        width: 10px;
        height: 1.5px;
    }
    
    #editTextModal .modal-header .close {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
    
    #editTextModal .modal-dialog {
        max-width: 98vw;
        margin: 5px;
    }

    #editTextModal .modal-body {
        padding: 15px 12px !important;
        min-height: 300px;
    }

    #editTextModal .modal-footer {
        padding: 15px !important;
        flex-direction: column;
        gap: 10px;
    }

    #editTextModal .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    #editTextModal .progress-steps {
        padding: 12px 20px;
        margin-bottom: 15px;
        justify-content: space-between;
        gap: 0;
    }

    .progress-steps::before {
        left: 30px;
        right: 30px;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 12px;
        margin-bottom: 6px;
    }

    .step-label {
        font-size: 10px;
    }

    .contact-option {
        padding: 12px;
        margin-bottom: 12px;
    }

    .option-label {
        font-size: 14px;
        gap: 8px;
    }

    .option-description {
        padding-left: 22px;
        font-size: 13px;
    }

    .customer-input {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .step-header h6 {
        font-size: 1rem;
        gap: 8px;
    }
}

/* ==================================================
   12. ACCESSIBILITY & FOCUS STATES
   ================================================== */

/* Enhanced focus states for accessibility */
.customer-input:focus,
.btn-step-nav:focus,
.option-label:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .contact-option,
    .progress-steps {
        border-width: 2px;
    }

    .step-number {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #editTextModal .modal-header .title-main,
    #editTextModal .modal-header .title-subtitle {
        animation: none;
    }
    
    #editTextModal .modal-header .title-subtitle::before {
        animation: none;
        width: 16px;
        opacity: 1;
    }
    
    #editTextModal .modal-header .close {
        animation: none;
    }
    
    .contact-option,
    .customer-input,
    .step-number,
    .btn-step-nav,
    .form-step {
        transition: none;
        animation: none;
    }

    .contact-option:hover,
    .btn-step-nav:hover {
        transform: none;
    }

    @keyframes fadeInUp {
        from, to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ==================================================
   13. PRINT STYLES
   ================================================== */

@media print {
    #editTextModal {
        display: none !important;
    }
}
