/* 
   search.css — หน้าค้นหา และ หน้า Browse
/* ---------- Page Layout ---------- */
.search-page {
    padding: 56px 40px;
    text-align: center;
}

.page-header {
    margin-bottom: 36px;
}

.page-header .hero-title {
    font-size: 50px;
}

/* ---------- Search Container (กล่องหลัก) ---------- */
.search-container {
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 40px 40px;
    text-align: left;
    max-width: 900px;
    margin: 0 auto;
}

/* ---------- Search Row (ช่องค้นหาและปุ่ม) ---------- */
.search-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    border: 1.9px solid #374780;
    border-radius: 6px;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* ---------- Browse Section Label ---------- */
.browse-section-label {
    font-size: 15px;
    color: #374780;
    font-weight: 600;
    margin: 20px 0 12px;
}

/* ---------- Letter Filter Header ---------- */
.letter-filter-header {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.letter-filter-label {
    font-size: 13px;
    color: #999;
}

.filter-icon {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 6px;
    margin-bottom: 1px;
    vertical-align: text-bottom;
    filter: saturate(0) opacity(0.5);
}

.btn-clear-letters {
    font-size: 12px;
    font-weight: 600;
    color: #00ABFF;
    text-decoration: none;
    display: none;
    background-color: #f1f5f6;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.btn-clear-letters:hover {
    background-color: #e0eaef;
}

.btn-clear-letters.show {
    display: inline;
}

/* ---------- Tab Row (ดูทั้งหมด / ภาษาไทย / ภาษาอังกฤษ) ---------- */
.tab-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Tab Button (ใช้ <a>) */
.btn-tab {
    background-color: #ecf0f1;
    color: #374780;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 13px;
    font-family: 'Google Sans', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.btn-tab:hover {
    background-color: #bdc3c7;
}

.btn-tab--active {
    background-color: #3498db;
    color: #ffffff;
}

.btn-tab--active2 {
    background-color: #374780;
    color: #ffffff;
}

.btn-search-submit {
    padding: 12px 32px;
    font-size: 18px;
}

/* ---------- Clear Search Button ---------- */
.clear-search-wrapper {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-top: 4px;
    margin-bottom: 8px;
    text-align: right;
}

.btn-clear-search {
    font-size: 13px;
    font-weight: 600;
    color: #c02725;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 4px 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    transition: background-color 0.2s, color 0.2s;
}

.btn-clear-search:hover {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ---------- Letter Grid ---------- */
.letter-grid {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.letter-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 40%;
    background: white;
    color: #374780;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.letter-btn:hover {
    background-color: #f0f4ff;
    border-color: #374780;
}

.letter-btn.active {
    background: #00ABFF;
    color: white;
    border-color: #3498db;
}

/* ---------- Browse Footer ---------- */
.browse-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ---------- Results Section ---------- */
.results-header-row.new-style {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 32px 0 24px;
}

.title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-indicator {
    width: 6px;
    height: 24px;
    background-color: #374780;
    border-radius: 4px;
}

.results-header {
    font-size: 20px;
    font-weight: 700;
    color: #374780;
    margin: 0;
}

.results-section {
    padding-top: 8px;
}

.result-count-badge {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    background-color: #f8fafc;
    padding: 6px 16px;
    border-radius: 20px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
}

/* ---------- 3-Column Card Grid ---------- */
.result-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    overflow: hidden;
}

.result-card-item {
    background-color: #f1f5f96e;
    border: 1px solid rgba(55, 71, 128, 0.1);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}

.domain-name {
    font-size: 16px;
    font-weight: 700;
    color: #374780;
    min-width: 0;
    flex: 1;
    margin-right: 10px;
    overflow-wrap: break-word;
}

.icon-lock-outline {
    width: 22px;
    height: 18px;
    filter: invert(51%) sepia(22%) saturate(131%) hue-rotate(171deg) brightness(150%) contrast(112%);
}

/* ---------- No Result ---------- */
.no-result {
    background-color: #ecf0f1;
    border: 1px solid #c02725d1;
    border-radius: 16px;
    padding: 13px 24px;
    text-align: center;
    margin-top: 50px;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.no-result-title {
    color: #c02725d1;
    font-size: 19px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.no-result-sub {
    color: #03bd78;
    font-size: 14px;
    margin-top: 8px;
    font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .search-page {
        padding: 24px 16px;
    }

    .search-container {
        padding: 18px 14px;
        border-radius: 12px;
    }

    .page-header .hero-title {
        font-size: 28px;
        line-height: 1.15;
    }

    .search-row {
        flex-direction: column;
        gap: 12px;
    }

    .search-input {
        width: 100%;
        box-sizing: border-box;
    }

    .tab-row {
        flex-direction: column;
        gap: 10px;
    }

    .btn-tab {
        width: 100%;
        padding: 12px 16px;
        border-radius: 8px;
        text-align: center;
        box-sizing: border-box;
    }

    .btn-tab--active,
    .btn-tab--active2 {
        width: 100%;
    }

    .btn-search-submit {
        width: 100%;
        padding: 12px 18px;
        font-size: 16px;
        border-radius: 8px;
        box-sizing: border-box;
    }

    .letter-grid {
        gap: 8px;
    }

    .result-card-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .browse-footer {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .browse-footer .btn-primary {
        width: 100%;
        text-align: center;
    }

    .browse-section-label {
        margin: 12px 0 8px;
    }
}

/* Rate Limit Popup */
.rl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: rl-fade-in .2s ease;
}

@keyframes rl-fade-in {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.rl-modal {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px 28px;
    width: min(340px, 90vw);
    text-align: center;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
    animation: rl-slide-up .25s ease;
}

@keyframes rl-slide-up {
    from {
        transform: translateY(20px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

.rl-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.rl-close:hover {
    color: #333;
}

.rl-icon-wrap {
    width: 72px;
    height: 72px;
    background: #fff0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.rl-icon {
    width: 36px;
    height: 36px;
}

.rl-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #c0392b;
    margin: 0 0 8px;
}

.rl-msg {
    font-size: .9rem;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   CAPTCHA MODAL OVERLAY — เพิ่มต่อท้าย search.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Backdrop ── */
.captcha-overlay {
    position: fixed;
    inset: 0;
    /* top/right/bottom/left: 0 */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    padding: 1rem;
}

/* ── Modal card ── */
.captcha-modal {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 2.25rem 2rem 2rem;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    animation: captchaFadeIn 0.2s ease;
}

@keyframes captchaFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Icon ── */
.captcha-modal__icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fef9c3;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.captcha-modal__icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* ── Text ── */
.captcha-modal__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.captcha-modal__desc {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

.captcha-modal__error {
    font-size: 0.85rem;
    color: #e53e3e;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

/* ── Form ── */
.captcha-modal__form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    width: 100%;
}

.captcha-modal__submit {
    min-width: 180px;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
}

/* ── Countdown ── */
.captcha-modal__timer {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .captcha-modal {
        padding: 1.75rem 1.25rem 1.5rem;
        border-radius: 16px;
    }
}

/* ── Inline CAPTCHA box ── */
.captcha-inline {
    margin: 40px auto 0;
    max-width: 340px;
    padding: 20px 24px;
    padding-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}


.captcha-inline__icon {
    width: 28px;
    height: 28px;
    margin-top: 2px;
    flex-shrink: 0;
}

.captcha-inline__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 4px;
}

.captcha-inline__desc {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

.captcha-inline__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.captcha-inline__verified {
    font-size: 0.88rem;
    color: #166534;
    background: #dcfce7;
    border-radius: 8px;
    padding: 8px 14px;
    margin: 0;
}

.captcha-inline__timer {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0;
}

@media (max-width: 480px) {
    .captcha-inline {
        padding: 16px;
    }
}
/* ── CAPTCHA Required Notice ─────────────────────────────────── */
.captcha-required-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    /* margin-top: 24px; */
    font-size: 1rem;
    /* font-weight: 600; */
    color: #e74c3c;
}

.captcha-required-notice__icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}