/* =========================================================================
   PACKAGE CONTEXTUAL SEARCH  — India / International / Pondicherry / Cruise / Group Tours
   Filename: public/assets/frontend/css/package-search.css

   Positioned on the right side of "{count} Packages Found" header.
   ========================================================================= */

/* ----- Wrapper (scoped root) ─────────────────────────────────────────────── */
.pcs-wrapper {
    --pcs-red:         #9D0B0B;
    --pcs-red-muted:   rgba(157, 11, 11, 0.12);
    --pcs-border-idle: #e2e8f0;
    --pcs-bg-idle:     #ffffff;
    --pcs-radius:      50px;
    --pcs-transition:  0.2s ease;

    position: relative;
    width: 100%;
    max-width: 340px;
    margin: 0;
    z-index: 1001;
}

/* ── Input Wrapper ───────────────────────────────────────────────────────── */
.pcs-input-wrap {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--pcs-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 0 16px;
    height: 44px;
    transition:
        background var(--pcs-transition),
        border-color var(--pcs-transition),
        box-shadow var(--pcs-transition);
}

.pcs-input-wrap:focus-within {
    background: #ffffff;
    border-color: #9D0B0B;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 0 0 3px var(--pcs-red-muted);
}

/* Text input */
.pcs-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #1e293b;
    font-size: 14px;
    font-weight: 400;
    padding: 8px 0;
    min-width: 0;
    caret-color: #9D0B0B;
}

.pcs-input::placeholder {
    color: #94a3b8;
    font-size: 13.5px;
}

/* Search icon on right side */
.pcs-search-icon {
    color: #64748b;
    flex-shrink: 0;
    margin-left: 10px;
    pointer-events: none;
}

/* Clear (×) button */
.pcs-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: #64748b;
    flex-shrink: 0;
    margin-left: 6px;
    transition: background var(--pcs-transition), color var(--pcs-transition);
    padding: 0;
}
.pcs-clear:hover { background: #e2e8f0; color: #0f172a; }

/* ── Dropdown Container ───────────────────────────────────────────────────── */
.pcs-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: 380px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.14);
    z-index: 99999;
    overflow: hidden;
    max-height: 440px;
    overflow-y: auto;

    /* Entry animation */
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;

    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #e2e2e2 transparent;
}

.pcs-dropdown.pcs-visible {
    opacity: 1;
    transform: translateY(0);
}

.pcs-dropdown::-webkit-scrollbar       { width: 4px; }
.pcs-dropdown::-webkit-scrollbar-track { background: transparent; }
.pcs-dropdown::-webkit-scrollbar-thumb { background: #e2e2e2; border-radius: 4px; }

/* ── Section Headers ─────────────────────────────────────────────────────── */
.pcs-section-header {
    padding: 10px 16px 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #b0b0b0;
    pointer-events: none;
    background: #fff;
    position: sticky;
    top: 0;
}

/* ── Divider ─────────────────────────────────────────────────────────────── */
.pcs-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 2px 0;
}

/* ── Result Item ─────────────────────────────────────────────────────────── */
.pcs-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.13s ease, padding-left 0.13s ease;
    text-decoration: none !important;
    color: inherit !important;
    gap: 8px;
    outline: none;
}

.pcs-result-item:hover,
.pcs-result-item:focus-visible {
    background: #fdf0f0;
    padding-left: 18px;
    text-decoration: none !important;
}

.pcs-result-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.pcs-result-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Result Icon (32×32 square with rounded corners) ────────────────────── */
.pcs-result-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Location icon variants */
.pcs-icon-location  { background: #eff6ff; color: #2563eb; }
.pcs-icon-state     { background: #f0fdf4; color: #16a34a; }
.pcs-icon-city      { background: #eff6ff; color: #2563eb; }
.pcs-icon-country   { background: #faf5ff; color: #7c3aed; }

/* Package icon */
.pcs-icon-package   { background: #fffbeb; color: #b45309; }

/* ── Result Name ─────────────────────────────────────────────────────────── */
.pcs-result-name {
    font-size: 13.5px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* ── Type Badges ─────────────────────────────────────────────────────────── */
.pcs-result-badge {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
}

.pcs-badge-state   { background: #dcfce7; color: #166534; }
.pcs-badge-city    { background: #dbeafe; color: #1e40af; }
.pcs-badge-country { background: #ede9fe; color: #5b21b6; }

/* ── Chevron Arrow ───────────────────────────────────────────────────────── */
.pcs-result-arrow {
    color: #d1d5db;
    opacity: 0;
    transition: opacity 0.13s ease, transform 0.13s ease;
    flex-shrink: 0;
}

.pcs-result-item:hover .pcs-result-arrow,
.pcs-result-item:focus-visible .pcs-result-arrow {
    opacity: 1;
    transform: translateX(2px);
    color: var(--pcs-red);
}

/* ── Loading State ───────────────────────────────────────────────────────── */
.pcs-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    color: #9ca3af;
    font-size: 13.5px;
}

.pcs-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--pcs-red);
    border-radius: 50%;
    animation: pcs-spin 0.65s linear infinite;
    flex-shrink: 0;
}

@keyframes pcs-spin { to { transform: rotate(360deg); } }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.pcs-empty {
    padding: 26px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 13.5px;
}

.pcs-empty-icon {
    display: block;
    margin: 0 auto 10px;
    color: #d1d5db;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .pcs-wrapper {
        max-width: 100%;
        margin-top: 12px;
    }

    .pcs-dropdown {
        left: 0;
        right: 0;
        width: 100%;
    }
}
