graph TB
    %% TripGen 논리 아키텍처 - Context Map
    
    %% Client Layer
    subgraph "Client Layer"
        Mobile["모바일 클라이언트"]
    end
    
    %% Gateway Layer
    subgraph "Gateway Layer"
        Gateway["API Gateway<br/>• 인증/인가<br/>• 라우팅<br/>• 로드밸런싱"]
    end
    
    %% Service Layer
    subgraph "Service Layer"
        UserSvc["User Service<br/>• 사용자 인증<br/>• 프로필 관리<br/>• 세션 관리"]
        TripSvc["Trip Service<br/>• 여행 관리<br/>• 멤버 설정<br/>• 일정 조회"]
        AISvc["AI Service<br/>• 일정 생성<br/>• 맞춤 추천<br/>• 날씨 반영"]
        LocationSvc["Location Service<br/>• 장소 검색<br/>• 상세 정보<br/>• 리뷰 통합"]
    end
    
    %% Data Layer
    subgraph "Data Layer"
        Cache["Redis Cache<br/>• 세션 정보<br/>• 장소 데이터<br/>• AI 결과"]
        Queue["Message Queue<br/>• AI 작업 큐<br/>• Priority Queue<br/>• Location 비동기"]
    end
    
    %% External APIs
    subgraph "External APIs"
        Claude["Claude API"]
        Kakao["카카오맵 API"]
        Google["구글맵 API"]
        Weather["날씨 API"]
    end
    
    %% Client to Gateway (단일 연결)
    Mobile -->|HTTPS| Gateway
    
    %% Gateway to Services (동기)
    Gateway -->|인증/프로필| UserSvc
    Gateway -->|여행 관리| TripSvc
    Gateway -->|장소 검색| LocationSvc
    
    %% Service Dependencies
    TripSvc -.->|"AI 일정 생성 요청<br/>(비동기)"| Queue
    Queue -.->|작업 처리| AISvc
    
    %% AI Service Dependencies
    AISvc -.->|"장소 정보 조회<br/>(Cache-Aside)"| Cache
    AISvc -.->|"Location 요청<br/>(Async Fallback)"| Queue
    Queue -.->|백그라운드 처리| LocationSvc
    
    %% Cache Dependencies
    UserSvc -.->|세션 관리| Cache
    TripSvc -.->|여행 정보| Cache
    LocationSvc -.->|장소 캐싱| Cache
    
    %% External API Dependencies
    AISvc -->|일정 생성| Claude
    LocationSvc -->|장소 검색| Kakao
    LocationSvc -->|상세/리뷰| Google
    LocationSvc -->|날씨 조회| Weather
    
    %% Styling
    classDef client fill:#BFDBFE,stroke:#3B82F6,stroke-width:2px
    classDef gateway fill:#2E86AB,stroke:#1E3A8A,stroke-width:2px,color:#fff
    classDef user fill:#4ECDC4,stroke:#14B8A6,stroke-width:2px
    classDef trip fill:#F18F01,stroke:#F97316,stroke-width:2px
    classDef ai fill:#10B981,stroke:#059669,stroke-width:2px
    classDef location fill:#8B5CF6,stroke:#7C3AED,stroke-width:2px,color:#fff
    classDef cache fill:#F59E0B,stroke:#F97316,stroke-width:2px
    classDef queue fill:#EC4899,stroke:#DB2777,stroke-width:2px
    classDef external fill:#E5E7EB,stroke:#9CA3AF,stroke-width:2px
    
    class Mobile client
    class Gateway gateway
    class UserSvc user
    class TripSvc trip
    class AISvc ai
    class LocationSvc location
    class Cache cache
    class Queue queue
    class Claude,Kakao,Google,Weather external