@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap');

#afx-wrapper {
    --afx-accent:       #B32726;
    --afx-accent-hover: #8f1f1e;
    --afx-bg:           #f5f5f7;
    --afx-white:        #ffffff;
    --afx-black:        #1d1d1f;
    --afx-gray:         #6e6e73;
    --afx-light:        #e8e8ed;
    --afx-green:        #30d158;
    --afx-red:          #ff3b30;
    --afx-radius:       20px;
    --afx-radius-sm:    12px;
    --afx-font:         'DM Sans', -apple-system, sans-serif;
    --afx-shadow:       0 8px 40px rgba(0,0,0,0.10);
    --afx-shadow-card:  0 16px 60px rgba(0,0,0,0.13);

    font-family: var(--afx-font);
    background: var(--afx-bg);
    min-height: 600px;
    padding: 0;
    position: relative;
    overflow: hidden;
    border-radius: var(--afx-radius);
}

/* ─── SEARCH PANEL ─── */
#afx-search-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 600px;
    padding: 40px 20px;
    background: var(--afx-bg);
}

.afx-search-inner {
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.afx-logo-mark {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    color: var(--afx-accent);
    font-weight: 700;
    letter-spacing: -2px;
}

.afx-headline {
    font-size: 34px;
    font-weight: 700;
    color: var(--afx-black);
    letter-spacing: -0.5px;
    margin: 0 0 10px;
    font-family: var(--afx-font);
}

.afx-subline {
    font-size: 15px;
    color: var(--afx-gray);
    line-height: 1.5;
    margin: 0 0 36px;
    font-family: var(--afx-font);
}

.afx-input-group {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

/* ─── CUSTOM DROPDOWN ─── */
.afx-select-wrapper {
    position: relative;
    width: 100%;
}

.afx-select-trigger {
    width: 100%;
    padding: 16px 20px;
    border: 1.5px solid var(--afx-light);
    border-radius: var(--afx-radius-sm);
    font-size: 16px;
    font-family: var(--afx-font);
    font-weight: 400;
    color: var(--afx-black);
    background: var(--afx-white);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.afx-select-trigger:hover,
.afx-select-wrapper.open .afx-select-trigger {
    border-color: var(--afx-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--afx-accent) 15%, transparent);
}

.afx-select-arrow {
    transition: transform 0.2s;
    flex-shrink: 0;
    color: var(--afx-gray);
}

.afx-select-wrapper.open .afx-select-arrow {
    transform: rotate(180deg);
}

#afx-select-label {
    color: var(--afx-gray);
}

#afx-select-label.selected {
    color: var(--afx-black);
    font-weight: 500;
}

.afx-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--afx-white);
    border: 1.5px solid var(--afx-light);
    border-radius: var(--afx-radius-sm);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.afx-select-wrapper.open .afx-select-dropdown {
    display: block;
    animation: afx-dropdown-in 0.15s ease;
}

@keyframes afx-dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.afx-select-option {
    padding: 12px 20px;
    font-size: 15px;
    font-family: var(--afx-font);
    color: var(--afx-black);
    cursor: pointer;
    transition: background 0.1s;
    text-align: left;
}

.afx-select-option:hover {
    background: color-mix(in srgb, var(--afx-accent) 8%, transparent);
    color: var(--afx-accent);
}

.afx-select-option.active {
    background: color-mix(in srgb, var(--afx-accent) 12%, transparent);
    color: var(--afx-accent);
    font-weight: 600;
}

#afx-search-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--afx-accent);
    color: white;
    border: none;
    border-radius: var(--afx-radius-sm);
    font-size: 16px;
    font-family: var(--afx-font);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

#afx-search-btn:hover:not(:disabled) { background: var(--afx-accent-hover); }
#afx-search-btn:active:not(:disabled) { transform: scale(0.98); }
#afx-search-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.afx-error-msg {
    margin-top: 12px;
    color: var(--afx-red);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--afx-font);
}

/* ─── SWIPE ARENA ─── */
#afx-swipe-arena {
    min-height: 600px;
    padding: 0 0 30px;
    background: var(--afx-bg);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.afx-arena-header {
    width: 100%;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.afx-back-btn {
    width: 38px;
    height: 38px;
    background: var(--afx-white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--afx-black);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.15s;
    flex-shrink: 0;
}
.afx-back-btn:hover { transform: scale(1.05); }

.afx-arena-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--afx-gray);
    text-align: center;
    flex: 1;
    font-family: var(--afx-font);
}
.afx-arena-title strong { color: var(--afx-black); font-size: 14px; }

.afx-counter {
    font-size: 12px;
    font-weight: 600;
    color: var(--afx-gray);
    background: var(--afx-white);
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    flex-shrink: 0;
    font-family: var(--afx-font);
}

/* ─── CARD STACK ─── */
#afx-card-stack {
    position: relative;
    width: calc(100% - 40px);
    max-width: 380px;
    height: 480px;
    margin: 0 auto;
}

.afx-card {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: var(--afx-white);
    border-radius: var(--afx-radius);
    box-shadow: var(--afx-shadow-card);
    overflow: hidden;
    cursor: grab;
    user-select: none;
    transform-origin: center bottom;
    transition: box-shadow 0.2s;
    will-change: transform;
}
.afx-card:active { cursor: grabbing; }

.afx-card:nth-child(2) {
    transform: scale(0.95) translateY(10px);
    z-index: 1;
    pointer-events: none;
}
.afx-card:nth-child(3) {
    transform: scale(0.90) translateY(20px);
    z-index: 0;
    pointer-events: none;
}
.afx-card:nth-child(n+4) { display: none; }
.afx-card:first-child { z-index: 10; pointer-events: all; }

.afx-card-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    pointer-events: none;
    background: var(--afx-light);
}

.afx-card-body { padding: 18px 20px 20px; }

.afx-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--afx-black);
    margin: 0 0 6px;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--afx-font);
}

.afx-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.afx-meta-tag {
    font-size: 12px;
    font-weight: 500;
    color: var(--afx-gray);
    background: var(--afx-bg);
    padding: 4px 10px;
    border-radius: 20px;
    font-family: var(--afx-font);
}

.afx-card-wanted {
    font-size: 12px;
    color: var(--afx-accent);
    font-weight: 500;
    font-family: var(--afx-font);
}
.afx-card-wanted span { color: var(--afx-gray); }

/* View listing link */
.afx-card-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--afx-accent);
    text-decoration: none;
    font-weight: 500;
    margin-top: 4px;
    font-family: var(--afx-font);
}
.afx-card-link:hover { text-decoration: underline; }

/* SWIPE INDICATORS */
.afx-indicator-like,
.afx-indicator-skip {
    position: absolute;
    top: 30px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.1s;
    pointer-events: none;
    z-index: 20;
    font-family: var(--afx-font);
}

.afx-indicator-like {
    left: 20px;
    color: var(--afx-green);
    border: 3px solid var(--afx-green);
    transform: rotate(-15deg);
}

.afx-indicator-skip {
    right: 20px;
    color: var(--afx-red);
    border: 3px solid var(--afx-red);
    transform: rotate(15deg);
}

/* ─── ACTION BUTTONS ─── */
.afx-actions {
    display: flex;
    gap: 24px;
    margin-top: 28px;
    justify-content: center;
    align-items: center;
}

.afx-btn-skip,
.afx-btn-like {
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.afx-btn-skip {
    width: 60px; height: 60px;
    background: var(--afx-white);
    color: var(--afx-red);
    box-shadow: 0 4px 20px rgba(255,59,48,0.15);
}

.afx-btn-like {
    width: 72px; height: 72px;
    background: var(--afx-green);
    color: white;
    box-shadow: 0 4px 24px rgba(48,209,88,0.30);
}

.afx-btn-skip:hover  { transform: scale(1.08); }
.afx-btn-like:hover  { transform: scale(1.08); }
.afx-btn-skip:active { transform: scale(0.94); }
.afx-btn-like:active { transform: scale(0.94); }

/* ─── EMPTY STATE ─── */
#afx-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 30px;
    width: 100%;
    flex: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.afx-empty-icon { font-size: 52px; margin-bottom: 16px; }
#afx-empty-state h3 {
    font-size: 22px; font-weight: 700;
    color: var(--afx-black); margin: 0 0 10px;
    font-family: var(--afx-font);
}
#afx-empty-state p {
    font-size: 15px; color: var(--afx-gray);
    line-height: 1.6; margin: 0 0 28px;
    font-family: var(--afx-font);
}

.afx-retry-btn {
    padding: 14px 28px;
    background: var(--afx-black);
    color: white; border: none;
    border-radius: var(--afx-radius-sm);
    font-size: 15px; font-family: var(--afx-font);
    font-weight: 600; cursor: pointer;
    transition: background 0.2s;
}
.afx-retry-btn:hover { background: #333; }

/* ─── LOADING ─── */
#afx-loading {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(245,245,247,0.88);
    z-index: 100;
    backdrop-filter: blur(6px);
    border-radius: var(--afx-radius);
    gap: 14px;
}

.afx-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--afx-light);
    border-top-color: var(--afx-accent);
    border-radius: 50%;
    animation: afx-spin 0.7s linear infinite;
}

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

#afx-loading p {
    font-size: 14px; color: var(--afx-gray);
    font-weight: 500; font-family: var(--afx-font);
}

/* ─── MATCH MODAL ─── */
#afx-match-modal {
    position: fixed; inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center; justify-content: center;
    padding: 20px;
}

.afx-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.afx-modal-card {
    position: relative;
    background: var(--afx-white);
    border-radius: 24px;
    padding: 32px 28px;
    max-width: 360px; width: 100%;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0,0,0,0.2);
    animation: afx-modal-in 0.35s cubic-bezier(0.34,1.56,0.64,1);
    z-index: 1;
}

@keyframes afx-modal-in {
    from { transform: scale(0.75) translateY(30px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.afx-match-badge {
    display: inline-block;
    background: var(--afx-accent);
    color: white;
    font-size: 13px; font-weight: 700;
    letter-spacing: 0.5px;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
    font-family: var(--afx-font);
}

#afx-match-img {
    width: 100%; height: 180px;
    object-fit: cover;
    border-radius: var(--afx-radius-sm);
    margin: 12px 0 16px;
}

.afx-modal-card h3 {
    font-size: 22px; font-weight: 700;
    color: var(--afx-black);
    margin: 0 0 8px; letter-spacing: -0.3px;
    font-family: var(--afx-font);
}

#afx-match-desc {
    font-size: 14px; color: var(--afx-gray);
    margin: 0 0 24px; line-height: 1.5;
    font-family: var(--afx-font);
}

.afx-modal-actions { display: flex; flex-direction: column; gap: 10px; }

.afx-btn-propose {
    display: block; padding: 15px;
    background: var(--afx-accent); color: white;
    text-decoration: none;
    border-radius: var(--afx-radius-sm);
    font-size: 15px; font-family: var(--afx-font);
    font-weight: 600; transition: background 0.2s;
}
.afx-btn-propose:hover { background: var(--afx-accent-hover); color: white; }

.afx-btn-continue {
    display: block; width: 100%; padding: 14px;
    background: var(--afx-bg); color: var(--afx-gray);
    border: none; border-radius: var(--afx-radius-sm);
    font-size: 14px; font-family: var(--afx-font);
    font-weight: 500; cursor: pointer; transition: background 0.2s;
}
.afx-btn-continue:hover { background: var(--afx-light); }

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
    #afx-card-stack { height: 440px; }
    .afx-card-image { height: 240px; }
}

/* ─── FILTERS ─── */
#afx-filters {
    margin-top: 16px;
    width: 100%;
    animation: afx-dropdown-in 0.2s ease;
}

.afx-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.afx-filter-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--afx-gray);
    min-width: 110px;
    text-align: right;
    font-family: var(--afx-font);
}

.afx-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.afx-range-inputs input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid var(--afx-light);
    border-radius: var(--afx-radius-sm);
    font-size: 14px;
    font-family: var(--afx-font);
    color: var(--afx-black);
    background: var(--afx-white);
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
}

.afx-range-inputs input:focus {
    border-color: var(--afx-accent);
}

.afx-range-inputs span {
    color: var(--afx-gray);
    font-size: 14px;
    flex-shrink: 0;
}

.afx-filter-select {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid var(--afx-light);
    border-radius: var(--afx-radius-sm);
    font-size: 14px;
    font-family: var(--afx-font);
    color: var(--afx-black);
    background: var(--afx-white);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.afx-filter-select:focus {
    border-color: var(--afx-accent);
}

.afx-select-trigger-sm {
    padding: 9px 14px !important;
    font-size: 14px !important;
}


