@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-app: #0f172a;
  --bg-surface: rgba(30, 41, 59, 0.75);
  --bg-card: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border-light: rgba(255, 255, 255, 0.1);

  --font-main: 'Pretendard', sans-serif;
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
}

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

/* Layout Containers */

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  position: relative;
  background-image: radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.05) 0px, transparent 50%), radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.03) 0px, transparent 50%);
}

.main-content {
  flex: 1;
  padding: 1.25rem;
  width: 100%;
  max-width: 1400px; /* PC에서도 전체가 너무 퍼지지 않게 적절한 상한선 부여 */
  margin: 0 auto;
}

/* PC Sidebar Style (Applied via Media Query in Layout/CSS) */

.pc-sidebar {
  display: none; /* Mobile 기본 숨김 */
  width: 280px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-light);
  flex-direction: column;
  padding: 2rem 1.5rem;
  z-index: 1001;
}

@media (min-width: 1024px) {
  .app-container {
    flex-direction: row; /* PC에서는 가로 배치 */
  }
  
  .pc-sidebar {
    display: flex; /* PC 버전 노출 */
  }

  .main-content {
    margin-left: 280px; /* 사이드바 공간 확보 */
    padding: 2rem 3rem;
  }

  .bottom-nav {
    display: none !important; /* PC에서는 하단바 숨김 */
  }

  .header.mobile-only {
    display: none !important; /* PC에서는 상단 모바일 헤더 숨김 (사이드바에 통합) */
  }
}

@media (max-width: 1023px) {
  .main-content {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
  }
  
  .app-container {
    max-width: 100%;
  }

  /* 모바일에서 모바일 전용 래퍼 느낌을 주고 싶다면 여기에 제약 추가 가능 (현재는 전체화면) */
}

/* Navigation Items (Shared) */

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  color: var(--text-muted);
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.sidebar-nav-item {
  margin-bottom: 0.4rem;
}

.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: white;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-icon {
  font-size: 1.3rem;
}

/* Bottom Nav (Mobile Specific) */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  padding: 0.6rem 0.5rem;
  z-index: 1000;
  padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
}

.bottom-nav .nav-item {
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.4rem;
  border-radius: 10px;
  font-size: 0.65rem;
  background: transparent !important;
  box-shadow: none !important;
}

.bottom-nav .nav-item.active {
  color: var(--primary);
}

.bottom-nav .nav-icon {
  font-size: 1.4rem;
}

/* Components */

.premium-card {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-glass);
  padding: 1.2rem;
  transition: all 0.3s ease;
}

/* PC Hover Effect */

@media (hover: hover) {
  .premium-card-hover:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    background: rgba(30, 41, 59, 0.9);
  }
}

.premium-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: white;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.25);
}

@media (hover: hover) {
  .premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
  }
}

/* Scrollbar Custom */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.input-premium {
  width: 100%;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-premium:focus {
  border-color: var(--primary);
}

/* Progress Bar Checkbox UI */

.progress-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  margin: 1.5rem 0;
  padding: 0 5px;
}

.progress-track {
  position: absolute;
  top: 12px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: var(--border-light);
  z-index: 0;
}

.progress-track-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  width: 25%;
  gap: 0.4rem;
}

.progress-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--bg-app);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.3s;
}

.progress-step.checked .progress-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.progress-step.final-step.checked .progress-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.progress-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
  word-break: keep-all;
  line-height: 1.3;
}

.progress-step.checked .progress-label {
  color: white;
}

/* Tools */

.custom-file-upload {
  display: inline-block;
  padding: 1rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border-light);
  border-radius: 12px;
  text-align: center;
  width: 100%;
}

.preview-img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-top: 0.8rem;
  border: 1px solid var(--border-light);
}

/* 전체 사진 잘림 방지 강제 적용 */

.preview-img { object-fit: contain !important; background-color: rgba(0,0,0,0.3) !important; max-height: 450px !important; }
