/* ==========================================================================
   Base Utilities - Helper Classes
   타이포그래피, 색상 등 유틸리티 클래스
   ========================================================================== */

/* ===== Typography Utilities ===== */
.text-xs { font-size: var(--font-size-xs); line-height: var(--line-height-normal); }
.text-sm { font-size: var(--font-size-sm); line-height: var(--line-height-normal); }
.text-md { font-size: var(--font-size-md); line-height: var(--line-height-normal); }
.text-lg { font-size: var(--font-size-md); line-height: var(--line-height-normal); }
.text-xl { font-size: var(--font-size-xl); line-height: var(--line-height-tight); }

.font-normal { font-weight: var(--font-weight-normal); }
.font-regular { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* ===== Color Utilities ===== */
.bg-youre { background-color: var(--color-bg-primary); }
.bg-youre-card { background-color: var(--color-bg-secondary); }
.bg-youre-dark { background-color: var(--color-fill-dark); }
.bg-white { background-color: var(--color-bg-white); }

.text-youre-dark { color: var(--color-text-primary); }
.text-youre-gray { color: var(--color-text-secondary); }
.text-youre-muted { color: var(--color-text-muted); }
.text-white { color: var(--color-text-inverse); }

.border-youre { border-color: var(--color-border-soft); }

/* ===== Display Utilities ===== */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }

/* ===== Position Utilities ===== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

/* ===== Flexbox Utilities ===== */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }

/* ===== Spacing Utilities ===== */
.m-0 { margin: 0; }
.p-0 { padding: 0; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-1); }
.mb-2 { margin-bottom: var(--spacing-2); }
.mb-3 { margin-bottom: var(--spacing-3); }
.mb-4 { margin-bottom: var(--spacing-4); }
.mb-section { margin-bottom: var(--spacing-section); }
.mb-section-gap { margin-bottom: var(--spacing-section-gap); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-1); }
.mt-2 { margin-top: var(--spacing-2); }
.mt-3 { margin-top: var(--spacing-3); }
.mt-4 { margin-top: var(--spacing-4); }
.mt-16 { margin-top: 64px; }
.mt-32 { margin-top: 128px; }

.ml-0 { margin-left: 0; }
.mr-0 { margin-right: 0; }

/* Negative Margins */
.-mx-4 { margin-left: calc(-1 * var(--spacing-4)); margin-right: calc(-1 * var(--spacing-4)); }
.-mx-section { margin-left: calc(-1 * var(--spacing-section)); margin-right: calc(-1 * var(--spacing-section)); }

/* Padding */
.p-2 { padding: var(--spacing-2); }
.p-4 { padding: var(--spacing-4); }

.p-section { padding: var(--spacing-section); }
.px-section { padding-left: var(--spacing-section); padding-right: var(--spacing-section); }
.py-section { padding-top: var(--spacing-section); padding-bottom: var(--spacing-section); }

/* ===== Gap Utilities ===== */
.gap-1 { gap: var(--spacing-1); }
.gap-2 { gap: var(--spacing-2); }
.gap-3 { gap: var(--spacing-3); }
.gap-4 { gap: var(--spacing-4); }
.gap-6 { gap: var(--spacing-6); }
.gap-8 { gap: var(--spacing-8); }

/* ===== Width Utilities ===== */
.w-4 { width: var(--spacing-4); }
.w-icon { width: var(--btn-icon-size); }

/* ===== Height Utilities ===== */
.min-h-48 { min-height: 192px; }
.max-w-xs { max-width: 20rem; }

/* Size Utilities */
.w-10 { width: 40px; }
.h-10 { height: 40px; }
.w-16 { width: 64px; }
.h-16 { height: 64px; }

/* ===== Z-Index Utilities ===== */
.z-1 { z-index: 1; }
.z-2 { z-index: 2; }
.z-3 { z-index: 3; }

/* ===== Border Radius Utilities ===== */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-base); }
.rounded-md { border-radius: var(--radius-lg); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ===== Text Utilities ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Cursor Utilities ===== */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* ===== Pointer Events ===== */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* ===== Shadow Utilities ===== */
.shadow-soft { box-shadow: var(--shadow-soft); }
.shadow-card { box-shadow: var(--shadow-card); }
.shadow-dropdown { box-shadow: var(--shadow-dropdown); }
.shadow-modal { box-shadow: var(--shadow-modal); }

/* ===== Transition Utilities ===== */
.transition-fast { transition: all 0.15s ease; }
.transition-normal { transition: all 0.2s ease; }
.transition-slow { transition: all 0.3s ease; }

/* ===== Opacity Utilities ===== */
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }

/* ===== Clickable Element ===== */
.clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.clickable:hover {
  transform: scale(1.05);
}

.clickable:active {
  transform: scale(0.95);
}

/* ===== Flash Messages ===== */
.flash-container {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + var(--header-height));
  left: 0;
  right: 0;
  z-index: var(--z-toast);
  padding: var(--spacing-section);
  pointer-events: none;
}

.flash-message {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-md);
  padding: var(--spacing-list-md) var(--spacing-section);
  border-radius: var(--radius-base);
  margin-bottom: var(--spacing-list-sm);
  box-shadow: var(--shadow-dropdown);
  pointer-events: auto;
  animation: flash-slide-in 0.3s ease-out;
}

.flash-notice {
  background: var(--color-success);
  color: var(--color-bg-white);
}

.flash-alert {
  background: var(--color-danger);
  color: var(--color-bg-white);
}

.flash-message.fade-out {
  animation: flash-slide-out 0.3s ease-out forwards;
}

@keyframes flash-slide-in {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes flash-slide-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-100%);
  }
}
