/* ============================
   AGA Clinic Filter - Frontend
   ============================ */

#aga-filter-app {
    max-width: 960px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    line-height: 1.6;
    color: #333;
}
#aga-filter-app *, #aga-filter-app *::before, #aga-filter-app *::after {
    box-sizing: border-box;
}

/* ─── Filter Section ─── */
.aga-filter-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
}
.aga-filter-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px 0;
    text-align: center;
    color: #1a202c;
}
.aga-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.aga-filter-item label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}
.aga-filter-item select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #333;
    appearance: auto;
    cursor: pointer;
}
.aga-filter-item select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

/* ─── Chips ─── */
.aga-chip-section {
    margin-bottom: 20px;
}
.aga-chip-label {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    display: block;
    margin-bottom: 10px;
}
.aga-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.aga-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 13px;
    border: 1px solid #cbd5e0;
    border-radius: 20px;
    background: #fff;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.aga-chip:hover {
    border-color: #667eea;
    color: #667eea;
}
.aga-chip.aga-selected {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* ─── Search Button ─── */
.aga-search-btn-wrap {
    text-align: center;
}
.aga-search-btn {
    display: inline-block;
    padding: 14px 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.aga-search-btn:hover {
    opacity: 0.9;
}
.aga-reset-btn {
    display: inline-block;
    padding: 14px 36px;
    background: #fff;
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.aga-reset-btn:hover {
    background: #667eea;
    color: #fff;
}

/* ─── Results Header ─── */
.aga-results-section {
    margin-top: 24px;
}
.aga-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.aga-result-count {
    font-size: 15px;
    font-weight: 700;
    color: #1a202c;
}
.aga-result-count span {
    color: #667eea;
    font-size: 20px;
}

/* ─── View Toggle ─── */
.aga-view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    overflow: hidden;
}
.aga-view-btn {
    padding: 8px 16px;
    font-size: 13px;
    border: none;
    background: #fff;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.aga-view-btn.aga-active {
    background: #667eea;
    color: #fff;
}

/* ─── Sort Bar ─── */
.aga-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #4a5568;
}
.aga-sort-btn {
    padding: 6px 14px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.aga-sort-btn.aga-active {
    background: #eef2ff;
    color: #667eea;
    border-color: #667eea;
    font-weight: 600;
}

/* ─── Card View ─── */
.aga-card-view {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.aga-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: box-shadow 0.2s;
}
.aga-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.aga-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.aga-card-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #667eea;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    margin-right: 10px;
}
.aga-card-name {
    font-size: 17px;
    font-weight: 700;
    color: #1a202c;
    flex: 1;
}
.aga-card-guarantee {
    display: inline-block;
    padding: 3px 10px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    flex-shrink: 0;
    margin-left: 10px;
}
.aga-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.aga-card-price-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
}
.aga-card-price-label {
    font-size: 11px;
    color: #718096;
    font-weight: 600;
    margin-bottom: 4px;
}
.aga-card-price-value {
    font-size: 15px;
    font-weight: 700;
    color: #1a202c;
}
.aga-card-points {
    margin-bottom: 16px;
}
.aga-card-points-title {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 6px;
}
.aga-card-points-list {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.8;
}
/* ─── Coupon Section ─── */
.aga-card-coupons {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.aga-card-coupons-title {
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 8px;
}
.aga-coupon-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed #fde68a;
}
.aga-coupon-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.aga-coupon-plan {
    font-size: 12px;
    color: #78350f;
    flex: 1;
    min-width: 100px;
}
.aga-coupon-code-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.aga-coupon-code {
    display: inline-block;
    padding: 4px 10px;
    background: #fff;
    border: 1px dashed #d97706;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    color: #d97706;
    letter-spacing: 0.5px;
    font-family: monospace;
}
.aga-coupon-code-sm {
    display: inline-block;
    padding: 2px 6px;
    background: #fffbeb;
    border: 1px dashed #d97706;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #d97706;
    font-family: monospace;
}
.aga-copy-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #d97706;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.aga-copy-btn:hover {
    background: #b45309;
}
.aga-copy-btn.aga-copied {
    background: #059669;
}
.aga-copy-btn-sm {
    padding: 2px 8px;
    font-size: 10px;
}

.aga-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #718096;
    margin-bottom: 16px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.aga-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.aga-card-meta-label {
    font-weight: 600;
}
.aga-card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.aga-card-feature-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #eef2ff;
    color: #667eea;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}
.aga-card-cta {
    display: block;
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.aga-card-cta:hover {
    opacity: 0.9;
    color: #fff;
    text-decoration: none;
}

/* ─── Table View ─── */
.aga-table-view {
    overflow-x: auto;
}
.aga-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.aga-table th {
    background: #f8fafc;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.aga-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.aga-table tr:hover td {
    background: #fafbfc;
}
.aga-table-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}
.aga-table-link:hover {
    text-decoration: underline;
}
.aga-table-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.aga-table-badge-yes {
    background: #d1fae5;
    color: #065f46;
}
.aga-table-badge-no {
    background: #f3f4f6;
    color: #9ca3af;
}

/* ─── No Results ─── */
.aga-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
    font-size: 15px;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .aga-filter-grid {
        grid-template-columns: 1fr;
    }
    .aga-card-body {
        grid-template-columns: 1fr;
    }
    .aga-results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .aga-sort-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .aga-search-btn {
        width: 100%;
    }
    .aga-reset-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }
}
