/* 디자인 토큰 - CSS 변수 (랜딩/로그인과 동일한 deep blue 결) */
:root {
    /* Font */
    --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
    
    /* Primary Colors (deep blue) */
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #eff6ff;
    
    /* Accent Colors (primary와 동일 톤) */
    --color-accent: #3b82f6;
    --color-accent-dark: #2563eb;
    --color-accent-light: #eff6ff;
    
    /* Favorite/Heart Color */
    --color-favorite: #ff6b6b;
    --color-favorite-light: rgba(255, 107, 107, 0.15);
    
    /* Text Colors (neutral — Notion/Apple 계열) */
    --color-text-primary: #171717;
    --color-text-secondary: #525252;
    --color-text-tertiary: #a3a3a3;
    --color-text-disabled: #ccc;
    --color-text-inverse: #fff;
    
    /* Background Colors */
    --color-bg-primary: #fff;
    --color-bg-secondary: #f4f5f7;
    --color-bg-page: #f0f2f5;
    --color-bg-elevated: #ffffff;
    --color-bg-tertiary: #fafafa;
    --color-bg-subtle: #eef2f7;
    --color-bg-muted: #f4f4f5;
    --color-bg-canvas: #fafafa;
    --color-bg-hover: #f4f4f5;
    
    /* Border Colors */
    --color-border-light: #e5e5e5;
    --color-border-mid: #d4d4d4;
    --color-border-lighter: #f0f0f0;
    --color-border-focus: var(--color-primary);
    
    /* Weather Colors */
    --color-weather-sunny-start: #FFF3E0;
    --color-weather-sunny-end: #FFE0B2;
    --color-weather-cloudy-start: #E3F2FD;
    --color-weather-cloudy-end: #BBDEFB;
    --color-weather-rainy-start: #E1F5FE;
    --color-weather-rainy-end: #B3E5FC;
    --color-weather-snowy-start: #F3E5F5;
    --color-weather-snowy-end: #E1BEE7;
    --color-weather-lightning-start: #FFF9C4;
    --color-weather-lightning-end: #FFF59D;
    
    /* Temperature Colors */
    --color-temp-high: #ef4444;
    --color-temp-low: #2563eb;
    
    /* Shadow Colors */
    --color-shadow-sm: rgba(0, 0, 0, 0.05);
    --color-shadow-md: rgba(0, 0, 0, 0.1);
    --color-shadow-lg: rgba(0, 0, 0, 0.15);
    --color-shadow-xl: rgba(0, 0, 0, 0.2);
    /* 표면·카드 (얇은 테두리 우선, 그림자는 최소) */
    --shadow-surface: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-surface-hover: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-inset-divider: inset 0 -1px 0 var(--color-border-lighter);
    
    /* Overlay Colors */
    --color-overlay: rgba(0, 0, 0, 0.5);
    --color-overlay-light: rgba(0, 0, 0, 0.1);
    
    /* Status Colors */
    --color-success: #2e7d32;
    --color-error: #c62828;
    --color-warning: #ffc107;
    
    /* Weather Fit Chip (cold/good/hot) */
    --chip-cold-bg: #dbeafe;
    --chip-cold-color: #1e40af;
    --chip-cold-border: #93c5fd;
    --chip-good-bg: #dcfce7;
    --chip-good-color: #166534;
    --chip-good-border: #86efac;
    --chip-hot-bg: #fee2e2;
    --chip-hot-color: #991b1b;
    --chip-hot-border: #fca5a5;
    
    /* Button / Primary 강조용 */
    --color-primary-shadow: rgba(37, 99, 235, 0.4);

    /* 버튼 (filled · outline · 텍스트 링크) */
    --color-btn-solid-bg: var(--color-text-primary);
    --color-btn-solid-hover: #262626;
    --color-btn-solid-fg: var(--color-text-inverse);
    --color-btn-disabled-bg: var(--color-bg-muted);
    --color-btn-disabled-fg: var(--color-text-tertiary);
    --color-btn-accent-bg: var(--color-primary);
    --color-btn-accent-hover: var(--color-primary-dark);
    --color-btn-outline-border: var(--color-border-light);
    --color-link-action: var(--color-primary);
    /* 스위치 — 가로가 긴 트랙에 50%를 주면 타원이 된다. 캡슐만 쓴다. */
    --switch-width: 51px;
    --switch-height: 31px;
    --switch-knob: 27px;
    --switch-track-off: #e9e9eb;
    --switch-track-on: var(--color-text-primary);
    --switch-knob-bg: #fff;
    --btn-height-md: 44px;
    --btn-padding-y: var(--spacing-md);
    --btn-padding-x: var(--spacing-xl);
    
    /* Spacing — 4px 그리드 (직접 px 금지, 시맨틱 alias 사용) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 24px;
    --spacing-3xl: 32px;
    --spacing-4xl: 40px;
    --spacing-5xl: 48px;

    /* Spacing — 레이아웃 (DESIGN_SYSTEM.md §15) */
    --page-inset-x: var(--spacing-lg);
    --section-gap-y: var(--spacing-2xl);
    --block-gap-y: var(--spacing-lg);
    --stack-gap-y: var(--spacing-md);
    --feed-item-gap: var(--spacing-2xl);
    --surface-padding: var(--spacing-xl);
    --surface-padding-lg: var(--spacing-2xl);
    --form-section-gap: var(--spacing-3xl);
    --form-field-gap: var(--spacing-md);
    --header-padding-y: var(--spacing-md);
    --header-padding-x: var(--page-inset-x);
    --chip-padding-y: var(--spacing-sm);
    --chip-padding-x: var(--spacing-md);
    
    /* Border Radius — 스케일 (px 직접 지정 금지, 시맨틱 alias 사용) */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;
    --radius-pill: 9999px;

    /* Radius — 역할별 (DESIGN_SYSTEM.md §14) */
    --btn-radius: var(--radius-md);
    --btn-radius-compact: var(--radius-sm);
    --chip-radius: var(--radius-pill);
    --input-radius: var(--radius-sm);
    --surface-radius: var(--radius-lg);
    --photo-radius: var(--radius-md);
    --badge-radius: var(--radius-xs);
    --modal-sheet-top-radius: var(--radius-xl);
    
    /* Font Sizes */
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-md: 15px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 20px;
    --font-size-3xl: 24px;
    --font-size-4xl: 32px;
    
    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Typography — 역할 (DESIGN_SYSTEM.md §16) */
    --type-body-size: var(--font-size-base);
    --type-body-weight: var(--font-weight-normal);
    --type-body-color: var(--color-text-primary);
    --type-body-line: 1.5;
    --type-caption-size: var(--font-size-sm);
    --type-caption-color: var(--color-text-secondary);
    --type-caption-line: 1.45;
    --type-label-size: var(--font-size-base);
    --type-label-weight: var(--font-weight-semibold);
    --type-input-size: var(--font-size-md);
    --type-section-title-size: var(--font-size-xl);
    --type-section-title-weight: var(--font-weight-semibold);
    --type-section-title-line: 1.25;
    --type-section-desc-size: var(--font-size-sm);
    --type-section-desc-color: var(--color-text-tertiary);
    --type-page-title-size: var(--font-size-xl);
    --type-page-title-weight: var(--font-weight-semibold);
    --type-detail-title-size: var(--font-size-3xl);
    --type-detail-title-weight: var(--font-weight-bold);
    --type-detail-title-line: 1.35;
    --type-display-size: var(--font-size-4xl);
    --type-weather-display-size: 32px;
    --type-weather-display-weight: 200;
    --type-eyebrow-size: var(--font-size-xs);
    --type-eyebrow-weight: var(--font-weight-medium);
    --type-eyebrow-color: var(--color-text-tertiary);
    --type-letter-tight: -0.04em;
    --type-letter-body: -0.02em;

    /* 필터·기온 칩 (pill) */
    --chip-border: 1px solid transparent;
    --chip-idle-bg: var(--color-bg-muted);
    --chip-idle-color: var(--color-text-secondary);
    --chip-active-bg: var(--color-text-primary);
    --chip-active-fg: var(--color-text-inverse);
    --chip-active-border: transparent;

    --home-inset-x: var(--page-inset-x);
    --home-surface-radius: var(--surface-radius);
    
    /* Transitions */
    --transition-fast: 0.2s;
    --transition-base: 0.3s;
    --transition-slow: 0.5s;
    --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index */
    --z-index-base: 1;
    --z-index-dropdown: 100;
    --z-index-sticky: 100;
    --z-index-modal: 1000;
    /** 필터·상세 날씨 등 앱 바텀시트 (하단 탭 위, 작성 시트·다이얼로그 아래) */
    --z-index-app-sheet: 9600;
    --z-index-popup: 9999;
    
    /* Container */
    --container-max-width: 428px;
    --container-padding: var(--page-inset-x);
    
    /* Bottom Navigation */
    --bottom-nav-height: 60px;
    --bottom-nav-height-mobile: 56px;
    --bottom-nav-icon-size: 28px;
    --bottom-nav-icon-size-mobile: 26px;
    --bottom-nav-icon-svg-size: 24px;
    --bottom-nav-icon-svg-size-mobile: 22px;
    --bottom-nav-label-size: 11px;
    --bottom-nav-label-size-mobile: 10px;

    --page-padding-bottom-nav: calc(
        var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + var(--spacing-2xl)
    );
    
    /* Modal & Bottom Sheet */
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --modal-bg: var(--color-bg-primary);
    --modal-border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    --modal-padding: var(--spacing-2xl);
    --modal-max-height: 80vh;
    --modal-header-border: var(--color-border-lighter);
    
    /* Icon Sizes */
    --icon-size-xs: 16px;
    --icon-size-sm: 20px;
    --icon-size-md: 24px;
    --icon-size-lg: 28px;
    --icon-size-xl: 32px;
    --icon-stroke-width: 2;
    --icon-stroke-width-active: 2.5;
    
    /* Button Sizes */
    --button-height-sm: 32px;
    --button-height-md: 40px;
    --button-height-lg: 44px;
    --button-height-xl: 56px;
    --button-padding-sm: var(--spacing-sm) var(--spacing-md);
    --button-padding-md: var(--spacing-md) var(--spacing-lg);
    --button-padding-lg: var(--spacing-lg) var(--spacing-xl);
    
    /* Icon default (비활성) */
    --color-icon-default: #555;
    
    /* Action Button Colors */
    --color-action-edit: var(--color-text-primary);
    --color-action-delete: var(--color-favorite);
    --color-action-danger: #ff3b30;
    
    /* Menu Item */
    --menu-item-padding: var(--spacing-xl) var(--spacing-2xl);
    --menu-item-gap: var(--spacing-md);
    --menu-item-hover: var(--color-bg-secondary);
    --menu-item-active: #e8e8e8;
    
    /* Outfit items (착장 품목) */
    --color-outfit-category-active-bg: #1a1a1a;
    --color-outfit-category-active-fg: #ffffff;
    --font-size-outfit-chip: 11px;
    --outfit-sheet-handle-width: 32px;
    --outfit-sheet-handle-height: 3px;

    /* 코디 사진 (전신 룩 — 세로 3:4 기본, 업로드 시 동일 비율 크롭) */
    --outfit-photo-aspect: 3 / 4;
    --outfit-photo-bg: var(--color-bg-subtle);
    --outfit-photo-list-width: min(38vw, 168px);
    --outfit-photo-max-height-detail: min(82vh, 620px);
    
    /* Tag */
    --tag-padding: 6px var(--spacing-md);
    --tag-bg: var(--color-bg-secondary);
    --tag-color: var(--color-text-secondary);
    --tag-radius: 16px;
}

/* 전역 타이포·간격 기본 (앱 페이지 공통) */
body {
    font-family: var(--font-sans);
    font-size: var(--type-body-size);
    font-weight: var(--type-body-weight);
    line-height: var(--type-body-line);
    color: var(--type-body-color);
    letter-spacing: var(--type-letter-body);
}

