/* LOST ZERO - Stripe-inspired Design System */

/* Import Inter font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* CSS Variables - Stripe Color System */
:root {
  /* Primary Colors */
  --primary: #635BFF;
  --primary-dark: #3F4EF2;
  --primary-light: #E6E8FF;
  
  /* Text Colors */
  --text-main: #0A2540;
  --text-sub: #8792A2;
  --text-white: #FFFFFF;
  
  /* Background Colors */
  --bg-white: #FFFFFF;
  --bg-light: #F6F9FC;
  --bg-dark: #0A2540;
  
  /* Border & Divider */
  --border: #E3E8EE;
  --border-light: #F6F9FC;
  
  /* Status Colors */
  --success: #24B47E;
  --warning: #F6A609;
  --error: #CD3D64;
  
  /* Shadows - 공공기관 최적화: 더 부드럽고 신뢰감 있는 그림자 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  /* Spacing */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  
  /* Transitions - 공공기관 최적화: 애니메이션 최소화 */
  --transition: 100ms ease-out;
  --transition-slow: 200ms ease-out;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1 {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.4;
}

h4 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
}

p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-main);
  font-weight: 400;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.logo span {
  color: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-sub);
  transition: color var(--transition);
}

.nav-link:hover {
  color: var(--text-main);
}

/* Language Selector */
.language-selector {
  position: relative;
}

.language-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition);
}

.language-button:hover {
  background: var(--bg-light);
  border-color: var(--primary-light);
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
}

.language-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-option {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  transition: background var(--transition);
}

.language-option:hover {
  background: var(--bg-light);
}

.language-option.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-light);
  border-color: var(--primary-light);
}

.btn-large {
  padding: 16px 32px;
  font-size: 18px;
}

/* Hero Section - 공공기관 최적화: 그라데이션 제거, 단색 배경 */
.hero {
  padding: var(--space-3xl) 0;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

.hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero h1 {
  margin-bottom: var(--space-md);
  color: var(--text-main);
  font-weight: 700;
}

.hero-subtitle {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.hero-description {
  font-size: 20px;
  color: var(--text-main);
  margin-bottom: var(--space-xl);
  line-height: 1.7;
  font-weight: 400;
}

.hero-cta {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.stat-card {
  text-align: center;
  padding: var(--space-lg);
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: 16px;
  color: var(--text-main);
  font-weight: 500;
}

/* Section */
.section {
  padding: var(--space-3xl) 0;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--space-2xl);
}

.section-title {
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  font-size: 20px;
  color: var(--text-main);
  font-weight: 400;
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Card */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition);
  border: 1px solid var(--border);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--primary);
  margin-bottom: var(--space-md);
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: var(--space-sm);
}

.card-description {
  font-size: 16px;
  color: var(--text-main);
  line-height: 1.7;
  font-weight: 400;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: var(--space-3xl) 0;
  text-align: center;
  color: var(--text-white);
}

.cta-section h2 {
  color: var(--text-white);
  margin-bottom: var(--space-sm);
}

.cta-section p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  margin-bottom: var(--space-xl);
}

.cta-section .btn-primary {
  background: var(--bg-white);
  color: var(--primary);
}

.cta-section .btn-primary:hover {
  background: var(--bg-light);
}

/* Footer */
.footer {
  background: var(--bg-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-2xl) 0 var(--space-lg);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-about {
  max-width: 400px;
}

.footer-about h3 {
  color: var(--text-white);
  margin-bottom: var(--space-sm);
}

.footer-section h4 {
  color: var(--text-white);
  margin-bottom: var(--space-sm);
  font-size: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-xs);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--text-white);
}

.footer-bottom {
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 14px;
}

/* Mobile Hamburger Menu */
.mobile-menu-button {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-button span {
  width: 24px;
  height: 2px;
  background: var(--text-main);
  transition: all var(--transition);
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
  /* Typography */
  h1 {
    font-size: 36px;
  }
  
  h2 {
    font-size: 28px;
  }
  
  h3 {
    font-size: 22px;
  }
  
  p {
    font-size: 16px;
  }
  
  /* Container */
  .container, .container-wide {
    padding: 0 var(--space-sm);
  }
  
  /* Header */
  .header-content {
    height: 64px;
  }
  
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  
  .nav.active {
    display: flex;
  }
  
  .nav-link {
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
  }
  
  .mobile-menu-button {
    display: flex;
  }
  
  /* Hero */
  .hero {
    padding: var(--space-2xl) 0;
  }
  
  .hero-subtitle {
    font-size: 18px;
  }
  
  .hero-description {
    font-size: 16px;
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  .hero-cta .btn {
    width: 100%;
  }
  
  /* Stats */
  .stats {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  
  .stat-value {
    font-size: 36px;
  }
  
  /* Section */
  .section {
    padding: var(--space-2xl) 0;
  }
  
  .section-subtitle {
    font-size: 16px;
  }
  
  /* Grid */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  /* Card */
  .card {
    padding: var(--space-md);
  }
  
  /* CTA Section */
  .cta-section {
    padding: var(--space-2xl) 0;
  }
  
  .cta-section p {
    font-size: 16px;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  /* Buttons */
  .btn {
    width: 100%;
    padding: 14px 24px;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-primary {
  color: var(--primary);
}

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

.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }

/* ========================================
   CHATBOT STYLES
   ======================================== */

/* Chatbot Button - Fixed at bottom right */
#chatbot-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  background: #FF8A00;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 100ms ease-out, box-shadow 100ms ease-out;
}

#chatbot-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 138, 0, 0.3);
}

#chatbot-button:active {
  transform: translateY(0);
}

#chatbot-button svg {
  width: 32px;
  height: 32px;
  color: white;
}

/* Chatbot Panel */
#chatbot-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 420px;
  max-height: 600px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#chatbot-panel.active {
  display: flex;
}

/* Chatbot Header */
.chatbot-header {
  background: #FF8A00;
  color: white;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.chatbot-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: background 100ms ease-out;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Chatbot Content */
.chatbot-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Question List View */
.question-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.question-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 100ms ease-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.question-item:hover {
  border-color: #FF8A00;
  box-shadow: var(--shadow-sm);
}

.question-item-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  margin: 0;
  flex: 1;
}

.question-item-icon {
  width: 20px;
  height: 20px;
  color: var(--text-sub);
  flex-shrink: 0;
  margin-left: 12px;
}

/* Answer View */
.answer-view {
  display: none;
}

.answer-view.active {
  display: block;
}

.answer-back {
  background: transparent;
  border: none;
  color: #FF8A00;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 100ms ease-out;
}

.answer-back:hover {
  opacity: 0.8;
}

.answer-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.answer-content {
  font-size: 16px;
  color: #333333;
  line-height: 1.7;
  margin: 0;
}

/* Pagination */
.chatbot-pagination {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pagination-button {
  background: white;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 100ms ease-out;
}

.pagination-button:hover:not(:disabled) {
  border-color: #FF8A00;
  color: #FF8A00;
  box-shadow: var(--shadow-sm);
}

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

.pagination-info {
  font-size: 14px;
  color: var(--text-sub);
  font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #chatbot-button {
    width: 56px;
    height: 56px;
    bottom: 16px;
    right: 16px;
  }
  
  #chatbot-button svg {
    width: 28px;
    height: 28px;
  }
  
  #chatbot-panel {
    width: calc(100vw - 32px);
    max-width: 420px;
    right: 16px;
    bottom: 84px;
    max-height: calc(100vh - 120px);
  }
  
  .chatbot-header h3 {
    font-size: 18px;
  }
  
  .chatbot-content {
    padding: 16px;
  }
  
  .question-item {
    padding: 14px 16px;
  }
  
  .question-item-title {
    font-size: 15px;
  }
  
  .answer-title {
    font-size: 18px;
  }
  
  .answer-content {
    font-size: 15px;
  }
  
  .chatbot-pagination {
    padding: 12px 16px;
  }
  
  .pagination-button {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .pagination-info {
    font-size: 13px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  #chatbot-panel {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 76px;
  }
}

/* =========================
   Global "Go Home" Button
   ========================= */
.btn-go-home {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999;
    padding: 12px 24px;
    background: #635BFF;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(99, 91, 255, 0.3);
    transition: all 100ms ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-go-home:hover {
    background: #5048E5;
    box-shadow: 0 8px 24px rgba(99, 91, 255, 0.4);
    transform: translateY(-2px);
}

.btn-go-home:active {
    transform: translateY(0);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .btn-go-home {
        bottom: 80px; /* 챗봇 버튼 위로 */
        left: 16px;
        padding: 10px 20px;
        font-size: 14px;
        min-height: 44px; /* 접근성 기준 */
    }
}

/* PC 버전 */
@media (min-width: 769px) {
    .btn-go-home {
        bottom: 24px;
        left: 24px;
    }
}

/* =========================
   Detail Page Enhancements
   ========================= */

/* "내 물건으로 신고" 버튼 */
#btn-report-myitem {
    width: 100%;
    font-size: 16px;
    padding: 16px;
    background: #635BFF;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 100ms ease-out;
}

#btn-report-myitem:hover:not(:disabled) {
    background: #5048E5;
    box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3);
}

#btn-report-myitem:disabled {
    background: #B8B8C7;
    cursor: not-allowed;
    opacity: 0.6;
}

#btn-report-myitem:active:not(:disabled) {
    transform: scale(0.98);
}

/* 상태별 버튼 색상 */
#btn-report-myitem.status-completed {
    background: #24B47E;
    cursor: not-allowed;
}

#btn-report-myitem.status-pending {
    background: #F6A609;
    cursor: wait;
}

/* 경고 메시지 스타일 */
#btn-warning-msg {
    animation: fadeIn 200ms ease-out;
}

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

/* =========================
   Accessibility
   ========================= */
.btn-go-home:focus,
#btn-report-myitem:focus {
    outline: 3px solid #FFD700;
    outline-offset: 2px;
}

/* 고대비 모드 */
@media (prefers-contrast: high) {
    .btn-go-home,
    #btn-report-myitem {
        border: 2px solid currentColor;
    }
}

/* 애니메이션 축소 모드 */
@media (prefers-reduced-motion: reduce) {
    .btn-go-home,
    #btn-report-myitem,
    #btn-warning-msg {
        transition: none;
        animation: none;
    }
}
