/* ==========================================================================
   OTA Channel Manager & Photoshop-Style Color Picker Styles
   ========================================================================== */

/* --- Photoshop Color Picker Modal & Controls --- */
.ps-picker-dialog {
    max-width: 580px;
    width: 95%;
    margin: 1.25rem auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ps-picker-header {
    background: #1e242b;
    color: #f1f5f9;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #2d3748;
}

.ps-picker-header h6 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-picker-body {
    background: #252b33;
    color: #e2e8f0;
    padding: 14px 18px;
    user-select: none;
    max-height: calc(90vh - 110px);
    overflow-y: auto;
}

.ps-layout {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* 2D Spectrum Box */
.ps-spectrum-box {
    width: 220px;
    height: 220px;
    position: relative;
    border-radius: 8px;
    cursor: crosshair;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4), 0 4px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    flex-shrink: 0;
}

.ps-spectrum-bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.ps-spectrum-white {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(to right, #ffffff, rgba(255, 255, 255, 0));
}

.ps-spectrum-black {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), #000000);
}

.ps-spectrum-pointer {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.8), inset 0 0 2px rgba(0, 0, 0, 0.8);
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}

/* Hue Rainbow Slider */
.ps-hue-bar {
    width: 28px;
    height: 220px;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    background: linear-gradient(to bottom, 
        #ff0000 0%, 
        #ffff00 17%, 
        #00ff00 33%, 
        #00ffff 50%, 
        #0000ff 67%, 
        #ff00ff 83%, 
        #ff0000 100%
    );
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4), 0 4px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.ps-hue-pointer {
    position: absolute;
    left: -4px;
    width: 36px;
    height: 10px;
    border-radius: 3px;
    border: 2px solid #ffffff;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transform: translateY(-50%);
    z-index: 10;
}

/* Side Column: Split Preview & Numerical Inputs */
.ps-side-panel {
    flex: 1;
    min-width: 210px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Photoshop Classic New vs Current Split Box */
.ps-split-container {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    border: 2px solid #3b4754;
    overflow: hidden;
    height: 50px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.ps-color-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: default;
    transition: all 0.15s ease;
}

.ps-color-half.current {
    cursor: pointer;
    border-left: 1px solid rgba(0, 0, 0, 0.3);
}

.ps-color-half.current:hover {
    filter: brightness(1.1);
}

.ps-color-half span {
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    pointer-events: none;
}

/* Numeric Inputs (HEX, RGB, HSL) */
.ps-field-group {
    background: #1c2127;
    border: 1px solid #333d4b;
    border-radius: 8px;
    padding: 8px 10px;
}

.ps-field-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.ps-field-row:last-child {
    margin-bottom: 0;
}

.ps-field-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    width: 20px;
    flex-shrink: 0;
    text-align: right;
}

.ps-input {
    background: #2a3441;
    border: 1px solid #435164;
    color: #f8fafc;
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 0.8rem;
    font-family: monospace;
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
}

.ps-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.ps-input-rgb {
    width: 44px;
    padding: 3px 2px;
    text-align: center;
    font-size: 0.8rem;
    -moz-appearance: textfield;
}

.ps-input-rgb::-webkit-outer-spin-button,
.ps-input-rgb::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Swatches Grid */
.ps-swatches-wrap {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #333d4b;
}

.ps-swatches-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ps-swatch-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ps-swatch-item {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.ps-swatch-item:hover {
    transform: scale(1.18);
    z-index: 2;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
    border-color: #ffffff;
}

/* Footer Buttons */
.ps-picker-footer {
    background: #1e242b;
    padding: 12px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #2d3748;
}

/* --- OTA Channels Management Tab UI --- */
.ota-header-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ota-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ota-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.ota-card.is-inactive {
    background: #f8fafc;
    border-color: #cbd5e1;
    border-style: dashed;
    opacity: 0.82;
}

.ota-card.is-inactive:hover {
    opacity: 1;
    border-color: #94a3b8;
}

.ota-card.is-inactive .ota-logo-frame {
    filter: grayscale(0.85);
    opacity: 0.65;
}

/* Modal Viewport Fit & Scrollable Safety */
#otaChannelModal .modal-dialog {
    max-width: 500px;
    width: 95%;
    margin: 1.25rem auto;
}

#otaChannelModal .modal-content {
    max-height: calc(100vh - 40px);
}

#otaChannelModal .modal-body {
    max-height: calc(88vh - 130px);
    overflow-y: auto;
}


.ota-logo-frame {
    height: 64px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    margin-bottom: 14px;
    overflow: hidden;
}

.ota-logo-frame svg {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.ota-color-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-family: monospace;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.ota-color-pill:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.ota-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

/* Upcoming Grid Simulation Preview */
.ota-grid-sim {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 12px;
    margin: 12px 0;
}

.ota-grid-sim-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.ota-sim-cell {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

.ota-sim-cell svg {
    max-height: 16px;
    max-width: 38px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Upcoming Grid Embedded Logo */
.grid-ota-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    max-height: 18px;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

.grid-ota-logo-wrap svg {
    height: 16px;
    max-height: 16px;
    width: auto;
    min-width: 14px;
    max-width: 48px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

/* Universal Booking Source Badge Pill (For all tables and preview modals) */
.ota-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.25;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    vertical-align: middle;
}

.ota-badge-pill:hover {
    filter: brightness(0.97);
}

.ota-badge-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 15px;
    flex-shrink: 0;
}

.ota-badge-logo svg {
    height: 15px;
    max-height: 15px;
    width: auto;
    min-width: 14px;
    max-width: 40px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

/* Grid Top Legend Bar */
.grid-ota-legend-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
}

.grid-ota-legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.grid-ota-legend-pill svg {
    max-height: 14px;
    max-width: 32px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Booking Form Source Selector Tiles */
.dynamic-source-btn {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.dynamic-source-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
}

.dynamic-source-btn.selected {
    border-color: var(--source-accent, #2563eb);
    background: var(--source-bg-tint, rgba(37, 99, 235, 0.08));
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.dynamic-source-btn .selected-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--source-accent, #2563eb);
    color: white;
    font-size: 11px;
    display: none;
    align-items: center;
    justify-content: center;
}

.dynamic-source-btn.selected .selected-indicator {
    display: flex;
}

.dynamic-source-logo {
    height: 28px;
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.dynamic-source-logo svg {
    max-height: 26px;
    max-width: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* --- Grid SVG Logo beside Guest Name --- */
.grid-ota-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    vertical-align: middle;
    height: 18px;
    flex-shrink: 0;
}

.grid-ota-logo-wrap svg {
    height: 16px;
    width: auto;
    min-width: 14px;
    max-width: 48px;
    display: inline-block;
    vertical-align: middle;
}

/* --- Universal Booking Source Badge Pill (Tables, Lists, Cards) --- */
.ota-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    vertical-align: middle;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ota-badge-pill:hover {
    transform: translateY(-0.5px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.ota-badge-pill.tiny {
    padding: 2px 6px;
    font-size: 0.70rem;
    gap: 4px;
}

.ota-badge-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 15px;
    flex-shrink: 0;
}

.ota-badge-logo svg {
    height: 14px;
    width: auto;
    min-width: 12px;
    max-width: 36px;
    display: block;
}

/* Legend items */
.ota-legend-item svg {
    height: 14px;
    width: auto;
    min-width: 12px;
    max-width: 32px;
    display: block;
}

/* Enquiry modal — OTA source chips with SVG logos */
.enquiry-source-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.enquiry-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    min-height: 42px;
    max-width: 100%;
}

.enquiry-source-chip:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
}

.enquiry-source-chip.selected {
    border-color: var(--source-accent, #10b981);
    background: var(--source-bg-tint, rgba(16, 185, 129, 0.12));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--source-accent, #10b981) 22%, transparent);
}

.enquiry-source-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    width: 28px;
    flex-shrink: 0;
}

.enquiry-source-logo svg {
    max-height: 22px;
    max-width: 28px;
    width: auto;
    height: auto;
    display: block;
}

.enquiry-source-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--source-accent, #64748b);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.enquiry-source-label {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}


