/* ============================================
   main.css — 리셋 + 레이아웃 + 반응형
   ============================================ */

/* 리셋 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
fieldset { border: none; }
a { text-decoration: none; color: inherit; }

/* 앱 컨테이너 */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* 헤더 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  height: var(--header-height);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header__date {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}

.header__right {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.header__install {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: opacity var(--transition-fast);
}

.header__install:active {
  opacity: 0.7;
}

.header__weather {
  font-size: var(--font-size-lg);
}

/* 화면 영역 */
.screens {
  flex: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom) + var(--spacing-md));
}

.screen {
  display: none;
  padding: 0 var(--spacing-lg) var(--spacing-lg);
  animation: fadeIn var(--transition-normal);
}

.screen--active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

/* 하단 탭 바 */
.tab-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--tab-height);
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  flex: 1;
}

.tab-btn__icon {
  font-size: 1.4rem;
}

.tab-btn__label {
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.tab-btn--active {
  color: var(--color-primary);
}

.tab-btn--active .tab-btn__label {
  font-weight: 700;
}

/* 반응형: 태블릿 이상 */
@media (min-width: 481px) {
  .app {
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
  }
}

@media (min-width: 768px) {
  html { font-size: 18px; }
}
