/* ------------------------------
   기본 설정
------------------------------ */
* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --line-strong: #d1d5db;

    --primary: #111827;
    --primary-hover: #000000;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;

    --danger: #dc2626;
    --danger-hover: #b91c1c;

    --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.14);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Pretendard", "Noto Sans KR", Arial, sans-serif;
    background:
        radial-gradient(circle at top, #ffffff 0%, #f4f6fb 45%, #eef2f7 100%);
    color: var(--text);
    line-height: 1.55;
}

/* ------------------------------
   공통 요소
------------------------------ */
a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 34px 22px 60px;
}

/* ------------------------------
   네비게이션
------------------------------ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    background: rgba(17, 24, 39, 0.94);
    color: #ffffff;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.logo {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.navbar > div:last-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar a,
.navbar button {
    margin-left: 0;
    color: #ffffff;
    background: transparent;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.navbar a:hover,
.navbar button:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.10);
}

/* ------------------------------
   카드 / 레이아웃
------------------------------ */
.card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
}

.page-header h1,
.card h1,
.card h2 {
    margin: 0;
    letter-spacing: -0.03em;
}

.page-header h1,
.card h1 {
    font-size: 28px;
    font-weight: 800;
}

.card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 18px;
}

/* ------------------------------
   폼
------------------------------ */
.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* ------------------------------
   버튼
------------------------------ */
.btn,
.btn-primary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 18px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn {
    background: var(--primary);
    color: #ffffff;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
}

/* ------------------------------
   인증 카드
------------------------------ */
.auth-card {
    max-width: 560px;
    margin: 56px auto;
    padding: 34px;
}

.auth-card h1 {
    margin-bottom: 26px;
    font-size: 26px;
}

.helper-text {
    color: var(--muted);
    font-size: 14px;
    margin-top: 10px;
}

.helper-text a {
    color: var(--accent);
    font-weight: 700;
}

/* ------------------------------
   상품/리뷰 그리드 카드
------------------------------ */
.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.product-card,
.review-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
    box-shadow: var(--shadow-sm);
    transition: all 0.22s ease;
}

.product-card:hover,
.review-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-card h3,
.review-card h3 {
    margin: 14px 0 8px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.product-card p,
.review-card p {
    margin: 6px 0;
}

/* ------------------------------
   썸네일 / 디테일 이미지
------------------------------ */
.thumb {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 14px;
    background: #eef2f7;
    border: 1px solid var(--line);
}

.preview-box,
.detail-images {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.preview-image,
.detail-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    box-shadow: var(--shadow-sm);
}

/* ------------------------------
   상세 영역
------------------------------ */
.detail-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-box h1 {
    margin-top: 4px;
    margin-bottom: 0;
    font-size: 30px;
    font-weight: 800;
}

.detail-box p {
    margin: 0;
    font-size: 15px;
}

.muted {
    color: var(--muted);
}

/* ------------------------------
   페이지네이션
------------------------------ */
.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

.pagination button {
    min-width: 80px;
    padding: 10px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#pageInfo {
    font-weight: 700;
    color: var(--muted);
}

/* ------------------------------
   파일 입력 약간 정리
------------------------------ */
input[type="file"] {
    padding: 10px;
    background: #fafafa;
}

/* ------------------------------
   링크 버튼 느낌 보정
------------------------------ */
a.btn,
a.btn-primary,
a.btn-danger {
    text-decoration: none;
}

/* ------------------------------
   상품 등록 페이지 전용
------------------------------ */
.product-create-card {
    max-width: 860px;
    margin: 0 auto;
}

.product-create-form {
    gap: 20px;
}

.product-create-form textarea {
    min-height: 140px;
}

.product-create-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.product-create-actions .btn,
.product-create-actions .btn-primary {
    min-width: 120px;
}

@media (max-width: 768px) {
    .product-create-card {
        max-width: 100%;
    }

    .product-create-actions {
        flex-direction: column;
    }

    .product-create-actions .btn,
    .product-create-actions .btn-primary {
        width: 100%;
    }
}

/* ------------------------------
   리뷰 / 인터렉션 영역 개선
------------------------------ */

/* 리뷰 박스 전체 크기 정리 */
.review-box {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

/* 리뷰 한 개 카드 내부 블록 */
.review-item {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfd;
}

/* 리뷰 상단 */
.review-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.review-top strong {
    font-size: 15px;
    font-weight: 800;
}

.review-content {
    margin: 8px 0 10px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    word-break: break-word;
}

/* 액션 버튼 줄 */
.review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 10px;
}

/* 공통 액션 버튼 */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #f3f4f6;
    border-color: #cbd5e1;
}

/* 버튼 안 텍스트 */
.action-label {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* 버튼 안 숫자 */
.action-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
}

/* 신고 버튼은 숫자 없음 */
.report-action-btn .action-label {
    color: #b91c1c;
}

/* 댓글 작성 폼 */
.comment-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.comment-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
}

.comment-input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.comment-btn {
    height: 38px;
    padding: 0 14px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.comment-btn:hover {
    background: var(--primary-hover);
}

/* 댓글 목록 */
.comment-list {
    margin-top: 10px;
    padding-top: 6px;
}

.comment-item {
    padding: 8px 0;
    border-top: 1px solid #eceff3;
    font-size: 14px;
}

.comment-item strong {
    font-weight: 800;
    color: var(--text);
}

.comment-item .muted {
    font-size: 13px;
}

/* 상품 카드 안 내용이 너무 길어질 때 정리 */
.product-card .review-box h4 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 800;
}

footer{
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}


.ai-analyze-btn {
    margin-top: 12px;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background-color: #2563eb;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.ai-analyze-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ai-result-box {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #f8fafc;
}

.ai-result-inner p {
    margin: 6px 0;
}

.ai-similar-review-list {
    margin-top: 10px;
    padding-left: 18px;
}

.ai-similar-review-item {
    margin-bottom: 12px;
}

.ai-analyze-btn {
    margin-top: 12px;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background-color: #2563eb;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.ai-analyze-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ai-result-box {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #f8fafc;
}

.ai-result-inner p {
    margin: 6px 0;
}

.ai-similar-review-list {
    margin-top: 10px;
    padding-left: 18px;
}

.ai-similar-review-item {
    margin-bottom: 12px;
}

/* [추가] 리뷰 목록 상단 안내 문구 */
.review-guide-box {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.review-guide-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #1e3a8a;
}

/* [추가] AI 결과 내 보조 안내 문구 */
.ai-sub-guide {
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.ai-analyze-btn {
    margin-top: 12px;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background-color: #2563eb;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.ai-analyze-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ai-result-box {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #f8fafc;
}

.ai-result-inner p {
    margin: 6px 0;
}

.ai-similar-review-list {
    margin-top: 10px;
    padding-left: 18px;
}

.ai-similar-review-item {
    margin-bottom: 12px;
}

/* [추가] 리뷰 목록 상단 안내 문구 */
.review-guide-box {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.review-guide-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #1e3a8a;
}

/* [추가] AI 결과 내 보조 안내 문구 */
.ai-sub-guide {
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .review-actions {
        gap: 6px;
    }

    .action-btn {
        width: 100%;
        justify-content: space-between;
    }

    .comment-form {
        flex-direction: column;
    }

    .comment-btn {
        width: 100%;
    }
}

/* ------------------------------
   반응형
------------------------------ */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .container {
        padding: 26px 18px 50px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 18px;
    }

    .navbar > div:last-child {
        flex-wrap: wrap;
        gap: 8px;
    }

    .container {
        padding: 22px 14px 40px;
    }

    .card {
        padding: 20px;
        border-radius: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .thumb {
        height: 220px;
    }

    .preview-image,
    .detail-image {
        width: 110px;
        height: 110px;
    }

    .auth-card {
        margin: 28px auto;
        padding: 24px;
    }
}
