/**
 * 보일러 교체 비용 테마 - 컴포넌트 스타일
 */

/* ============================================
   특징 섹션 그리드
   ============================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.feature-item {
    text-align: center;
    padding: 40px 25px;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(26, 95, 122, 0.1) 0%, rgba(26, 95, 122, 0.05) 100%);
    border-radius: var(--radius-lg);
    color: var(--primary-color);
}

.feature-item h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.feature-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.6;
}

@media (max-width: 992px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-item {
        padding: 30px 20px;
    }
}

/* ============================================
   신뢰 섹션
   ============================================ */
.trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.trust-item {
    text-align: center;
    padding: 35px 25px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.trust-item:hover {
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
}

.trust-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border-radius: 50%;
    color: var(--bg-white);
}

.trust-item h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.trust-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

@media (max-width: 992px) {
    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .trust-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   가격표 스타일 개선
   ============================================ */
.brand-comparison {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.comparison-table {
    min-width: 700px;
}

.comparison-table thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    font-weight: 600;
    white-space: nowrap;
}

.comparison-table tbody td {
    vertical-align: middle;
}

.comparison-table tbody td:first-child {
    background: var(--bg-light);
}

.comparison-table tbody td:first-child strong {
    display: block;
    margin-bottom: 4px;
}

.comparison-table tbody td:first-child small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.comparison-table tbody tr:nth-child(even) td {
    background: var(--bg-light);
}

.comparison-table tbody tr:nth-child(even) td:first-child {
    background: var(--bg-gray);
}

/* 가격 강조 */
.comparison-table tbody td:not(:first-child):not(:nth-child(2)) {
    font-weight: 500;
    color: var(--primary-color);
}

/* ============================================
   계산기 결과 애니메이션
   ============================================ */
.calculator-result {
    position: sticky;
    top: 100px;
}

.result-price .price {
    transition: all 0.5s ease;
}

.result-price.updating .price {
    opacity: 0.5;
    transform: scale(0.95);
}

/* ============================================
   폼 스타일 개선
   ============================================ */
.form-group select option {
    padding: 10px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.checkbox-item:hover {
    background: var(--bg-gray);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-item input[type="checkbox"]:checked + span {
    color: var(--primary-color);
    font-weight: 500;
}

.checkbox-item:has(input:checked) {
    background: rgba(26, 95, 122, 0.1);
    border-color: var(--primary-color);
}

@media (max-width: 576px) {
    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   보조금 섹션 개선
   ============================================ */
.subsidy-highlight {
    position: relative;
    overflow: hidden;
}

.subsidy-highlight::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 50%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(15deg);
}

.eligibility-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 992px) {
    .eligibility-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .eligibility-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   정보 카드 개선
   ============================================ */
.info-card {
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
    z-index: 10;
}

.info-card:hover::before {
    transform: scaleX(1);
}

.info-card a {
    display: block;
    color: inherit;
}

.info-card a:hover {
    color: inherit;
}

/* 정보 카드 카테고리별 색상 */
.info-card-category {
    text-transform: none;
}

/* ============================================
   스크롤 애니메이션
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }
.reveal.delay-4 { transition-delay: 0.4s; }

/* ============================================
   버튼 애니메이션
   ============================================ */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   스크롤 진행 바
   ============================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ============================================
   모바일 터치 피드백
   ============================================ */
@media (hover: none) {
    .btn:active,
    .info-card:active,
    .feature-item:active,
    .fixed-btn:active {
        transform: scale(0.98);
    }
}

/* ============================================
   접근성 개선
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 포커스 스타일 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================
   스켈레톤 로딩
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-light) 25%, var(--bg-gray) 50%, var(--bg-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   토스트 알림
   ============================================ */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 16px 24px;
    background: var(--text-primary);
    color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--error-color);
}

/* ============================================
   로딩 스피너
   ============================================ */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-gray);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   다크 모드 지원 (선택적)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* 다크 모드 스타일은 추후 추가 가능 */
}

/* ============================================
   인쇄 스타일
   ============================================ */
@media print {
    .site-header,
    .fixed-sidebar,
    .fixed-bottom-bar,
    .cta-section,
    .hero-section {
        display: none !important;
    }

    .page-content {
        padding-top: 0;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* ============================================
   모바일 최적화
   ============================================ */
@media (max-width: 768px) {
    /* 터치 대상 최소 크기 */
    .btn,
    .checkbox-item,
    .info-card-link {
        min-height: 44px;
    }

    /* 가로 스크롤 방지 */
    body {
        overflow-x: hidden;
    }

    /* 텍스트 가독성 */
    body {
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
    }

    /* 이미지 최적화 */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* ============================================
   고해상도 디스플레이 최적화
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* 고해상도 디스플레이용 스타일 */
    .site-logo img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ============================================
   안전 영역 (노치 디스플레이)
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
    .fixed-bottom-bar {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .site-footer {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
}

/* ============================================
   애니메이션 감소 선호 사용자
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .hero-slide-bg {
        animation: none;
    }
}
