/* Advanced Search Plugin Styles */

/* 搜尋表單樣式 */
.asp-search-form-wrapper {
    margin: 20px 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.asp-search-form-wrapper.focused {
    box-shadow: none;
}

.asp-search-form {
    width: 100%;
}

.asp-search-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: stretch;
}

.asp-search-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    color: rgb(72, 85, 110);
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: white;
    line-height: 1.5;
    height: auto;
}

.asp-search-input::placeholder {
    color: rgb(72, 85, 110);
    opacity: 0.7;
}

.asp-search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.asp-search-button,
.asp-search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
    height: auto;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.asp-search-button:hover,
.asp-search-submit:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.asp-search-button:active,
.asp-search-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.asp-search-icon {
    width: 18px;
    height: 18px;
}

.asp-search-filters {
    margin-top: 8px;
}

.asp-filter-info {
    color: #666;
    font-size: 13px;
}

/* 搜尋結果樣式 */
.asp-search-results {
    margin: 30px auto;
    max-width: 960px;
    padding: 0 20px;
}

.asp-search-results .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.asp-search-header {
    padding: 50px 0;
    background: transparent;
    color: #333;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
}

.asp-search-header .asp-search-count {
    font-size: 32px;
    font-weight: 700;
    color: rgb(32, 38, 49);
    margin: 0;
    line-height: 1.6;
}

.asp-search-term {
    color: rgb(32, 38, 49);
    font-weight: 700;
}

.asp-result-item {
    background: white;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 35px;
    transition: all 0.3s ease;
    box-shadow: none;
    animation: asp-fadeInUp 0.5s ease-out forwards;
}

.asp-result-item:hover {
    box-shadow: none;
    transform: none;
    border-color: transparent;
}

.asp-result-header {
    display: block;
    margin-bottom: 12px;
}

.asp-result-title {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.5;
}

.asp-result-item h2.asp-result-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.5;
}

.asp-result-title a {
    color: rgb(32, 38, 49);
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
    display: inline-block;
}

.asp-result-title a:hover {
    color: #007bff;
    text-decoration: none;
}

.asp-post-type-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    color: rgb(32, 38, 49);
    font-size: 18px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
    margin-bottom: 8px;
}

/* 常見問題 FAQ 樣式 */
.asp-faq-content {
    margin-top: 12px;
}

.asp-faq-title {
    color: #1e293b;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.6;
}

.asp-faq-text {
    color: rgb(32, 38, 49);
    font-size: 18px;
    line-height: 1.8;
}

.asp-faq-text p {
    margin: 0 0 10px 0;
}

.asp-faq-text p:last-child {
    margin-bottom: 0;
}

.asp-matching-fields {
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
}

.asp-matching-fields-title {
    display: none;
}

.asp-field-item {
    background: transparent;
    padding: 0 0 8px 0;
    margin-bottom: 8px;
    border-radius: 0;
    border-left: none;
    transition: none;
}

.asp-field-item:hover {
    background: transparent;
    box-shadow: none;
}

.asp-field-label {
    display: block;
    font-weight: 700;
    color: rgb(32, 38, 49);
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 4px;
    text-decoration: underline;
}

.asp-field-label-link {
    text-decoration: underline;
    transition: color 0.3s ease;
}

.asp-field-label-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.asp-field-value {
    display: block;
    color: rgb(32, 38, 49);
    font-size: 18px;
    line-height: 160%;
}

/* 下載專區樣式 */
.asp-download-zone-content {
    margin-top: 12px;
}

.asp-download-zone-name {
    color: #1e293b;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
    line-height: 1.6;
}

.asp-download-zone-button {
    margin-top: 10px;
}

.asp-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #047857;
    color: #ffffff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.asp-download-btn:hover {
    background: #065f46;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(6, 95, 70, 0.3);
}

.asp-download-icon {
    font-size: 16px;
}

/* 下載連結樣式 */
.asp-download-link {
    color: #2271b1;
    text-decoration: underline;
    word-break: break-all;
    transition: color 0.2s ease;
}

.asp-download-link:hover {
    color: #135e96;
    text-decoration: none;
}

/* 高亮樣式 */
.search-highlight,
mark.search-highlight {
    background: #fde047;
    color: #1a1a1a;
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: 600;
}

/* 分頁樣式 */
.asp-pagination {
    margin: 60px 0 40px;
    padding: 20px 0;
}

.asp-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.asp-pagination .page-numbers li {
    list-style: none;
    margin: 0;
}

/* 所有分頁元素的基礎樣式 */
.asp-pagination a,
.asp-pagination span.current,
.asp-pagination span.dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.25s ease;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 數字按鈕特殊樣式 */
.asp-pagination a .asp-page-number,
.asp-pagination span.current .asp-page-number {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 上一頁/下一頁按鈕 */
.asp-pagination .asp-page-prev,
.asp-pagination .asp-page-next {
    font-size: 14px;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 上一頁/下一頁按鈕容器加寬 */
.asp-pagination a:has(.asp-page-prev),
.asp-pagination a:has(.asp-page-next) {
    min-width: 90px;
    padding: 0 18px;
}

/* hover效果 - 一般按鈕 */
.asp-pagination a:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 當前頁碼高亮 */
.asp-pagination span.current {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-color: #2563eb;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    cursor: default;
}

/* 省略號 */
.asp-pagination span.dots {
    border: none;
    background: transparent;
    color: #9ca3af;
    pointer-events: none;
    box-shadow: none;
    font-weight: 700;
    min-width: 32px;
}

/* 禁用狀態 (上一頁/下一頁到邊界時) */
.asp-pagination span.prev,
.asp-pagination span.next {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .asp-search-results {
        padding: 0;
    }

    .asp-pagination {
        margin: 40px 0 30px;
    }

    .asp-pagination .page-numbers {
        gap: 4px;
    }

    .asp-pagination a,
    .asp-pagination span.current,
    .asp-pagination span.dots {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
        padding: 0 12px;
    }

    .asp-pagination a:has(.asp-page-prev),
    .asp-pagination a:has(.asp-page-next) {
        min-width: 80px;
        padding: 0 14px;
    }
}

/* 無結果樣式 */
.asp-no-results {
    text-align: left;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    margin: 0;
}

.asp-no-results-icon {
    display: none;
}

.asp-no-results-title {
    display: none;
}

.asp-no-results-text {
    color: rgb(72, 85, 110);
    font-size: 18px;
    line-height: 1.8;
    margin: 0;
    padding: 0;
}

/* 搜尋結果頁面的表單樣式 */
.asp-search-results .asp-search-form-wrapper {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 30px;
}

.asp-search-results .asp-search-field-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.asp-search-results .asp-search-field {
    flex: 1;
    padding: 16px;
    padding-left: 44px;
    font-size: 16px;
    color: rgb(72, 85, 110);
    border: 1px solid rgb(205, 205, 205);
    border-radius: 10px;
    transition: all 0.3s ease;
    background-color: rgb(255, 255, 255);
    height: 100%;
}

.asp-search-results .asp-search-field::placeholder {
    color: rgb(72, 85, 110);
    opacity: 0.7;
}

.asp-search-results .asp-search-field:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.asp-search-results .asp-search-submit {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

/* 無結果頁面的搜尋表單樣式 */
.asp-no-results .asp-search-form-wrapper {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    border-radius: 4px;
}

.asp-no-results .asp-search-input {
    border: 2px solid #e0e0e0;
    font-size: 17px;
}

.asp-no-results .asp-search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.asp-no-results .asp-search-button {
    background: #007bff;
}

.asp-no-results .asp-search-button:hover {
    background: #0056b3;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* 搜尋建議 */
.asp-search-suggestions {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px dashed #d0d0d0;
}

.asp-suggestions-title {
    font-size: 18px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 15px;
}

.asp-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.asp-suggestions-list li {
    margin: 0;
}

.asp-suggestion-tag {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    color: #4338ca;
    border: 2px solid #4338ca;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.asp-suggestion-tag:hover {
    background: #4338ca;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(67, 56, 202, 0.3);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .asp-search-input-group {
        flex-direction: column;
    }

    .asp-search-button {
        width: 100%;
        justify-content: center;
    }

    .asp-result-header {
        flex-direction: column;
    }

    .asp-post-type-badge {
        margin-top: 8px;
    }

    .asp-pagination {
        gap: 4px;
    }

    .asp-pagination a,
    .asp-pagination span {
        min-width: 35px;
        height: 35px;
        padding: 6px 10px;
        font-size: 14px;
    }

    .asp-no-results {
        padding: 0;
    }

    .asp-no-results-icon {
        font-size: 56px;
    }

    .asp-no-results-title {
        font-size: 22px;
    }

    .asp-no-results-text {
        font-size: 16px;
        line-height: 1.8;
        padding: 0;
    }
}

/* 載入動畫 */
@keyframes asp-loading {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

.asp-loading {
    animation: asp-loading 1.5s ease-in-out infinite;
}

/* 結果項目淡入動畫 */
@keyframes asp-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 結果項目淡入動畫 - 延遲效果 */
.asp-result-item:nth-child(1) {
    animation-delay: 0.1s;
}

.asp-result-item:nth-child(2) {
    animation-delay: 0.2s;
}

.asp-result-item:nth-child(3) {
    animation-delay: 0.3s;
}

.asp-result-item:nth-child(4) {
    animation-delay: 0.4s;
}

.asp-result-item:nth-child(5) {
    animation-delay: 0.5s;
}

.asp-result-item:nth-child(6) {
    animation-delay: 0.6s;
}

.asp-result-item:nth-child(7) {
    animation-delay: 0.7s;
}

.asp-result-item:nth-child(8) {
    animation-delay: 0.8s;
}

.asp-result-item:nth-child(9) {
    animation-delay: 0.9s;
}

.asp-result-item:nth-child(10) {
    animation-delay: 1s;
}

/* 結果元數據樣式 */
.asp-result-meta {
    display: none;
}

/* 預設內容樣式 */
.asp-default-content {
    margin-top: 10px;
}

.asp-default-content p {
    margin: 0;
    display: block;
    color: rgb(32, 38, 49);
    font-size: 18px;
    line-height: 160%;
}

/* 搜尋頁面底部區塊 */
.asp-search-contract {
    margin-top: 100px;
}
