@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
  --primary-color: #258FFF;
  --main-color: var(--primary-color);
  --bg-light: #F2F5FA;
  --text-primary: #1A1A1A;
  --text-secondary: #6B7280;
  --safe-area-bottom: env(safe-area-inset-bottom);
  --keyboard-inset: 0px;
}

body {
  font-family: "Noto Sans KR", sans-serif;
  background-color: var(--bg-light);
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  color: var(--text-primary);
}

html,
body {
  min-height: 100%;
}

/* Container Frame */
/* Container Frame */
.app-container {
  margin: 0 auto;
  min-height: 100dvh;
  width: 100%;
  background-color: white;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--keyboard-inset);
}

/* Mobile Frame Wrapper (For NoteMain only) */
.mobile-frame-wrapper {
  margin: 0 auto;
  min-height: 100dvh;
  width: 100%;
  max-width: 430px;
  background-color: white;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {

  /* Default: Full width for standard pages */
  .app-container {
    max-width: 100%;
    margin: 0;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  /* Specific Mobile Frame Look */
  .mobile-frame-wrapper {
    margin-top: 40px;
    margin-bottom: 40px;
    min-height: 884px;
    border-radius: 2.5rem;
    overflow: hidden;
  }
}

@media (min-width: 768px) {
  body {
    padding: 40px 0;
  }


}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #f1f5f9;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

/* Main Content */
.app-main {
  flex: 1;
  padding: 1rem;
  padding-bottom: calc(88px + var(--safe-area-bottom) + var(--keyboard-inset));
  scroll-padding-bottom: calc(24px + var(--safe-area-bottom) + var(--keyboard-inset));
  -webkit-overflow-scrolling: touch;
}

body.keyboard-open .app-main {
  padding-bottom: calc(220px + var(--safe-area-bottom) + var(--keyboard-inset));
  scroll-padding-bottom: calc(160px + var(--safe-area-bottom) + var(--keyboard-inset));
}

/* Utilities */
.btn-primary {
  background-color: var(--main-color);
  color: white;
  width: 100%;
  padding: 1rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1.125rem;
  transition: all 0.2s;
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.input-base {
  width: 100%;
  padding: 1rem;
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 0.75rem;
  font-weight: 500;
  transition: border-color 0.2s;
}

.input-base:focus {
  outline: none;
  border-color: var(--main-color);
  background-color: white;
}

/* Bottom Nav */
.nav-active {
  color: var(--main-color) !important;
  font-weight: 700;
}

.nav-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.keyboard-aware-bottom-bar {
  transition: bottom 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.form-inline-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
}

.form-inline-actions > * {
  min-width: 0;
}

.form-inline-actions > button,
.form-inline-actions > a {
  flex-shrink: 0;
  white-space: nowrap;
}

.ios-single-col-grid {
  width: 100%;
}

body.keyboard-open .keyboard-aware-bottom-bar.fixed.bottom-0 {
  bottom: var(--keyboard-inset) !important;
}

body.keyboard-open .keyboard-aware-bottom-bar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + 12px));
}

body.keyboard-open .keyboard-aware-nav {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + env(safe-area-inset-bottom)));
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.keyboard-open .auth-centered-content {
  justify-content: flex-start !important;
  padding-top: 1rem;
}

@supports (-webkit-touch-callout: none) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  textarea,
  select {
    font-size: 16px !important;
    line-height: 1.4;
    scroll-margin-top: 24px;
    scroll-margin-bottom: calc(var(--keyboard-inset) + 140px);
  }

  @media (max-width: 430px) {
    .ios-single-col-grid {
      grid-template-columns: minmax(0, 1fr) !important;
    }

    .form-inline-actions > button,
    .form-inline-actions > a {
      padding-left: 0.875rem !important;
      padding-right: 0.875rem !important;
      font-size: 12px !important;
    }
  }
}
