﻿/* ===== Advanced Search V2 — Premium UI ===== */
:root {
    --as-primary: #2c8a94;
    --as-primary-dark: #24727b;
    --as-primary-light: #e0f3f5;
    --as-primary-glow: rgba(44,138,148,.15);
    --as-bg: #f0f4f8;
    --as-card: #ffffff;
    --as-border: #e2e8f0;
    --as-text: #1e293b;
    --as-muted: #64748b;
    --as-success: #10b981;
    --as-radius: 14px;
    --as-shadow: 0 4px 24px rgba(0,0,0,.07);
    --as-shadow-lg: 0 8px 40px rgba(0,0,0,.1);
}

/* Page */
.as-page { background: var(--as-bg); min-height: 80vh; padding: 0 0 60px; }

/* Hero */
.as-hero {
    background: linear-gradient(135deg, #1a6e78 0%, #2c8a94 40%, #3ba3ae 80%, #2c8a94 100%);
    padding: 32px 0 32px; margin-bottom: -36px; position: relative; overflow: hidden;
}
.as-hero::before {
    content: ''; position: absolute; top: -60%; right: -12%; width: 550px; height: 550px;
    background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 65%); border-radius: 50%;
    animation: asHeroFloat 8s ease-in-out infinite;
}
.as-hero::after {
    content: ''; position: absolute; bottom: -50%; left: -8%; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 60%); border-radius: 50%;
    animation: asHeroFloat 10s ease-in-out infinite reverse;
}
@keyframes asHeroFloat { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(15px,-10px) scale(1.04); } }
.as-page > .container { padding-top: 0; }

/* Breadcrumb — inline pill style matching hero-stats */
.as-breadcrumb {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 20px;
    background: rgba(255,255,255,.08); backdrop-filter: blur(6px);
    font-size: 11.5px; color: rgba(255,255,255,.7);
    border: 1px solid rgba(255,255,255,.08);
    margin-inline-start: auto;
}
.as-breadcrumb a { color: rgba(255,255,255,.9); text-decoration: none; transition: color .2s; font-weight: 600; }
.as-breadcrumb a:hover { color: #fff; }
.as-breadcrumb span.sep { font-size: 10px; opacity: .6; }
.as-breadcrumb span:last-child { color: #fff; font-weight: 600; }

/* Hero inner */
.as-hero-inner {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 20px;
}
.as-hero-icon {
    width: 64px; height: 64px; border-radius: 18px;
    background: rgba(255,255,255,.13); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: #fff; border: 1px solid rgba(255,255,255,.18); flex-shrink: 0;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
}
.as-hero-text { flex: 1; }
.as-page .as-hero .as-hero-text h1,
.as-page .as-hero .as-hero-text h2,
.as-page .as-hero .as-hero-text h3,
.as-page .as-hero .as-hero-text h4,
.as-page .as-hero .as-hero-text h5,
.as-page .as-hero .as-hero-text h6 {
    margin: 0 !important; padding: 0 !important;
    font-size: 34px !important; font-weight: 800 !important;
    color: #ffffff !important; letter-spacing: -.3px !important;
    line-height: 1.25 !important; border: none !important;
    background: none !important; text-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.as-hero p {
    margin: 6px 0 0; font-size: 15px; color: rgba(255,255,255,.65);
    font-weight: 400; line-height: 1.5;
}

/* Hero stats row */
.as-hero-stats {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 12px;
    margin-top: 16px; flex-wrap: wrap;
}
.as-hero-stat {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px;
    background: rgba(255,255,255,.12); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.1);
    font-size: 12.5px; color: rgba(255,255,255,.85); font-weight: 600;
    transition: background .2s;
}
.as-hero-stat:hover { background: rgba(255,255,255,.18); }
.as-hero-stat i { font-size: 13px; opacity: .7; }
.as-hero-stat strong { color: #fff; font-weight: 700; }

/* Panel */
.as-panel {
    background: var(--as-card); border-radius: var(--as-radius);
    box-shadow: var(--as-shadow); padding: 40px 28px 20px;
    margin-bottom: 20px; border: 1px solid var(--as-border);
    transition: box-shadow .3s ease;
}
.as-panel:hover { box-shadow: var(--as-shadow-lg); }

/* Grid — compact */
.as-row { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
.as-col-2 { flex: 1 1 calc(50% - 9px); min-width: 180px; }
.as-col-3 { flex: 1 1 0; min-width: 0; }
.as-col-4 { flex: 1 1 calc(25% - 9px); min-width: 160px; }
.as-col-full { flex: 1 1 100%; }
.as-row-nowrap { flex-wrap: nowrap; }

/* Fields */
.as-field label {
    display: flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 600; color: var(--as-muted);
    text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px;
}
.as-field label i { font-size: 12px; color: var(--as-primary); opacity: .7; }
.as-field input[type="text"],
.as-field input[type="number"] {
    width: 100%; height: 40px; padding: 0 14px;
    border: 1.5px solid var(--as-border); border-radius: 8px;
    font-size: 13.5px; color: var(--as-text);
    background: #f8fafc; transition: all .25s ease; box-sizing: border-box;
}
.as-field input:focus {
    border-color: var(--as-primary); outline: none;
    box-shadow: 0 0 0 3px var(--as-primary-glow); background: #fff;
}
.as-field input::placeholder { color: #94a3b8; }

/* Section divider */
.as-divider {
    height: 1px; background: var(--as-border); margin: 20px 0;
}

/* Status Pills */
.as-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.as-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; border-radius: 24px; cursor: pointer;
    border: 1.5px solid var(--as-border); background: #f8fafc;
    font-size: 12.5px; font-weight: 600; color: var(--as-muted);
    transition: all .2s ease; user-select: none;
    position: relative; overflow: hidden;
}
.as-pill::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--as-primary), #3ba3ae);
    opacity: 0; transition: opacity .2s ease;
}
.as-pill:hover { border-color: var(--as-primary); color: var(--as-primary); }
.as-pill.active {
    border-color: var(--as-primary); color: #fff;
    box-shadow: 0 3px 10px rgba(44,138,148,.25);
}
.as-pill.active::before { opacity: 1; }
.as-pill i, .as-pill > span { position: relative; z-index: 1; }
.as-pill input { display: none; }

/* Buttons */
.as-actions { display: flex; gap: 10px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--as-border); align-items: center; }
.as-btn {
    display: inline-flex; align-items: center; gap: 7px;
    border-radius: 8px; font-weight: 700; border: none; cursor: pointer; transition: all .2s ease;
}
.as-btn-primary {
    padding: 12px 40px; font-size: 15px;
    background: linear-gradient(135deg, #FF7F27, #E66F1C);
    color: #fff; box-shadow: 0 4px 14px rgba(255,127,39,.3);
}
.as-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,127,39,.4); }
.as-btn-secondary {
    padding: 7px 18px; font-size: 12px;
    background: #e2e8f0; color: #64748b; border: 1px solid #cbd5e1;
}
.as-btn-secondary:hover { background: #cbd5e1; color: #334155; }

/* Results */
.as-results-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px; background: var(--as-card);
    border-radius: var(--as-radius) var(--as-radius) 0 0;
    border: 1px solid var(--as-border); border-bottom: 2px solid var(--as-primary-light);
}
.as-results-count {
    font-size: 15px; font-weight: 700; color: var(--as-text);
    display: flex; align-items: center; gap: 8px;
}
.as-results-count i { color: var(--as-primary); }
.as-results-count span {
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--as-primary), #3ba3ae);
    color: #fff; padding: 3px 14px; border-radius: 20px;
    font-size: 13px; font-weight: 700; min-width: 36px;
    box-shadow: 0 2px 8px rgba(44,138,148,.25);
}
.as-active-filters { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.as-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; border-radius: 16px; font-size: 11.5px;
    background: var(--as-primary-light); color: var(--as-primary-dark);
    font-weight: 600; border: 1px solid rgba(44,138,148,.15);
}

/* Save Search Button */
.as-btn-save {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 18px; border-radius: 8px; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--as-primary), var(--as-primary-dark));
    color: #fff; font-size: 13px; font-weight: 700;
    box-shadow: 0 3px 10px rgba(44,138,148,.25);
    transition: all .25s ease; white-space: nowrap;
}
.as-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(44,138,148,.35);
}
.as-btn-save:active { transform: translateY(0); }
.as-btn-save i { font-size: 14px; }
.as-btn-save.saved {
    background: linear-gradient(135deg, var(--as-success), #059669);
    pointer-events: none;
}

/* Cards — Premium V2 */
#asResultsList {
    border: 1px solid var(--as-border); border-top: none;
    border-radius: 0 0 var(--as-radius) var(--as-radius); overflow: hidden;
}
.as-tender-card {
    display: flex; gap: 0; background: var(--as-card);
    border-bottom: 1px solid var(--as-border);
    transition: all .25s cubic-bezier(.4,0,.2,1);
    position: relative; overflow: hidden;
}
.as-tender-card:hover {
    background: linear-gradient(90deg, #f0fafb 0%, #fff 100%);
    box-shadow: inset 0 0 0 1px rgba(44,138,148,.1);
    transform: translateY(-1px);
    z-index: 1;
}
.as-tender-card:last-child { border-bottom: none; }

/* Accent strip */
.as-card-accent {
    width: 4px; flex-shrink: 0;
    background: linear-gradient(180deg, var(--as-primary), #3ba3ae);
    opacity: 0; transition: opacity .25s ease;
}
.as-tender-card:hover .as-card-accent { opacity: 1; }

/* Flag column — square, centered, small */
.as-card-flag-col {
    flex-shrink: 0; width: 50px; display: flex;
    align-items: center; justify-content: center; padding: 0 2px 0 12px;
}
.as-card-flag-img {
    width: 28px; height: 28px; border-radius: 3px; object-fit: cover;
    border: 1.5px solid #d0d0d0;
}

/* Body */
.as-card-body { flex: 1; min-width: 0; padding: 14px 8px 14px 0; }

/* Buyer name — teal box with icon */
.as-card-buyer {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 8px; padding: 5px 10px;
    background: linear-gradient(135deg, #f0f9fa, #e8f4f5);
    border-radius: 6px; border-inline-start: 3px solid var(--as-primary);
}
.as-card-buyer i {
    color: var(--as-primary); font-size: 13px; flex-shrink: 0;
}
.as-card-buyer a {
    color: #1a6e78; font-size: 13px; font-weight: 700;
    text-decoration: none; transition: color .15s;
    overflow: hidden; text-overflow: ellipsis;
}
.as-card-buyer a:hover { color: var(--as-primary); text-decoration: underline; }

/* Title */
.as-card-title {
    font-size: 14.5px; font-weight: 700; color: var(--as-text);
    margin-bottom: 8px; line-height: 1.6;
}
.as-card-title a {
    color: inherit; text-decoration: none;
    transition: color .15s;
    background-image: linear-gradient(var(--as-primary), var(--as-primary));
    background-size: 0 2px; background-position: 0 100%; background-repeat: no-repeat;
    transition: background-size .3s ease, color .15s;
}
.as-card-title a:hover {
    color: var(--as-primary);
    background-size: 100% 2px;
}

/* Meta — dates more prominent */
.as-card-meta {
    display: flex; flex-wrap: wrap;
    gap: 4px 18px; margin-bottom: 8px;
}
.as-card-meta span {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12.5px; color: #475569; padding: 2px 0; font-weight: 500;
}
.as-card-meta i {
    width: 14px; height: 14px; display: flex; align-items: center; justify-content: center;
    color: var(--as-primary); font-size: 12px;
}

/* Badges */
.as-card-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.as-badge {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 10px; border-radius: 6px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .2px;
    text-transform: uppercase;
}
.as-badge-type { background: linear-gradient(135deg, #e0f3f5, #d0eef1); color: #1a6e78; }
.as-badge-status { background: linear-gradient(135deg, #fef3cd, #fde8a0); color: #7c3a0e; }
.as-badge-free { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #044d3a; }
.as-badge-cat { background: linear-gradient(135deg, #e8eaf6, #dde0f7); color: #2e3a8c; }

/* Right side — TGID compact */
.as-card-right {
    flex-shrink: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-width: 80px; padding: 14px 12px 14px 6px; gap: 6px;
}
.as-card-id {
    background: linear-gradient(135deg, #f0f9fa, #e8f4f5);
    border: 1px solid rgba(44,138,148,.12);
    border-radius: 8px; padding: 4px 10px; text-align: center;
    min-width: 58px;
}
.as-card-id small {
    font-size: 8px; color: var(--as-muted); text-transform: uppercase;
    letter-spacing: .8px; font-weight: 700; display: block; margin-bottom: 1px;
}
.as-card-id strong {
    font-size: 13px; color: var(--as-primary); display: block;
    font-weight: 800; font-feature-settings: 'tnum';
}
.as-card-countdown {
    font-size: 10px; font-weight: 700; padding: 3px 10px;
    border-radius: 20px; display: inline-flex; align-items: center; gap: 3px;
    white-space: nowrap;
}
.as-card-countdown i { font-size: 9px; }

/* Category + icons footer row — icons on opposite side */
.as-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 8px; padding-top: 8px;
    border-top: 1px dashed var(--as-border);
    gap: 8px;
}
.as-card-category {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: #64748b;
    flex: 1; min-width: 0;
}
.as-card-category > .fa { color: var(--as-primary); font-size: 13px; }
.as-cat-parent { font-weight: 600; color: #475569; }
.as-cat-name { color: var(--as-primary); font-weight: 500; }

/* Action icons — inline row in footer */
.as-card-footer .action-icons-wrapper-p3m7 {
    display: flex; flex-wrap: nowrap; gap: 2px;
    flex-shrink: 0;
}
.as-card-footer .icon-badge-q2z6 { padding: 2px; }
.as-card-footer .icon-badge-q2z6 img { width: 26px; height: 26px; }

/* Empty */
.as-empty { text-align: center; padding: 70px 24px; color: var(--as-muted); }
.as-empty i { font-size: 52px; margin-bottom: 18px; display: block; color: #cbd5e1; }
.as-empty p { font-size: 15px; font-weight: 500; }

/* Load More */
.as-loadmore {
    text-align: center; padding: 22px 16px 10px; background: var(--as-card);
    border: 1px solid var(--as-border); border-top: none;
    border-radius: 0 0 var(--as-radius) var(--as-radius);
}
.as-loadmore-progress {
    height: 4px; background: #e2e8f0; border-radius: 2px;
    margin: 0 auto 10px; max-width: 320px; overflow: hidden;
}
.as-loadmore-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--as-primary), #3ba3ae, var(--as-success));
    border-radius: 2px; transition: width .5s ease; width: 0;
    position: relative;
}
.as-loadmore-fill::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
    animation: asShimmer 1.5s infinite;
}
@keyframes asShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.as-loadmore-counter { font-size: 12.5px; color: var(--as-muted); margin-bottom: 10px; }
.as-loadmore-counter strong { color: var(--as-text); font-weight: 700; }
.as-loadmore-btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 9px 28px;
    background: #fff; border: 2px solid var(--as-primary); color: var(--as-primary);
    border-radius: 8px; font-size: 13.5px; font-weight: 700; cursor: pointer;
    transition: all .2s ease;
}
.as-loadmore-btn:hover {
    background: var(--as-primary); color: #fff; transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(44,138,148,.25);
}
.as-loadmore-btn .as-loadmore-spinner {
    display: none; width: 14px; height: 14px; border: 2px solid;
    border-top-color: transparent; border-radius: 50%; animation: asSpin .6s linear infinite;
}
.as-loadmore-btn.loading .as-loadmore-spinner { display: inline-block; }
.as-loadmore-btn.loading .as-loadmore-icon { display: none; }
.as-loadmore-done {
    padding: 10px; color: var(--as-success); font-size: 13px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}

/* Spinner */
.as-spinner {
    display: inline-block; width: 22px; height: 22px;
    border: 3px solid var(--as-border); border-top-color: var(--as-primary);
    border-radius: 50%; animation: asSpin .6s linear infinite;
}
@keyframes asSpin { to { transform: rotate(360deg); } }

/* Select2 Overrides */
.as-panel .select2-container .select2-selection--single,
.as-panel .select2-container .select2-selection--multiple {
    border: 1.5px solid var(--as-border) !important; border-radius: 8px !important;
    min-height: 40px !important; background: #f8fafc !important;
    transition: all .2s ease !important;
}
.as-panel .select2-container--default .select2-selection--single:hover,
.as-panel .select2-container--default .select2-selection--multiple:hover {
    border-color: var(--as-primary) !important;
}
.as-panel .select2-container--default.select2-container--focus .select2-selection,
.as-panel .select2-container--default.select2-container--open .select2-selection {
    border-color: var(--as-primary) !important;
    box-shadow: 0 0 0 3px var(--as-primary-glow) !important; background: #fff !important;
}
.as-panel .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important; padding: 0 14px !important;
    color: var(--as-text) !important; font-size: 13.5px !important;
}
.as-panel .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--as-primary-light) !important;
    border: 1px solid rgba(44,138,148,.2) !important;
    color: var(--as-primary-dark) !important; border-radius: 5px !important;
    padding: 3px 8px !important; font-size: 12px !important; font-weight: 600 !important;
}
/* Hide clear button on single-select dropdowns */
.as-panel .select2-container--default .select2-selection--single .select2-selection__clear {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .as-hero { padding: 20px 0 32px; }
    .as-page .as-hero .as-hero-text h1, .as-page .as-hero .as-hero-text h2,
    .as-page .as-hero .as-hero-text h3, .as-page .as-hero .as-hero-text h4 { font-size: 22px !important; }
    .as-hero-stats { gap: 8px; }
    .as-hero-stat { font-size: 11px; padding: 5px 10px; }
    .as-panel { padding: 16px 14px; }
    .as-col-2, .as-col-3, .as-col-4 { flex: 1 1 100%; min-width: 0; }
    .as-tender-card { flex-direction: column; gap: 10px; padding: 14px 16px; }
    .as-card-right { text-align: right; min-width: 0; }
    .as-actions { flex-direction: column; }
    .as-btn { justify-content: center; width: 100%; }
    .as-results-header { flex-direction: column; gap: 8px; padding: 12px 16px; }
}
