/* ============================================================
   Happy My Pet - 모바일 퍼스트 앱 스타일
   ============================================================ */

:root {
    --primary: #FF6B35;
    --primary-dark: #E55A2B;
    --primary-light: #FFF0EB;
    --secondary: #2EC4B6;
    --accent: #FFD166;
    --bg: #F8F9FA;
    --surface: #FFFFFF;
    --text: #212529;
    --text-secondary: #6C757D;
    --text-light: #ADB5BD;
    --border: #E9ECEF;
    --danger: #EF4444;
    --success: #10B981;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --header-height: 56px;
    --bottom-nav-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

/* ─── 헤더 ─────────────────────────────────────────── */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.header-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-logo i {
    font-size: 1.4rem;
}

.header-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:active {
    background: var(--border);
}

.header-back {
    font-size: 1.2rem;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── 메인 콘텐츠 ─────────────────────────────────── */
.app-content {
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 8px);
    min-height: 100vh;
}

/* ─── 하단 네비게이션 ─────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    background: var(--surface);
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    padding-top: 6px;
    padding-bottom: var(--safe-bottom);
    border-top: 1px solid var(--border);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.65rem;
    font-weight: 500;
    flex: 1;
    padding: 4px 0;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item-center {
    position: relative;
    top: -12px;
}

.nav-center-btn {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.nav-item-center span {
    margin-top: 2px;
}

/* ─── 카드 ────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-body {
    padding: 16px;
}

/* ─── 돌봄 요청 카드 ─────────────────────────────── */
.care-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 0 16px 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.care-card:active {
    transform: scale(0.98);
}

.care-card-inner {
    padding: 16px;
    display: flex;
    gap: 14px;
}

.care-card-photo {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    overflow: hidden;
}

.care-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.care-card-info {
    flex: 1;
    min-width: 0;
}

.care-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.care-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.care-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.tag-species {
    background: #E8F5E9;
    color: #2E7D32;
}

.tag-type {
    background: #E3F2FD;
    color: #1565C0;
}

.tag-distance {
    background: var(--primary-light);
    color: var(--primary);
}

.tag-reward {
    background: #FFF8E1;
    color: #F57F17;
}

/* ─── 사용자 정보 바 ──────────────────────────────── */
.user-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
    flex: 1;
}

.trust-score {
    font-size: 0.75rem;
    color: var(--secondary);
    font-weight: 700;
}

/* ─── 버튼 ────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-full {
    width: 100%;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius);
}

/* ─── 폼 ──────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px; /* iOS zoom 방지 */
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.form-input::placeholder {
    color: var(--text-light);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

/* ─── 섹션 ────────────────────────────────────────── */
.section-title {
    font-size: 1.1rem;
    font-weight: 800;
    padding: 20px 16px 12px;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0 16px 12px;
}

/* ─── 배너 (홈 상단) ──────────────────────────────── */
.home-banner {
    margin: 12px 16px;
    padding: 24px 20px;
    background: linear-gradient(135deg, var(--primary), #FF8C42);
    border-radius: var(--radius);
    color: white;
}

.home-banner h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.home-banner p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 14px;
}

.home-banner .btn {
    background: white;
    color: var(--primary);
    font-weight: 700;
    padding: 10px 20px;
    font-size: 0.85rem;
}

/* ─── 빈 상태 ─────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 32px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.empty-state p {
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ─── 로그인/회원가입 ─────────────────────────────── */
.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height));
    padding: 32px 24px;
}

.auth-logo {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.auth-form {
    width: 100%;
    max-width: 360px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--text-light);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-kakao {
    background: #FEE500;
    color: #191919;
    font-weight: 700;
}

.btn-google {
    background: var(--surface);
    color: var(--text);
    border: 1.5px solid var(--border);
    font-weight: 600;
}

.auth-link {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* ─── 유틸리티 ────────────────────────────────────── */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.gap-2 { gap: 8px; }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }

/* ─── 토스트 알림 ─────────────────────────────────── */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ─── 가로 스크롤 유틸 (홈 등) ───────────────── */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { scrollbar-width: none; }
