/* ==========================================================================
   요양24 - Main Stylesheet
   Korean Elderly Care Facility Search Platform
   Mobile-first design | No frameworks
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Brand Colors */
  --primary: #2563EB;
  --primary-light: #DBEAFE;
  --primary-dark: #1D4ED8;
  --secondary: #10B981;
  --secondary-light: #D1FAE5;
  --accent: #F59E0B;
  --accent-light: #FEF3C7;

  /* Text */
  --text: #1F2937;
  --text-light: #374151;
  --subtext: #6B7280;
  --text-inverse: #FFFFFF;

  /* Surfaces */
  --bg: #F9FAFB;
  --bg-elevated: #FFFFFF;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --divider: #E5E7EB;

  /* Feedback */
  --error: #EF4444;
  --error-light: #FEE2E2;
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  /* Grade Colors */
  --grade-a: #10B981;
  --grade-b: #3B82F6;
  --grade-c: #F59E0B;
  --grade-d: #F97316;
  --grade-e: #EF4444;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;
  --radius-card: 12px;
  --radius-button: 8px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.06), 0 4px 6px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.08), 0 8px 10px rgba(0, 0, 0, 0.04);
  --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.15);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);

  /* Layout */
  --bottom-nav-height: 60px;
  --header-height: 56px;
  --container-max: 1200px;
  --sidebar-width: 240px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-header: 1000;
  --z-overlay: 1100;
  --z-modal: 1200;
  --z-bottom-sheet: 1300;
  --z-toast: 1400;
  --z-bottom-nav: 900;
}


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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
    system-ui, 'Segoe UI', Roboto, 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  padding-bottom: var(--bottom-nav-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  overflow-wrap: break-word;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  outline: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}


/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  color: var(--text);
  word-break: keep-all;
}

h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 18px; font-weight: 700; }
h4 { font-size: 16px; font-weight: 600; }
h5 { font-size: 14px; font-weight: 600; }

p {
  margin-bottom: var(--space-3);
  color: var(--text-light);
}

p:last-child { margin-bottom: 0; }

small { font-size: 13px; color: var(--subtext); }
strong { font-weight: 700; }

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 14px;
  color: var(--subtext);
  margin-bottom: var(--space-6);
}

.label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}


/* --------------------------------------------------------------------------
   Container & Section
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section {
  padding: var(--space-6) 0;
}

.section-bg {
  background-color: var(--border-light);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-more {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.section-more:hover {
  color: var(--primary-dark);
}


/* --------------------------------------------------------------------------
   Main Content Area
   -------------------------------------------------------------------------- */
.main-content {
  padding-top: var(--header-height);
  min-height: calc(100vh - var(--bottom-nav-height));
}

.page-content {
  padding-top: calc(var(--header-height) + var(--space-4));
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-4));
  min-height: 100vh;
}


/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-header);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.logo-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon svg {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 1px 2px rgba(37, 99, 235, 0.2));
}

.logo-text {
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.logo-text span {
  color: var(--primary);
  font-weight: 900;
}

/* Desktop Nav */
.desktop-nav {
  display: none;
  align-items: center;
  gap: var(--space-5);
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-light);
  text-decoration: none;
  transition: color var(--transition-fast);
  padding: var(--space-2) 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--subtext);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.header-icon:hover {
  background-color: var(--border-light);
  color: var(--text);
}

.header-icon svg {
  width: 22px;
  height: 22px;
}


/* --------------------------------------------------------------------------
   Bottom Navigation
   -------------------------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background-color: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: var(--z-bottom-nav);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0;
  min-width: 56px;
  text-decoration: none;
  color: var(--subtext);
  transition: color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

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

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

.bottom-nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav-item.active .bottom-nav-icon svg {
  stroke-width: 2.2;
}

.bottom-nav-label {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
}

.bottom-nav-item.active .bottom-nav-label {
  font-weight: 700;
}


/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
  transition: box-shadow var(--transition-base);
}

.card + .card {
  margin-top: var(--space-3);
}


/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-button);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background-color: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}
.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--text-inverse);
}

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

.btn-success {
  background-color: var(--secondary);
  color: var(--text-inverse);
  border-color: var(--secondary);
}

.btn-outline {
  background-color: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background-color: transparent;
  color: var(--subtext);
  border-color: transparent;
  min-height: 40px;
  padding: 8px 12px;
}
.btn-ghost:hover {
  background-color: var(--border-light);
  color: var(--text);
}

.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 36px; padding: 8px 16px; font-size: 13px; border-radius: 6px; }
.btn-lg { min-height: 56px; padding: 16px 32px; font-size: 17px; border-radius: var(--radius-lg); }
.btn-icon { width: 48px; min-height: 48px; padding: 0; border-radius: var(--radius-full); }
.btn-icon.btn-sm { width: 36px; min-height: 36px; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }


/* --------------------------------------------------------------------------
   Form Inputs
   -------------------------------------------------------------------------- */
.form-group { margin-bottom: var(--space-4); }

.form-group-inline {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--error);
  margin-left: 2px;
}

.form-input {
  display: block;
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 var(--space-4);
  font-size: 16px;
  color: var(--text);
  background-color: var(--bg-elevated);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder { color: #9CA3AF; }
.form-input:focus { border-color: var(--primary); box-shadow: var(--shadow-focus); }
.form-input:disabled { background-color: var(--border-light); color: var(--subtext); cursor: not-allowed; }

.form-error {
  font-size: 13px;
  color: var(--error);
  margin-top: var(--space-1);
}

.form-hint {
  font-size: 13px;
  color: var(--subtext);
  margin-top: var(--space-1);
}

/* Select */
.form-select {
  display: block;
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 40px 0 var(--space-4);
  font-size: 16px;
  color: var(--text);
  background-color: var(--bg-elevated);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.form-select:focus { border-color: var(--primary); box-shadow: var(--shadow-focus); }

.form-select-sm {
  height: 40px;
  font-size: 14px;
  padding: 0 36px 0 var(--space-3);
}

/* Textarea */
.form-textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 16px;
  color: var(--text);
  background-color: var(--bg-elevated);
  line-height: 1.6;
  resize: vertical;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-textarea::placeholder { color: #9CA3AF; }
.form-textarea:focus { border-color: var(--primary); box-shadow: var(--shadow-focus); }

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  cursor: pointer;
  padding: var(--space-2) 0;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.form-check-label {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
}


/* --------------------------------------------------------------------------
   Grade Badges
   -------------------------------------------------------------------------- */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-inverse);
  line-height: 1;
  flex-shrink: 0;
}

.grade-a { background-color: var(--grade-a); }
.grade-b { background-color: var(--grade-b); }
.grade-c { background-color: var(--grade-c); }
.grade-d { background-color: var(--grade-d); }
.grade-e { background-color: var(--grade-e); }


/* --------------------------------------------------------------------------
   Star Rating
   -------------------------------------------------------------------------- */
.stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
}

.stars-small {
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
}

.rating-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-left: var(--space-1);
}

.rating-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-left: var(--space-1);
}

.rating-big {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.rating-count,
.review-count {
  font-size: 12px;
  color: var(--subtext);
  margin-left: var(--space-1);
}

.review-count-link {
  font-size: 13px;
  color: var(--primary);
}


/* --------------------------------------------------------------------------
   Tags & Chips
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.tag--primary { background-color: var(--primary-light); color: var(--primary); }
.tag--secondary { background-color: var(--secondary-light); color: #065F46; }
.tag--accent { background-color: var(--accent-light); color: #92400E; }
.tag--neutral { background-color: var(--border-light); color: var(--subtext); }
.tag--error { background-color: var(--error-light); color: var(--error); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background-color: var(--bg-elevated);
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background-color: var(--primary); border-color: var(--primary); color: var(--text-inverse); }


/* --------------------------------------------------------------------------
   Alert
   -------------------------------------------------------------------------- */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
}

.alert-error { background-color: var(--error-light); color: var(--error); border: 1px solid var(--error); }
.alert-success { background-color: var(--success-light); color: #065F46; border: 1px solid var(--success); }
.alert-info { background-color: var(--info-light); color: #1E40AF; border: 1px solid var(--info); }


/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--space-4));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 24px;
  background-color: var(--text);
  color: var(--text-inverse);
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  z-index: var(--z-toast);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: transform var(--transition-slow), opacity var(--transition-slow);
  pointer-events: none;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast--success { background-color: var(--secondary); }
.toast--error { background-color: var(--error); }


/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-4);
  text-align: center;
}

.empty-state__icon,
.empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: var(--space-5);
  color: var(--border);
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.empty-state__desc {
  font-size: 14px;
  color: var(--subtext);
  margin-bottom: var(--space-6);
  max-width: 280px;
  line-height: 1.6;
}


/* --------------------------------------------------------------------------
   Spinner
   -------------------------------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }


/* --------------------------------------------------------------------------
   Overlay
   -------------------------------------------------------------------------- */
.overlay,
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.overlay.active,
.bottom-sheet-overlay.active {
  opacity: 1;
  visibility: visible;
}


/* --------------------------------------------------------------------------
   Divider
   -------------------------------------------------------------------------- */
.divider {
  height: 1px;
  background-color: var(--divider);
  margin: var(--space-4) 0;
  border: none;
}


/* --------------------------------------------------------------------------
   Info Table
   -------------------------------------------------------------------------- */
.info-table {
  width: 100%;
  border-collapse: collapse;
}

.info-table th,
.info-table td {
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}

.info-table th {
  font-weight: 600;
  color: var(--subtext);
  width: 100px;
  white-space: nowrap;
  background-color: var(--border-light);
}

.info-table .total-row {
  font-weight: 700;
  background-color: var(--primary-light);
}

.staff-ratio {
  font-size: 13px;
  color: var(--subtext);
}


/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */
.tabs-container { margin-bottom: var(--space-4); }

.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  background-color: var(--bg-elevated);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  padding: 14px var(--space-4);
  font-size: 15px;
  font-weight: 500;
  color: var(--subtext);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: color var(--transition-fast);
  cursor: pointer;
  background: none;
  border: none;
  text-align: center;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--primary);
  font-weight: 700;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary);
}

.tab-contents { padding: var(--space-4) 0; }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn var(--transition-base) ease; }

.mypage-tab-content { display: none; }
.mypage-tab-content.active { display: block; }


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

.text-primary { color: var(--primary) !important; }
.text-sub { color: var(--subtext) !important; }
.text-error { color: var(--error) !important; }
.text-success { color: var(--secondary) !important; }
.text-accent { color: var(--accent) !important; }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-start { display: flex; align-items: center; justify-content: flex-start; }
.flex-wrap { flex-wrap: wrap; }
.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.flex-1 { flex: 1; min-width: 0; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }

.show-mobile { display: block; }
.show-desktop { display: none; }

.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; }
.w-full { width: 100%; }
.cursor-pointer { cursor: pointer; }
.overflow-hidden { overflow: hidden; }

.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll-x::-webkit-scrollbar { display: none; }


/* --------------------------------------------------------------------------
   Responsive: Tablet (min-width: 768px)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .container { padding: 0 var(--space-6); }
  .card { padding: var(--space-6); }
  .section-title { font-size: 22px; }
}


/* --------------------------------------------------------------------------
   Responsive: Desktop (min-width: 1024px)
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }

  .header-inner { padding: 0 var(--space-7); }
  .container { padding: 0 var(--space-7); }

  .desktop-nav { display: flex; }
  .bottom-nav { display: none; }

  .show-mobile { display: none !important; }
  .show-desktop { display: block !important; }

  .main-content { padding-bottom: 0; }
  .toast { bottom: var(--space-7); }
}


/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.animate-fade-in { animation: fadeIn var(--transition-base) ease both; }
.animate-fade-in-up { animation: fadeInUp var(--transition-slow) ease both; }


/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  .header, .bottom-nav, .desktop-nav, .toast { display: none !important; }
  body { padding: 0; background: white; }
  .main-content, .page-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
