/* 광고입찰가 페이지 전용 스타일 */

/* 광고입찰가 검색 컨테이너 */
.ab-search-container {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.8);
}

/* 입력 섹션 */
.ab-input-section {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

/* 텍스트 입력 그룹 */
.ab-text-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 라벨과 체크박스를 담는 헤더 */
.ab-label-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* 입력 컨테이너 */
.ab-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

/* 입력 라벨 */
.ab-input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0;
}

.ab-input-icon {
    color: var(--primary-color);
    font-size: 0.875rem;
}

/* 체크박스 섹션 */
.ab-checkbox-section {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.ab-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 400;
    cursor: pointer;
    margin: 0;
}

.ab-checkbox {
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--gray-500);
    border-radius: 0.25rem;
    background: var(--white);
    cursor: pointer;
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}

.ab-checkbox:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.ab-checkbox:checked::after {
    content: '✓';
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.ab-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.1);
}

.ab-checkbox-text {
    user-select: none;
}

/* 텍스트 입력 영역 */
.ab-text-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.96875rem;
    font-weight: 400;
    color: var(--gray-800);
    background: var(--surface-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    resize: none;
    height: 190px;
    font-family: inherit;
    line-height: 1.6;
    overflow-y: auto;
    scrollbar-width: auto;
    scrollbar-color: var(--gray-400) transparent;
}

/* 웹킷 브라우저용 스크롤바 스타일링 */
.ab-text-input::-webkit-scrollbar {
    width: 8px;
}

.ab-text-input::-webkit-scrollbar-track {
    background: transparent;
    border-radius: var(--radius-md);
}

.ab-text-input::-webkit-scrollbar-thumb {
    background-color: var(--gray-400);
    border-radius: var(--radius-md);
}

.ab-text-input::-webkit-scrollbar-thumb:hover {
    background-color: var(--gray-500);
}

.ab-text-input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.ab-text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* 버튼 행 */
.ab-button-row {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 조회하기 버튼 */
.ab-search-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    justify-content: center;
    width: 100%;
}

.ab-search-btn:hover {
    background: var(--primary-dark);
}

.ab-search-btn:active {
    transform: translateY(0);
}

.ab-search-btn i {
    font-size: 0.875rem;
}

/* 반응형 디자인 */

/* 1200px 이하 */
@media (max-width: 1200px) {
    .ab-search-container {
        padding: 1rem;
    }
    
    .ab-text-input-group {
        gap: 0.75rem;
    }
    
    .ab-input-label {
        font-size: 0.96875rem;
    }
    
    .ab-text-input {
        height: 180px;
        font-size: 0.9375rem;
    }
    
    .ab-checkbox-item {
        font-size: 0.8125rem;
    }
    
    .ab-checkbox {
        width: 0.9375rem;
        height: 0.9375rem;
    }
    
    .ab-checkbox:checked::after {
        font-size: 0.6875rem;
    }
}

/* 900px 이하 */
@media (max-width: 900px) {
    .ab-search-container {
        padding: 1rem;
        margin-bottom: 2rem;
    }
    
    .ab-input-section {
        gap: 0.625rem;
    }
    
    .ab-text-input-group {
        gap: 0.75rem;
    }
    
    .ab-input-label {
        font-size: 0.953125rem;
    }
    
    .ab-text-input {
        height: 170px;
        padding: 0.875rem;
        font-size: 0.9375rem;
    }
    
    .ab-search-btn {
        padding: 0.625rem 1.125rem;
        font-size: 0.9rem;
    }
    
    .ab-checkbox-item {
        font-size: 0.78125rem;
    }
    
    .ab-checkbox {
        width: 0.875rem;
        height: 0.875rem;
    }
    
    .ab-checkbox:checked::after {
        font-size: 0.625rem;
    }
}

/* 768px 이하 */
@media (max-width: 768px) {
    .ab-search-container {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .ab-input-section {
        gap: 0.5rem;
    }
    
    .ab-text-input-group {
        gap: 0.625rem;
    }
    
    .ab-checkbox-section {
        gap: 0.625rem;
    }
    
    .ab-input-label {
        font-size: 0.9375rem;
    }
    
    .ab-text-input {
        height: 150px;
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .ab-search-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .ab-checkbox-item {
        font-size: 0.75rem;
    }
    
    .ab-checkbox {
        width: 0.8125rem;
        height: 0.8125rem;
    }
    
    .ab-checkbox:checked::after {
        font-size: 0.5625rem;
    }
}

/* 480px 이하 */
@media (max-width: 480px) {
    .ab-search-container {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .ab-input-section {
        gap: 0.5rem;
    }
    
    .ab-text-input-group {
        gap: 0.5rem;
    }
    
    .ab-checkbox-section {
        gap: 0.5rem;
    }
    
    .ab-input-label {
        font-size: 0.875rem;
    }
    
    .ab-text-input {
        height: 140px;
        padding: 0.625rem;
        font-size: 0.8125rem;
    }
    
    .ab-search-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .ab-checkbox-item {
        font-size: 0.6875rem;
    }
    
    .ab-checkbox {
        width: 0.75rem;
        height: 0.75rem;
    }
    
    .ab-checkbox:checked::after {
        font-size: 0.5rem;
    }
}

/* 광고입찰가 테이블 스타일 (키워드 대량 조회 테이블과 동일) */

/* 테이블 컨테이너 */
.ab-table-container {
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.8);
    margin-bottom: 2rem;
    background: var(--surface-color);
    display: block;
    overflow: hidden; /* 스크롤 영역이 컨테이너 경계를 벗어나지 않도록 함 */
}

/* 테이블 스크롤 영역 */
.ab-table-scroll {
    overflow: auto;
}

/* 테이블 */
.ab-results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    background: var(--surface-color);
}

.ab-results-table th {
    background: #e2e8f0;
    padding: 0.625rem 0.875rem;
    text-align: center;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-300);
    border-right: 1px solid var(--gray-300);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1003;
    font-size: 0.875rem;
}

.ab-results-table th:last-child {
    border-right: none;
}

.ab-results-table td {
    padding: 0.25rem 0.875rem;
    border-bottom: 1px solid var(--gray-100);
    border-right: 1px solid var(--gray-100);
    color: var(--gray-700);
    white-space: nowrap;
    vertical-align: middle;
    font-size: 0.875rem;
    line-height: 1.2;
    text-align: center;
}

.ab-results-table td:last-child {
    border-right: none;
}

.ab-results-table tbody tr {
    transition: all 0.15s ease;
}

.ab-results-table tbody tr:hover {
    background: rgba(30, 64, 175, 0.03);
}

.ab-results-table tr:last-child td {
    border-bottom: none;
}

/* 키워드 열 스타일 (좌측 정렬) */
.ab-results-table td:nth-child(1) {
    font-weight: 600;
    color: var(--gray-700);
    text-align: left;
}

/* PC 1위~5위, MB 1위~5위 열 스타일 (font-weight 500 적용) */
.ab-results-table td:nth-child(11),
.ab-results-table td:nth-child(12),
.ab-results-table td:nth-child(13),
.ab-results-table td:nth-child(14),
.ab-results-table td:nth-child(15),
.ab-results-table td:nth-child(16),
.ab-results-table td:nth-child(17),
.ab-results-table td:nth-child(18),
.ab-results-table td:nth-child(19),
.ab-results-table td:nth-child(20) {
    font-weight: 500;
}

/* 조회 아이콘 (블로그 분석의 진단 아이콘과 동일) */
.ab-explore-icon {
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ab-explore-icon:hover {
    color: var(--white);
    background: var(--primary-color);
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.3);
}

/* 1200px 브레이크포인트 */
@media (max-width: 1200px) {
    .ab-results-table th {
        padding: 0.5625rem 0.8125rem;
        font-size: 0.8438rem;
    }
    
    .ab-results-table td {
        padding: 0.25rem 0.8125rem;
        font-size: 0.8438rem;
    }
}

/* 테이블 스크롤 영역 스크롤바 스타일링 - PC에서만 표시 */
@media (min-width: 1025px) {
    .ab-table-scroll::-webkit-scrollbar {
        width: 5px;
        height: 5px;
    }

    .ab-table-scroll::-webkit-scrollbar-track {
        background: var(--gray-100);
        border-radius: 2.5px;
    }

    .ab-table-scroll::-webkit-scrollbar-thumb {
        background: var(--gray-300);
        border-radius: 2.5px;
    }

    .ab-table-scroll::-webkit-scrollbar-thumb:hover {
        background: var(--gray-400);
    }

    .ab-table-scroll::-webkit-scrollbar-corner {
        background: var(--gray-100);
    }
}

/* 태블릿에서 스크롤바 숨기기 */
@media (max-width: 1024px) {
    .ab-table-scroll::-webkit-scrollbar {
        display: none;
    }
    
    .ab-table-scroll {
        scrollbar-width: none;
    }
    
    .ab-results-table th {
        z-index: 10;
    }
}

/* 900px 브레이크포인트 */
@media (max-width: 900px) {
    .ab-results-table th {
        padding: 0.53125rem 0.78125rem;
        font-size: 0.8281rem;
    }
    
    .ab-results-table td {
        padding: 0.25rem 0.78125rem;
        font-size: 0.8281rem;
    }
    
    .ab-explore-icon {
        font-size: 1.0625rem;
        padding: 0.28125rem;
    }
}

/* 모바일에서 스크롤바 숨기기 */
@media (max-width: 768px) {
    .ab-table-scroll::-webkit-scrollbar {
        display: none;
    }
    
    .ab-table-scroll {
        scrollbar-width: none;
    }
    
    .ab-table-container {
        margin-bottom: 16px;
    }
    
    .ab-results-table {
        font-size: 0.8125rem;
    }
    
    .ab-results-table th {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .ab-results-table td {
        padding: 0.25rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .ab-explore-icon {
        font-size: 1rem;
        padding: 0.25rem;
    }
}

@media (max-width: 480px) {
    .ab-table-container {
        margin-bottom: 12px;
    }
    
    .ab-results-table {
        font-size: 0.75rem;
    }
    
    .ab-results-table th {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .ab-results-table td {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .ab-explore-icon {
        font-size: 0.875rem;
        padding: 0.1875rem;
    }
}
