/**
 * AI 웹체크 (AI WebCheck) - 메인 스타일시트
 * © 2026 AI Engines. All rights reserved.
 */

:root {
    --brand-primary: #4f46e5;
    --brand-primary-light: #6366f1;
    --brand-primary-soft: #eef2ff;
    --brand-secondary: #0284c7;
    --brand-secondary-soft: #f0f9ff;
    --brand-gradient: linear-gradient(135deg, #38bdf8 0%, #6366f1 50%, #a855f7 100%);
    --pastel-bg: #f8fafc;
    --surface-white: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --border-focus: #818cf8;
    
    --score-excellent: #10b981;
    --score-good: #06b6d4;
    --score-warning: #f59e0b;
    --score-danger: #ef4444;

    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    --shadow-card: 0 10px 30px -4px rgba(15, 23, 42, 0.08);
    --shadow-elevated: 0 20px 40px -10px rgba(79, 70, 229, 0.12);
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* 폰트 및 기본 세팅 */
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    background-color: var(--pastel-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    letter-spacing: -0.015em;
    -webkit-font-smoothing: antialiased;
}

/* 헤더 및 내비게이션 */
.navbar-webcheck {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    padding: 0.85rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand-logo-wrap {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.brand-logo-wrap:hover {
    transform: translateY(-1px);
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
    transition: transform 0.3s ease;
}

.brand-logo-wrap:hover .brand-icon {
    transform: rotate(5deg) scale(1.05);
}

.brand-title {
    font-weight: 800;
    font-size: 1.35rem;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.brand-badge {
    background: #eef2ff;
    color: var(--brand-primary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid #c7d2fe;
}

/* 히어로 섹션 */
.hero-section {
    padding: 4.5rem 0 3.5rem;
    background: radial-gradient(circle at 50% 10%, rgba(99, 102, 241, 0.08) 0%, rgba(56, 189, 248, 0.04) 50%, transparent 80%);
    position: relative;
}

.hero-title {
    font-weight: 900;
    font-size: clamp(2rem, 4vw, 3.2rem);
    letter-spacing: -0.03em;
    color: #0f172a;
    line-height: 1.25;
}

.hero-highlight {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 680px;
    margin: 1.2rem auto 2.5rem;
    font-weight: 400;
}

/* 검색 입력 폼 (모던 인풋 카드) */
.search-card-wrap {
    max-width: 780px;
    margin: 0 auto;
    background: var(--surface-white);
    padding: 10px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-elevated);
    border: 1px solid rgba(226, 232, 240, 0.9);
    position: relative;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.search-card-wrap:focus-within {
    box-shadow: 0 20px 45px -8px rgba(79, 70, 229, 0.22);
    border-color: var(--border-focus);
    transform: translateY(-2px);
}

.search-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-icon-prefix {
    padding-left: 18px;
    color: #94a3b8;
    font-size: 1.35rem;
}

.url-input-custom {
    border: none;
    font-size: 1.12rem;
    padding: 14px 10px;
    width: 100%;
    color: #1e293b;
    font-weight: 500;
    outline: none;
    background: transparent;
}

.url-input-custom::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.btn-analyze-submit {
    background: var(--brand-gradient);
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
    white-space: nowrap;
    transition: all 0.25s ease;
    cursor: pointer;
}

.btn-analyze-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    color: #ffffff;
}

.btn-analyze-submit:active {
    transform: translateY(1px);
}

.quick-samples {
    margin-top: 14px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.quick-sample-badge {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px;
    text-decoration: none;
    font-size: 0.82rem;
    margin: 0 3px;
    transition: all 0.2s ease;
    display: inline-block;
}

.quick-sample-badge:hover {
    background: #e0e7ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

/* 로딩 프로그레스 애니메이션 카드 */
.analysis-progress-card {
    background: var(--surface-white);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    max-width: 680px;
    margin: 2rem auto;
    text-align: center;
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.loading-spinner-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
}

.loading-spinner-ring {
    width: 100%;
    height: 100%;
    border: 4px solid #e0e7ff;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.loading-spinner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--brand-primary);
}

.progress-steps-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem auto 0;
    max-width: 440px;
    text-align: left;
}

.progress-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    font-size: 0.95rem;
    color: #64748b;
    transition: all 0.3s ease;
}

.progress-step-item.active {
    color: #1e293b;
    font-weight: 700;
}

.progress-step-item.completed {
    color: #10b981;
}

.step-icon-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

.progress-step-item.active .step-icon-indicator {
    background: #e0e7ff;
    color: #4f46e5;
    animation: pulse 1.5s infinite;
}

.progress-step-item.completed .step-icon-indicator {
    background: #d1fae5;
    color: #10b981;
}

/* 주요 피처 카드 (3대/4대 카테고리 안내) */
.feature-card {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    padding: 1.8rem 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
    height: 100%;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: #cbd5e1;
}

.feature-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
}

.feature-icon-seo { background: #e0f2fe; color: #0284c7; }
.feature-icon-content { background: #f3e8ff; color: #9333ea; }
.feature-icon-tech { background: #e0e7ff; color: #4f46e5; }
.feature-icon-access { background: #dcfce7; color: #16a34a; }
.feature-icon-ai { background: #fef3c7; color: #d97706; }

/* 리포트 대시보드 스타일 */
.report-header-card {
    background: var(--surface-white);
    border-radius: var(--radius-xl);
    padding: 2.2rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.report-header-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--brand-gradient);
}

.score-circle-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto;
}

.score-circle-svg {
    transform: rotate(-90deg);
}

.score-circle-bg {
    fill: none;
    stroke: #f1f5f9;
    stroke-width: 10;
}

.score-circle-progress {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.score-inner-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number-display {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1;
    color: #0f172a;
}

.score-label-display {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.grade-badge-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 800;
}

.grade-s { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.grade-a { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.grade-b { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.grade-c { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.grade-d { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* 카테고리별 요약 카드 4종 */
.category-metric-card {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.25s ease;
}

.category-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.cat-score-badge {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

/* AI 리포트 하이라이트 박스 */
.ai-summary-box {
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.7) 0%, rgba(240, 249, 255, 0.8) 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    margin: 1.5rem 0;
    position: relative;
}

.ai-sparkle-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--brand-primary);
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
}

/* 액션 플랜 카드 */
.action-plan-item {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    margin-bottom: 1rem;
    border-left: 5px solid;
    border-top: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
    transition: all 0.2s ease;
}

.action-plan-item:hover {
    box-shadow: var(--shadow-card);
    transform: translateX(3px);
}

.action-plan-high { border-left-color: #ef4444; }
.action-plan-medium { border-left-color: #f59e0b; }
.action-plan-low { border-left-color: #3b82f6; }

.priority-tag-high { background: #fee2e2; color: #b91c1c; font-weight: 700; font-size: 0.75rem; padding: 2px 8px; border-radius: 6px; }
.priority-tag-medium { background: #fef3c7; color: #b45309; font-weight: 700; font-size: 0.75rem; padding: 2px 8px; border-radius: 6px; }
.priority-tag-low { background: #dbeafe; color: #1d4ed8; font-weight: 700; font-size: 0.75rem; padding: 2px 8px; border-radius: 6px; }

/* 코드 스니펫 박스 */
.code-snippet-box {
    background: #0f172a;
    color: #f8fafc;
    border-radius: var(--radius-lg);
    position: relative;
    padding: 1.2rem;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.5;
}

.btn-copy-code {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s ease;
}

.btn-copy-code:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 탭 네비게이션 커스텀 */
.nav-pills-custom .nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.nav-pills-custom .nav-link.active {
    background: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* 점검 항목 체크 테이블 */
.check-table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

.status-badge-pass {
    background: #dcfce7;
    color: #15803d;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge-fail {
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge-warn {
    background: #fef3c7;
    color: #b45309;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 공통 커스텀 모달 스타일 */
.modal-webcheck .modal-content {
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.modal-webcheck .modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 1.4rem 1.8rem;
    background: #f8fafc;
}

.modal-webcheck .modal-body {
    padding: 1.8rem;
    font-size: 1.02rem;
    color: #334155;
    line-height: 1.6;
}

.modal-webcheck .modal-footer {
    border-top: 1px solid var(--border-light);
    padding: 1.2rem 1.8rem;
    background: #f8fafc;
}

.modal-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 14px;
}

.modal-icon-info { background: #e0f2fe; color: #0284c7; }
.modal-icon-success { background: #dcfce7; color: #16a34a; }
.modal-icon-warning { background: #fef3c7; color: #d97706; }
.modal-icon-error { background: #fee2e2; color: #dc2626; }

/* 토스트 알림 */
.toast-container-custom {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
}

.toast-custom {
    background: #1e293b;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    animation: slideUp 0.3s ease;
}

/* 푸터 */
.footer-webcheck {
    background: #ffffff;
    border-top: 1px solid var(--border-light);
    padding: 3.5rem 0 2rem;
    margin-top: 5rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--brand-primary);
}

/* 키프레임 애니메이션 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spin-animation {
    display: inline-block;
    animation: spin 0.9s linear infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 반응형 & 모바일 미디어 쿼리 */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 2rem;
    }

    .search-card-wrap {
        padding: 6px;
    }

    .search-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .search-icon-prefix {
        display: none;
    }

    .url-input-custom {
        padding: 12px 14px;
        font-size: 1rem;
        text-align: center;
    }

    .btn-analyze-submit {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }

    .report-header-card {
        padding: 1.5rem 1.2rem;
    }

    .score-circle-container {
        width: 120px;
        height: 120px;
    }

    .score-number-display {
        font-size: 2.2rem;
    }
}

/* 인쇄용 최적화 (오직 분석 리포트 내용만 완벽하게 독립 출력) */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 11pt !important;
    }

    /* 헤더, 푸터, 히어로 섹션, 소개 섹션, 버튼 등 홈 전체 요소 완전 제거 */
    header,
    footer,
    nav,
    .navbar-webcheck,
    .hero-section,
    .search-card-wrap,
    .quick-samples,
    #analysisProgressCard,
    #featuresSection,
    section:not(#reportPrintArea),
    .footer-webcheck,
    .no-print,
    .btn,
    .btn-copy-code,
    .btn-analyze-submit,
    .nav-pills {
        display: none !important;
    }

    /* 리포트 컨테이너만 전폭 표시 */
    #reportContainer,
    #reportPrintArea,
    .container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .report-header-card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .report-header-card::before {
        display: none !important;
    }

    /* 인쇄 시 숨겨진 탭들을 모두 펼쳐서 종합 리포트로 A4 출력 */
    .tab-content > .tab-pane {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        margin-top: 1.5rem !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .action-plan-item,
    .category-metric-card,
    .card {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .code-snippet-box {
        background: #f8fafc !important;
        color: #0f172a !important;
        border: 1px solid #cbd5e1 !important;
    }
}

/* 도메인 제목 링크 스타일 */
.domain-title-link {
    color: var(--text-dark, #1e293b);
    text-decoration: none;
    transition: color 0.15s ease;
    display: inline-flex;
    align-items: center;
}
.domain-title-link:hover {
    color: var(--brand-primary, #4f46e5);
}
.domain-title-link:hover .bi {
    color: var(--brand-primary, #4f46e5) !important;
}

/* Google reCAPTCHA 배지 숨김 (구글 공식 Invisible 모드 스타일) */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.recaptcha-notice {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.5;
}

.recaptcha-notice a {
    color: var(--brand-primary, #4f46e5);
    text-decoration: none;
    font-weight: 500;
}

.recaptcha-notice a:hover {
    text-decoration: underline;
}
