/* ========================================
   QANDA Design System v4.0
   ======================================== */

/* ========================================
   1. Design Tokens
   ======================================== */
   :root {
    /* Brand Color */
    --qanda-orange: #FF5500;
    
    /* Interface Colors - Orange Scale */
    --orange-10: #3A2C24;
    --orange-20: #6E5344;
    --orange-50: #ED5000;
    --orange-60: #FA6616;
    --orange-90: #FBDCCC;
    --orange-100: #FEF1EB;
    
    /* Interface Colors - Neutral Scale */
    --neutral-0: #121212;
    --neutral-10: #222222;
    --neutral-20: #3D3D3D;
    --neutral-30: #5D5D5D;
    --neutral-40: #7A7A7A;
    --neutral-50: #999999;
    --neutral-60: #B5B5B5;
    --neutral-70: #D0D0D0;
    --neutral-80: #F0F0F0;
    --neutral-90: #F9F9F9;
    --neutral-100: #FFFFFF;
    
    /* Semantic Colors */
    --red-50: #FB2D36;
    --red-60: #FA4F57;
    --red-90: #FED5D7;
    --blue-50: #0785F2;
    --blue-60: #1198FF;
    --green-50: #0D9974;
    --green-60: #00A87C;
    --purple-50: #7E53E3;
    --purple-60: #9B71FF;
    --yellow-50: #FFCC00;
    --yellow-60: #F0CF29;
    
    /* Typography - Font Weights */
    --font-regular: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Spacing System (8px grid) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-base: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Corner Radius System */
    --radius-none: 0px;
    --radius-small: 2px;
    --radius-medium: 5px;
    --radius-large: 8px;
    --radius-xlarge: 12px;
    --radius-xxlarge: 16px;
    --radius-full: 9999px;
    
    /* Component Specific - Buttons */
    --btn-height-xlarge: 56px;
    --btn-height-large: 48px;
    --btn-height-medium: 40px;
    --btn-height-small: 32px;
    
    /* Component Specific - Icons */
    --icon-size-default: 24px;
    --icon-stroke-width: 1.5px;
    
    /* Breakpoints */
    --breakpoint-mobile: 360px;
    --breakpoint-tablet-sm: 640px;
    --breakpoint-tablet-lg: 1024px;
    --breakpoint-desktop: 1280px;
  }
  
  /* ========================================
     2. Reset and Base Styles
     ======================================== */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html {
    background: var(--neutral-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--neutral-100);
    color: var(--neutral-10);
    max-width: 430px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  /* ========================================
     3. Typography Styles
     ======================================== */
  .large-title {
    font-size: 28px;
    line-height: 36px;
    font-weight: var(--font-bold);
  }
  
  .title1 {
    font-size: 24px;
    line-height: 32px;
    font-weight: var(--font-bold);
  }
  
  .title2 {
    font-size: 20px;
    line-height: 28px;
    font-weight: var(--font-bold);
  }
  
  .headline {
    font-size: 16px;
    line-height: 24px;
    font-weight: var(--font-semibold);
  }
  
  .headline-strong {
    font-size: 16px;
    line-height: 24px;
    font-weight: var(--font-bold);
  }
  
  .body {
    font-size: 16px;
    line-height: 24px;
    font-weight: var(--font-regular);
  }
  
  .body-strong {
    font-size: 16px;
    line-height: 24px;
    font-weight: var(--font-semibold);
  }
  
  .subheadline {
    font-size: 14px;
    line-height: 20px;
    font-weight: var(--font-regular);
    color: var(--neutral-40);
  }
  
  .subheadline-strong {
    font-size: 14px;
    line-height: 20px;
    font-weight: var(--font-semibold);
  }
  
  .footnote {
    font-size: 13px;
    line-height: 18px;
    font-weight: var(--font-regular);
  }
  
  .footnote-strong {
    font-size: 13px;
    line-height: 18px;
    font-weight: var(--font-semibold);
  }
  
  .caption1 {
    font-size: 12px;
    line-height: 16px;
    font-weight: var(--font-regular);
  }
  
  .caption1-strong {
    font-size: 12px;
    line-height: 16px;
    font-weight: var(--font-semibold);
  }
  
  .caption2 {
    font-size: 11px;
    line-height: 16px;
    font-weight: var(--font-medium);
  }
  
  .caption2-strong {
    font-size: 11px;
    line-height: 16px;
    font-weight: var(--font-bold);
  }
  
  /* ========================================
     4. Layout Components
     ======================================== */
  
  /* Status Bar */
  .status-bar {
    background: var(--neutral-100);
    color: var(--neutral-10);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--neutral-80);
  }
  
  /* Header Section */
  .header {
    background: var(--neutral-100);
    padding: var(--space-lg) var(--space-lg);
    border-bottom: 1px solid var(--neutral-70);
  }
  
  .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  /* Content Area */
  .content {
    flex: 1;
    padding: var(--space-lg) var(--space-base);
    overflow-y: auto;
    background: rgba(237, 80, 0, 0.05);
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
  
  /* ========================================
     5. Card Component
     ======================================== */
  .card-component {
    background: var(--neutral-100);
    border-radius: var(--radius-xlarge);
    padding: var(--space-lg);
    margin-bottom: var(--space-base);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--neutral-70);
    
    /* Grid Layout */
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: var(--space-base);
    align-items: center;
    min-height: 100px;
    
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .card-component:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(237, 80, 0, 0.12);
  }
  
  .card-component::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(237, 80, 0, 0.03) 0%, transparent 70%);
    border-radius: 50%;
  }
  
  /* Card Icon */
  .card-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--orange-100) 0%, var(--orange-90) 100%);
    border-radius: var(--radius-xxlarge);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(237, 80, 0, 0.1);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
  }
  
  .icon-emoji {
    font-size: 48px;
    line-height: 1;
  }
  
  /* Card Content */
  .card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-height: 80px;
    justify-content: center;
  }
  
  .card-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: var(--space-xs);
  }
  
  /* ========================================
     6. Button System
     ======================================== */
  
  /* Base Button Styles */
  [class^="button-"] {
    border: none;
    border-radius: var(--radius-large);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
  }
  
  /* Button Hierarchy - Primary */
  .button-primary-medium {
    background: var(--orange-50);
    color: var(--neutral-100);
    min-width: 100px;
    height: var(--btn-height-medium);
    padding: 0 var(--space-md);
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(237, 80, 0, 0.3);
  }
  
  .button-primary-medium:hover {
    background: var(--orange-60);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 80, 0, 0.4);
  }
  
  .button-primary-medium:active {
    transform: scale(0.98);
  }
  
  /* Button Hierarchy - Secondary */
  .button-secondary-medium {
    background: var(--neutral-20);
    color: var(--neutral-100);
    min-width: 100px;
    height: var(--btn-height-medium);
    padding: 0 var(--space-md);
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .button-secondary-medium:hover {
    background: var(--neutral-30);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
  
  .button-secondary-medium:active {
    transform: scale(0.98);
  }
  
  /* Button Label */
  .button-label {
    position: relative;
    z-index: 1;
  }
  
  /* Focus State */
  [class^="button-"]:focus {
    outline: 2px solid var(--orange-50);
    outline-offset: 2px;
  }
  
  /* Disabled State */
  [class^="button-"]:disabled {
    background: var(--neutral-60);
    color: var(--neutral-40);
    cursor: not-allowed;
    box-shadow: none;
  }
  
  /* ========================================
     7. Bottom Navigation
     ======================================== */
  .bottom-nav {
    background: var(--neutral-100);
    padding: var(--space-sm) var(--space-base) var(--space-lg);
    border-top: 1px solid var(--neutral-70);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 100%;
  }
  
  .nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-xs) var(--space-xs);
    border-radius: var(--radius-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--neutral-40);
    flex: 1;
    min-width: 0;
  }
  
  .nav-item.active {
    background: rgba(237, 80, 0, 0.1);
    color: var(--orange-50);
  }
  
  .nav-item:hover {
    background: rgba(237, 80, 0, 0.05);
  }
  
  .nav-icon {
    width: 20px;
    height: 20px;
    display: block;
    margin-bottom: 2px;
  }
  
  .nav-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(46%) sepia(0%) saturate(1%) hue-rotate(251deg) brightness(96%) contrast(85%);
  }
  
  .nav-item.active .nav-icon img {
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%);
  }
  
  .nav-label {
    font-size: 10px;
    font-weight: 400;
    line-height: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  
  .home-indicator {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 134px;
    height: 5px;
    background: var(--neutral-90);
    border-radius: 2.5px;
  }
  
  /* ========================================
     8. Utility Components
     ======================================== */
  .version-info {
    position: fixed;
    bottom: var(--space-sm);
    right: var(--space-sm);
    color: var(--neutral-50);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-medium);
    backdrop-filter: blur(10px);
  }
  
  /* ========================================
     9. Animations
     ======================================== */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .card-component {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: backwards;
  }
  
  .card-component:nth-child(1) { animation-delay: 0s; }
  .card-component:nth-child(2) { animation-delay: 0.1s; }
  .card-component:nth-child(3) { animation-delay: 0.2s; }
  .card-component:nth-child(4) { animation-delay: 0.3s; }
  
  /* ========================================
     10. Responsive Design
     ======================================== */
  
  /* Mobile Small (< 375px) */
  @media (max-width: 375px) {
    .content {
      padding: var(--space-base) var(--space-base);
    }
    
    .header {
      padding: var(--space-base) var(--space-base);
    }
    
    .title1 {
      font-size: 20px;
      line-height: 28px;
    }
    
    .card-component {
      padding: var(--space-base);
      grid-template-columns: 70px 1fr;
      gap: var(--space-md);
    }
    
    .card-icon {
      width: 70px;
      height: 70px;
    }
    
    .icon-emoji {
      font-size: 40px;
    }
    
    .bottom-nav {
      padding: var(--space-md) var(--space-base) 28px;
    }
    
    [class^="button-"] {
      min-width: 120px;
      height: var(--btn-height-medium);
    }
  }
  
  /* Tablet Small (640px - 1023px) */
  @media (min-width: 640px) and (max-width: 1023px) {
    body {
      max-width: 768px;
    }
    
    .content {
      padding: var(--space-xl) var(--space-lg);
    }
    
    .card-component {
      padding: var(--space-xl);
      grid-template-columns: 100px 1fr;
      gap: var(--space-lg);
    }
    
    .card-icon {
      width: 100px;
      height: 100px;
    }
    
    .icon-emoji {
      font-size: 56px;
    }
  }
  
  /* Desktop (1280px+) */
  @media (min-width: 1280px) {
    body {
      max-width: 1280px;
    }
    
    .content {
      padding: var(--space-xl) var(--space-lg);
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: var(--space-lg);
      align-content: start;
    }
    
    .card-component {
      margin-bottom: 0;
    }
  }
  
  /* ========================================
     11. Accessibility
     ======================================== */
  
  /* Focus Visible */
  :focus-visible {
    outline: 2px solid var(--orange-50);
    outline-offset: 2px;
  }
  
  /* Reduced Motion */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
  
  /* High Contrast Mode */
  @media (prefers-contrast: high) {
    .card-component {
      border: 2px solid var(--neutral-10);
    }
    
    [class^="button-"] {
      border: 2px solid currentColor;
    }
  }
  
  /* Dark Mode Support (Future Implementation) */
  @media (prefers-color-scheme: dark) {
    /* Dark mode tokens would be applied here */
  }
  
  /* ========================================
     12. Print Styles
     ======================================== */
  @media print {
    .bottom-nav,
    .version-info {
      display: none;
    }
    
    .content {
      overflow: visible;
      height: auto;
    }
    
    .card-component {
      page-break-inside: avoid;
    }
  }