/* =============================================================
   ManyPerson — 공통 CSS
   모든 mock 페이지에서 공유하는 변수, 리셋, 헤더, 카드, 탭, 푸터
   ============================================================= */

/* ===== CSS 변수 ===== */
:root {
    --primary: #007fff;
    --ivory: #fdfcf8;
    --charcoal: #1a1a1a;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --blue-400: #60a5fa;
    --blue-600: #2563eb;
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-400: #f87171;
    --red-500: #ef4444;
    --emerald-50: #ecfdf5;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --amber-700: #b45309;
    --orange-500: #f97316;
    --pink-100: #fce7f3;
    --pink-500: #ec4899;
    --violet-100: #ede9fe;
    --violet-500: #8b5cf6;
    --danger: #ef4444;
}

/* ===== 리셋 & 기본 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overscroll-behavior-y: none;
}

body {
    background-color: var(--ivory);
    font-family: 'Inter', sans-serif;
    color: var(--charcoal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    line-height: 1.5;
    overscroll-behavior-y: none;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    cursor: pointer;
    background: none;
    font-family: inherit;
}

textarea {
    font-family: inherit;
}

/* ===== 헤더 (공통) ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}
@media (min-width: 1024px) {
    .header { padding: 1rem 4rem; }
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo-icon {
    width: 2.25rem;
    height: 2.25rem;
    background-color: var(--primary);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(0, 127, 255, 0.2);
}
.header-logo-icon .material-symbols-outlined { font-size: 1.25rem; }

.header-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* 로고 이미지 (SVG) */
.header-logo-img {
    height: 2.25rem;
    width: auto;
    display: block;
}

/* 헤더 네비게이션 */
.header-nav {
    display: none;
    align-items: center;
    gap: 2rem;
}
@media (min-width: 768px) {
    .header-nav { display: flex; }
}

.header-nav a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-500);
    transition: color 0.2s;
}
.header-nav a:hover { color: var(--primary); }
.header-nav a.active {
    font-weight: 600;
    color: var(--primary);
}

/* 헤더 액션 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* 공통 버튼: 새 시뮬레이션 */
.btn-new-sim {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary);
    color: #fff;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 10px 15px -3px rgba(0, 127, 255, 0.2);
    transition: all 0.2s;
}
.btn-new-sim:hover { background-color: rgba(0, 127, 255, 0.9); }
.btn-new-sim .material-symbols-outlined { font-size: 1.125rem; }
@media (min-width: 640px) {
    .btn-new-sim { display: inline-flex; }
}

/* ===== 아바타 드롭다운 ===== */
.header-avatar-dropdown {
    position: relative;
}

/* 드롭다운 트리거 버튼 (아바타 + 닉네임 + 화살표) */
.header-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--slate-600);
    white-space: nowrap;
    padding: 0.375rem 0.5rem;
    border-radius: 0.625rem;
    transition: background 0.15s;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}
.header-profile-btn:hover {
    background: var(--slate-100);
}

.header-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.header-avatar .material-symbols-outlined {
    font-size: 1rem;
    color: var(--slate-400);
}
/* 소셜 로그인 프로필 이미지 — 헤더 아바타 */
.header-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.header-profile-name {
    max-width: 6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-chevron {
    font-size: 1rem !important;
    color: var(--slate-400);
    transition: transform 0.2s;
}
.header-profile-btn[aria-expanded="true"] .header-chevron {
    transform: rotate(180deg);
}

/* 드롭다운 메뉴 패널 */
.header-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 13rem;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 0.875rem;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12), 0 2px 8px -2px rgba(0, 0, 0, 0.06);
    padding: 0.375rem;
    z-index: 200;
    animation: dropdownFadeIn 0.15s ease;
}
.header-dropdown-menu.open {
    display: block;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 드롭다운 개별 항목 */
.header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-600);
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    text-align: left;
}
.header-dropdown-item .material-symbols-outlined {
    font-size: 1.125rem;
    color: var(--slate-400);
    flex-shrink: 0;
}
.header-dropdown-item:hover {
    background: var(--slate-50);
    color: var(--charcoal);
}
.header-dropdown-item:hover .material-symbols-outlined {
    color: var(--primary);
}

/* 로그아웃 항목 강조 */
.header-dropdown-logout:hover {
    background: var(--red-50);
    color: var(--red-500);
}
.header-dropdown-logout:hover .material-symbols-outlined {
    color: var(--red-500);
}

/* 구분선 */
.header-dropdown-divider {
    height: 1px;
    background: var(--slate-100);
    margin: 0.375rem 0;
}

/* form 래퍼 너비 100% 맞춤 */
.header-dropdown-menu form {
    display: block;
    width: 100%;
}

/* 로그인 버튼 */
.btn-login {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-500);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--slate-200);
    transition: all 0.2s;
}
.btn-login:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0, 127, 255, 0.05);
}
.btn-login .material-symbols-outlined { font-size: 1.125rem; }

/* ===== 카드 (공통) ===== */
.card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.6);
    overflow: hidden;
}

.card-body {
    padding: 1.5rem;
}
@media (min-width: 768px) {
    .card-body-lg { padding: 2rem; }
}

/* 카드 섹션 헤더 */
.card-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-section-header-mb {
    margin-bottom: 1.25rem;
}

.card-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-section-title .material-symbols-outlined { color: var(--primary); }
.card-section-title span:last-child {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--charcoal);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* 카드 타이틀 (result 스타일) */
.card-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-title .material-symbols-outlined {
    font-size: 1.125rem;
    color: var(--primary);
}

/* ===== 탭 그룹 (공통) ===== */
.tab-group {
    display: flex;
    background: var(--slate-100);
    border-radius: 0.5rem;
    padding: 0.25rem;
    gap: 0.125rem;
}

.tab-btn {
    padding: 0.375rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--slate-500);
    transition: color 0.2s;
}
.tab-btn:hover { color: var(--charcoal); }
.tab-btn.active,
.tab-btn-active {
    background: #fff;
    color: var(--charcoal);
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ===== 푸터 (공통) ===== */
.footer {
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    padding: 2rem 0;
    background: rgba(255, 255, 255, 0.5);
}

.footer-inner {
    max-width: 56rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: var(--slate-400);
    font-size: 0.75rem;
}
@media (min-width: 768px) {
    .footer-inner { flex-direction: row; }
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}
.footer-links a { transition: color 0.2s; }
.footer-links a:hover { color: var(--primary); }

.footer-company {
    text-align: center;
}
@media (min-width: 768px) {
    .footer-company { text-align: left; }
}

.footer-company-info {
    font-size: 0.6875rem;
    color: var(--slate-400);
    margin-top: 4px;
    line-height: 1.6;
}
.footer-company-info a {
    color: var(--slate-400);
    text-decoration: underline;
    transition: color 0.2s;
}
.footer-company-info a:hover {
    color: var(--primary);
}

/* ===== 공통 뱃지 ===== */
.badge-web {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(0, 127, 255, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.badge-ai {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--emerald-600);
    background: var(--emerald-50);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

/* AI 생성 면책 고지 배지 */
.badge-disclaimer {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--amber-700);
    opacity: 0.75;
    white-space: nowrap;
}

/* ===== 공통 버튼 ===== */
.btn-edit {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.btn-edit:hover { text-decoration: underline; }
.btn-edit .material-symbols-outlined { font-size: 0.875rem; }

/* 공통 태그 */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--slate-500);
    padding: 0.25rem 0.625rem;
    border-radius: 0.5rem;
    border: 1px solid var(--slate-100);
}
.tag-white { background: #fff; border-color: rgba(226, 232, 240, 0.6); }
.tag-slate { background: rgba(241, 245, 249, 1); }
.tag .material-symbols-outlined { font-size: 0.75rem; }
