/* ==================================================
   3. MODAL STYLING (ORGANIZED & SPECIFIC)
   ================================================== */

/* --- 3.1 Modal Container & Structure --- */
/* This styles the main pop-up window */
.modal-content {
    background: linear-gradient(135deg, #ffffff, #f0f4f8);
    border-radius: 16px !important; /* Use !important to override Bootstrap defaults if needed */
    border: 1px solid #e0e4e8;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    overflow: hidden; /* Ensures child elements conform to the rounded corners */
}

/* --- 3.2 Modal Header --- */
/* Classic gray – clean, professional, no flash */
.modal-header {
    background: #e5e7eb;
    color: #374151;
    padding: 20px;
    border-bottom: 1px solid #d1d5db;
    box-shadow: none;
}

.modal-title {
    font-weight: 600;
    font-size: 1.3rem;
}

/* The 'X' close button in the header */
.modal-header .close {
    color: #6b7280;
    font-size: 1.5rem;
    font-weight: bold;
    opacity: 0.8;
    text-shadow: none;
    transition: opacity 0.2s ease;
}
.modal-header .close:hover {
    color: #374151;
    opacity: 1;
}

/* Compact header variant – matches Customer Info, QR Code, Product Inventory */
.modal-header.modal-header-compact {
    padding: 10px 16px !important;
}

.modal-header-compact .header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.modal-header-compact .header-icon {
    font-size: 20px !important;
    color: #4b5563;
    flex-shrink: 0;
}

.modal-header-compact .header-text {
    flex: 1;
    min-width: 0;
}

.modal-header-compact .title-main {
    display: block;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-bottom: 2px !important;
    color: #1f2937;
}

.modal-header-compact .title-subtitle {
    display: block;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    padding-left: 18px;
    position: relative;
}

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

.modal-header-compact .close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #d1d5db;
    border: 1px solid #9ca3af;
    border-radius: 8px;
    margin: -4px -4px 0 0;
}

.modal-header-compact .close:hover {
    background: #e5e7eb;
}

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

/* --- 3.3 Modal Body --- */
/* This styles the main content area of the modal */
.modal-body {
    padding: 25px;
    background-color: #ffffff;
}

/* --- 3.4 Modal Footer --- */
/* This styles the bottom bar with the action buttons */
.modal-footer {
    background-color: #f1f5f9; /* A lighter, cleaner grey */
    padding: 12px 20px;
    border-top: 1px solid #e0e4e8; /* A subtle separator line */
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --- Modal Footer Design System: Clear hierarchy, less confusion --- */
/* Use .modal-footer-structured + .footer-left / .footer-right for grouped layouts */
.modal-footer-structured,
.modal-footer.modal-footer-structured {
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.modal-footer-structured .footer-left,
.modal-footer-structured .footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.modal-footer-structured .footer-left {
    /* Back/Previous, Reset, utility actions */
    order: 1;
}
.modal-footer-structured .footer-right {
    /* Cancel + Primary action – main CTA on far right */
    order: 2;
    margin-left: auto;
}
/* Primary action = btn-success or btn-primary; keep Cancel + Next/Save in natural order */

/* Add/Edit Services & Fees: footer at bottom, Clear left, Cancel + Apply right */
#laborCostModal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
#laborCostModal .modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
#laborCostModal .modal-footer.justify-content-between {
    justify-content: space-between !important;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}
#laborCostModal .modal-footer.justify-content-between > div {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* --- Down Payment & Payment Plan modal: cohesive layout and sections --- */
#downPaymentModal .down-payment-modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
#downPaymentModal .down-payment-modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 20px 24px;
}
#downPaymentModal .down-payment-modal-footer {
    justify-content: space-between !important;
    align-items: center;
    flex-shrink: 0;
}
#downPaymentModal .down-payment-modal-footer .down-payment-footer-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

/* Section blocks: light grouping for a single flow */
#downPaymentModal .down-payment-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
#downPaymentModal .down-payment-section:last-of-type {
    margin-bottom: 0;
}
#downPaymentModal .down-payment-context {
    background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 100%);
    border-color: #c7d2fe;
}
#downPaymentModal .down-payment-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 4px;
}
#downPaymentModal .down-payment-grand-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4338ca;
    margin: 0;
}
#downPaymentModal .down-payment-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
#downPaymentModal .down-payment-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: #6366f1;
    border-radius: 50%;
}
#downPaymentModal .down-payment-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
    display: block;
}
#downPaymentModal .down-payment-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 12px;
}
#downPaymentModal .down-payment-calc-label {
    font-size: 0.875rem;
    color: #64748b;
}
#downPaymentModal .down-payment-calc-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
}
#downPaymentModal .down-payment-balance-row .down-payment-calc-value.down-payment-balance {
    color: #059669;
}
#downPaymentModal .down-payment-plan-toggle .btn {
    font-size: 0.8125rem;
    padding: 8px 14px;
}
#downPaymentModal .down-payment-preview-section .down-payment-section-title {
    margin-bottom: 10px;
}
#downPaymentModal .down-payment-preview-list .list-group-item {
    background: #fff;
    border-radius: 6px;
    margin-bottom: 6px;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
}
#downPaymentModal .down-payment-no-plan {
    font-size: 0.875rem;
    margin: 0;
    padding: 10px 0;
}

/* Smaller footer buttons for compact B2B feel */
.modal-footer .btn {
    padding: 8px 18px !important;
    font-size: 0.875rem !important;
    font-weight: 600;
    border-radius: 6px;
}

/* Clean hover for buttons inside modals: no base .btn gold overlay */
#laborCostModal .btn::before,
#laborCostModal .btn::after,
#downPaymentModal .btn::before,
#downPaymentModal .btn::after {
    display: none !important;
    content: none !important;
}
#laborCostModal .btn-outline-primary:hover:not(:disabled),
#downPaymentModal .btn-outline-primary:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}
#laborCostModal .btn-outline-secondary:hover:not(:disabled),
#downPaymentModal .btn-outline-secondary:hover:not(:disabled) {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
}

/* --- 3.5 Modal Form Elements --- */
/* Styles for input fields and labels inside the modal */
.modal-body .form-group {
    margin-bottom: 20px;
}

/* Modal labels: prevent cut-off, allow wrap, readable size (Products & Services and all modals) */
.modal-body label,
.modal-body .form-group label,
.modal-body .col-form-label {
    font-size: 0.9375rem; /* 15px – readable but not oversized */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: visible;
    display: block;
    max-width: 100%;
    line-height: 1.4;
}
.modal-body .form-group.row label,
.modal-body .form-group.row .col-form-label {
    display: block;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}
.modal-body .form-group.row .col-form-label {
    min-height: 0;
    text-overflow: unset;
}

.modal-body .form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 10px 12px;
    min-height: 38px;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Single-line inputs: prevent text cut off at bottom */
.modal-body input.form-control:not([type="checkbox"]):not([type="radio"]),
.modal input.form-control:not([type="checkbox"]):not([type="radio"]) {
    height: auto;
    min-height: 38px;
    padding-top: 9px;
    padding-bottom: 9px;
    line-height: 1.4;
}

.modal-body textarea.form-control,
.modal textarea.form-control {
    min-height: 80px;
    padding: 10px 12px;
    line-height: 1.4;
}

/* Select dropdowns: prevent text cutoff – full selected-value visibility (ALL modals) */
.modal-body select:not(.sort-dropdown):not(.pl-toolbar-select),
.modal-body select.form-control:not(.sort-dropdown):not(.pl-toolbar-select),
.modal-body select.custom-select:not(.sort-dropdown):not(.pl-toolbar-select),
.modal select:not(.sort-dropdown):not(.pl-toolbar-select),
.modal select.form-control:not(.sort-dropdown):not(.pl-toolbar-select),
.modal select.custom-select:not(.sort-dropdown):not(.pl-toolbar-select) {
    font-size: 0.9375rem !important;
    line-height: 1.4 !important;
    min-width: 120px !important;
    width: 100% !important;
    max-width: 100%;
    min-height: 38px;
    padding: 9px 40px 9px 12px !important;
    overflow: visible !important;
    text-overflow: clip !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-color: #fff;
    box-sizing: border-box !important;
}

/* Option items: smaller so list isn't huge and text isn't cut off */
.modal-body select:not(.sort-dropdown) option,
.modal select:not(.sort-dropdown) option {
    font-size: 0.875rem !important;
    padding: 0.3em 0.5em !important;
    line-height: 1.35 !important;
    white-space: normal !important;
}

.modal-body .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Dropdown menus: prevent text cutoff – allow full visibility across modals */
.modal .dropdown-menu,
.modal-body .dropdown-menu {
    max-width: min(400px, 90vw);
    overflow: visible;
    overflow-y: auto; /* Allow scroll if many items */
    white-space: normal;
    word-wrap: break-word;
    z-index: 10050 !important; /* Above modal content */
}
.modal .dropdown-item,
.modal-body .dropdown-item,
.modal .list-group-item,
.modal-body .list-group-item {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: visible;
    text-overflow: clip;
}
/* Form groups with selects: let select expand to show full text, no truncation */
.modal-body .form-group,
.modal .form-group {
    min-width: 0;
    overflow: visible;
}
.modal-body .form-group select,
.modal .form-group select,
.modal-body .col-sm-8 select,
.modal .col-sm-8 select {
    width: 100% !important;
    box-sizing: border-box;
}
/* Parent of selects: prevent clipping of dropdown text */
.modal-body .form-group:has(select),
.modal .form-group:has(select),
.modal-body .col-sm-8:has(select) {
    overflow: visible;
    min-width: 0;
}

/* --- 3.5.1 Helper Text Styles - CENTRALIZED --- */
/* Consistent spacing for all helper text across all modals */
.modal-body .form-text,
.modal-body .input-help,
.form-text,
.input-help {
    margin-top: 10px !important; /* Consistent top spacing for all helper text */
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.form-text i,
.input-help i {
    flex-shrink: 0;
    color: #667eea;
}

/* --- 3.6 Modal Action Buttons - SHARED ACROSS ALL MODALS --- */
/* All button styles are now centralized in button-styles.css */
/* This ensures consistent button styling across ALL modals */

/* QR Code modal styles moved to: ../pages/cover-page/qr-code-modal.css */

/* --- 3.9 CUSTOM MODAL ELEMENTS --- */
/* Styles for custom elements used across different modals */

/* Header content layout */
.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.header-icon {
    font-size: 24px;
    opacity: 0.9;
    color: white;
}

.header-text {
    flex: 1;
}

.title-main {
    display: block;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: white;
}

.title-subtitle {
    display: block;
    font-size: 14px;
    opacity: 0.8;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

/* Progress steps styling */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin: 16px 24px 20px 24px;
    position: relative;
    padding: 16px 24px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: 1px;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.step.active .step-number {
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%);
    border-color: #667eea;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.step-label {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    text-align: center;
    transition: color 0.3s ease;
}

.step.active .step-label {
    color: #667eea;
    font-weight: 600;
}

.step.completed .step-label {
    color: #10b981;
}

/* Form steps */
.form-step {
    display: none;
}

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

/* Contact option styling */
.contact-option {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    background: #ffffff;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    margin-bottom: 6px;
}

.contact-option:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transform: none;
}

.option-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    font-size: 16px;
}

.option-label i {
    color: #667eea;
    width: 18px;
}

.option-description {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 12px;
    margin-left: 28px;
}

.required {
    color: #ef4444;
    font-weight: 600;
}

/* Form group styling */
.form-group {
    flex: 1;
    position: relative;
    margin-bottom: 15px;
}

.form-control {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    min-height: 38px;
    line-height: 1.4;
    box-sizing: border-box;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    width: 100%;
}

input.form-control:not([type="checkbox"]):not([type="radio"]) {
    height: auto;
    padding-top: 9px;
    padding-bottom: 9px;
}

textarea.form-control {
    min-height: 80px;
    line-height: 1.4;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    transform: none;
}

/* Footer layout */
.footer-left, .footer-center, .footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Image management modal styles moved to: ../pages/cover-page/image-manager-modal.css */

/* Footer editor styles moved to: ../pages/company-intro/edit-footer-modal.css */

/* QR modal responsive styles moved to: ../pages/cover-page/qr-code-modal.css */

    /* Image manager responsive styles moved to: ../pages/cover-page/image-manager-modal.css */

    .progress-steps {
        margin: 12px 16px 16px 16px;
        padding: 12px 16px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

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

    .header-content {
        gap: 12px;
    }

    .header-icon {
        font-size: 20px;
    }

    .title-main {
        font-size: 18px;
    }

    .title-subtitle {
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    /* QR modal mobile styles moved to: ../pages/cover-page/qr-code-modal.css */

    /* Small screen image manager styles moved to: ../pages/cover-page/image-manager-modal.css */

    .progress-steps {
        margin: 8px 12px 12px 12px;
        padding: 8px 12px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

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

    .header-content {
        gap: 8px;
    }

    .header-icon {
        font-size: 18px;
    }

    .title-main {
        font-size: 16px;
    }

    .title-subtitle {
        font-size: 12px;
    }
}

/* ==================================================
   4. MODAL Z-INDEX OVERRIDES - HIGHEST PRIORITY
   ================================================== */
/* Global: all modals and backdrops that are direct children of body stay on top.
   Ensures modals open correctly after layout/page structure changes (e.g. moving page around). */
body > .modal,
body > .modal-backdrop {
    z-index: 99998 !important;
}
body > .modal .modal-dialog {
    z-index: 99999 !important;
}
body > .modal .modal-content {
    z-index: 99999 !important;
}

/* These rules ensure all modals appear above the header (z-index: 1000)
   and PropoKit style menu (z-index: 3000) */

/* Customer Details Modal z-index styles moved to: ../pages/cover-page/customer-info-modal.css */

/* Company Info Modal */
#infoModal {
    z-index: 10000 !important;
}

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

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

/* QR Code Modal */
#qrModal {
    z-index: 10000 !important;
}

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

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

/* Image Management Modal - Highest Priority */
#combinedImageModal {
    z-index: 10001 !important;
}

#combinedImageModal .modal-dialog {
    z-index: 10001 !important;
}

#combinedImageModal .modal-content {
    z-index: 10001 !important;
    max-height: 85vh; /* Limit modal height to viewport */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Force combinedImageModal above everything - highest priority */
#combinedImageModal,
#combinedImageModal.modal,
#combinedImageModal .modal-dialog,
#combinedImageModal .modal-content,
#combinedImageModal .modal-backdrop {
    z-index: 10001 !important;
}

/* FORCE Image Management Modal - classic gray header */
#combinedImageModal .modal-header,
#combinedImageModal.modal .modal-header,
.modal#combinedImageModal .modal-header,
div[id="combinedImageModal"] .modal-header {
    background: #e5e7eb !important;
    color: #374151 !important;
    padding: 10px 16px !important;
    border-bottom: 1px solid #d1d5db !important;
    border-top: none !important;
    box-shadow: none !important;
    border-radius: 16px 16px 0 0 !important;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Cover Image Manager Header Content */
#combinedImageModal .modal-header .header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

/* Cover Image Manager Header Icon */
#combinedImageModal .modal-header .header-icon {
    font-size: 20px !important;
    opacity: 0.9;
    color: #4b5563;
}

/* Cover Image Manager Header Text */
#combinedImageModal .modal-header .header-text {
    flex: 1;
    position: relative;
}

/* Cover Image Manager Title Main */
#combinedImageModal .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;
}

/* Cover Image Manager Title Subtitle */
#combinedImageModal .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 */
#combinedImageModal .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;
}

/* Cover Image Manager Close Button */
#combinedImageModal .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;
}

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

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

/* Cover Image Manager 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);
    }
}

/* Cover Image Manager Responsive Styles */
@media (max-width: 768px) {
    #combinedImageModal .modal-header {
        padding: 16px 18px !important;
    }
    
    #combinedImageModal .modal-header .header-icon {
        font-size: 28px !important;
    }
    
    #combinedImageModal .modal-header .title-main {
        font-size: 20px !important;
    }
    
    #combinedImageModal .modal-header .title-subtitle {
        font-size: 13px !important;
        padding-left: 20px;
    }
    
    #combinedImageModal .modal-header .title-subtitle::before {
        width: 12px;
    }
    
    #combinedImageModal .modal-header .close {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    #combinedImageModal .modal-header {
        padding: 20px 22px !important;
    }
    
    #combinedImageModal .modal-header .header-icon {
        font-size: 32px !important;
    }
    
    #combinedImageModal .modal-header .title-main {
        font-size: 22px !important;
    }
    
    #combinedImageModal .modal-header .title-subtitle {
        font-size: 14px !important;
        padding-left: 28px;
    }
    
    #combinedImageModal .modal-header .title-subtitle::before {
        width: 20px;
        height: 2.5px;
    }
    
    #combinedImageModal .modal-header .close {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

/* Reduced Motion Support for Cover Image Manager */
@media (prefers-reduced-motion: reduce) {
    #combinedImageModal .modal-header .title-main,
    #combinedImageModal .modal-header .title-subtitle {
        animation: none;
    }
    
    #combinedImageModal .modal-header .title-subtitle::before {
        animation: none;
        width: 16px;
        opacity: 1;
    }
    
    #combinedImageModal .modal-header .close {
        animation: none;
    }
}

#combinedImageModal .modal-content,
#combinedImageModal.modal .modal-content,
.modal#combinedImageModal .modal-content {
    background: linear-gradient(135deg, #ffffff, #f0f4f8) !important;
    border-radius: 16px !important;
    border: 1px solid #e0e4e8 !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
    overflow: hidden !important;
}

/* Image Manager modal body - reduced padding for compactness */
#combinedImageModal .modal-body {
    padding: 12px !important; /* Further reduced from 15px for tighter fit */
    background-color: #ffffff !important;
    max-height: calc(85vh - 120px); /* Ensure body fits */
    overflow-y: auto; /* Allow scrolling if needed */
}

#combinedImageModal .modal-footer {
    background-color: #f1f5f9 !important;
    padding: 10px 20px !important; /* Further reduced vertical padding from 12px to 10px */
    border-top: 1px solid #e0e4e8 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important; /* Further reduced from 12px */
    flex-shrink: 0; /* Prevent footer from shrinking */
}

/* Image Management Modal buttons use centralized styles from button-styles.css */

/* Text Editing Modal styles moved to: ../pages/company-intro/edit-text-modal.css */

/* Footer Editing Modal styles moved to: ../pages/company-intro/edit-footer-modal.css */

/* Company Image Manager modal styles moved to: ../pages/company-intro/company-image-manager-modal.css */

/* Delete and Rename Modals - Must appear ABOVE combinedImageModal */
#deleteModal, #renameModal {
    z-index: 10002 !important;
}

#deleteModal .modal-dialog, #renameModal .modal-dialog {
    z-index: 10002 !important;
}

#deleteModal .modal-content, #renameModal .modal-content {
    z-index: 10002 !important;
}

/* Delete/Rename modal backdrops - must be above combinedImageModal backdrop */
body.modal-open #deleteModal + .modal-backdrop,
body.modal-open #renameModal + .modal-backdrop {
    z-index: 10001 !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Override Bootstrap modal-dialog-centered conflicts */
.modal-dialog-centered {
    z-index: inherit !important;
}

/* Ensure all modals appear above the backdrop */
/* UNIFIED MODAL POSITION: All Bootstrap modals open at the same place as New Customer (Customer Info):
   - 80px from top, 20px from bottom, horizontally centered.
   - Overrides Bootstrap modal-dialog-centered so dialogs are top-aligned, not vertically centered.
   - Full modal list: see docs/MODAL_LIST_AND_POSITION.md */
.modal {
    z-index: 10000 !important;
    align-items: flex-start !important; /* Same place as New Customer: top-aligned, not vertically centered */
}

.modal .modal-dialog {
    z-index: 10001 !important;
    margin: 80px auto 20px auto !important; /* Same place as New Customer: 80px from top, centered horizontally */
}

.modal .modal-content {
    z-index: 10002 !important;
}

.modal-backdrop.show {
    z-index: 9998 !important;
}

/* ==================================================
   MODAL DIALOG SIZING OVERRIDES
   ================================================== */

/* Text and Footer Edit Modals */
#editTextModal .modal-dialog {
    max-width: 700px; /* Increased for better text editing space */
}

#editFooterModal .modal-dialog {
    max-width: 700px;
}

/* Customer Info Modal - Wider for better button layout */
#customerInfoModal .modal-dialog {
    max-width: 750px; /* Increased to accommodate all buttons without wrapping */
}

/* About Modal */
#aboutModal .modal-dialog {
    max-width: 600px;
}

/* ==================================================
   HIDDEN ELEMENTS BY DEFAULT
   ================================================== */

#prevTextStepBtn,
#saveTextBtn,
#prevStepBtn,
#submitBtn {
    display: none;
}

/* ==================================================
   CONTACT OPTION FIELDS
   ================================================== */

.step1-approach-field,
.step2-expertise-field,
.step1-address-field,
.step3-date-field {
    margin-top: 20px;
}

/* Form groups display states */
#addressInputGroup {
    display: block;
}

#phoneInputGroup {
    display: block;
}

#emailInputGroup {
    display: none;
}