/* ============================================
   Destiny's Map - Common CSS
   공통 스타일 (모든 페이지에서 사용)
   
   파일 구조 인덱스:
   1. CSS 변수 정의
   2. 기본 리셋 및 폰트
   3. 레이아웃 유틸리티
   4. 스페이싱
   5. 색상 및 배경
   6. 타이포그래피
   7. 보더 및 라운드
   8. 그리드
   9. 크기
   10. 배경 이미지
   11. 오버플로우
   12. 커서
   13. 트랜지션
   14. 호버 효과
   15. 포커스 효과
   16. 플레이스홀더
   17. 스페이싱 유틸리티
   18. 반응형 디자인
   19. 커스텀 컴포넌트
   20. 헤더 스타일
   21. 모바일 메뉴
   22. 버튼 스타일
   23. 입력 필드 스타일
   24. 링크 스타일
   25. 머티리얼 아이콘
   ============================================ */

/* CSS 변수 정의 */
:root {
    --primary: #7317cf;
    --background-light: #f7f6f8;
    --background-dark: #141118;
    --card-bg: #191121;
    --border-color: #302938;
    --text-primary: #ffffff;
    --text-secondary: #ab9db8;
    --text-muted: #ab9db8;
}

/* 기본 리셋 및 폰트 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 모든 요소의 기본 outline 제거 (접근성을 위해 포커스 스타일은 별도 정의) */
*:focus {
    outline: none;
}

/* 키보드 포커스만 표시 (마우스 클릭 시에는 표시 안 함) */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

html {
    border: none;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Noto Serif", serif;
    background-color: var(--background-dark);
    color: var(--text-primary);
    line-height: 1.5;
    border: none;
    margin: 0;
    padding: 0;
}

html.dark body {
    background-color: var(--background-dark);
}

/* ============================================
   레이아웃 유틸리티
   ============================================ */

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

.top-full { top: 100%; }
.left-0 { left: 0; }
.right-0 { right: 0; }

.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }

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

.flex-1 { flex: 1 1 0%; }
.grow { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.w-full { width: 100%; }
.h-auto { height: auto; }
.min-h-screen { min-height: 100vh; }
.max-w-4xl { max-width: 56rem; }
.max-w-md { max-width: 28rem; }
.max-w-full { max-width: 100%; }
.max-w-[960px] { max-width: 960px; }
.max-w-[480px] { max-width: 480px; }
.min-w-40 { min-width: 10rem; }
.min-w-[84px] { min-width: 84px; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* ============================================
   간격 (Spacing)
   ============================================ */

.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-9 { gap: 2.25rem; }
.gap-12 { gap: 3rem; }

.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pb-3 { padding-bottom: 0.75rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-16 { margin-top: 4rem; }
.mr-2 { margin-right: 0.5rem; }

/* ============================================
   색상
   ============================================ */

.bg-primary { background-color: var(--primary); }
.bg-\[#191121\] { background-color: #191121; }
.bg-\[#141118\] { background-color: #141118; }
.bg-\[#302938\] { background-color: #302938; }
.bg-background-light { background-color: var(--background-light); }
.bg-background-dark { background-color: var(--background-dark); }

.text-white { color: #ffffff; }
.text-\[#ab9db8\] { color: #ab9db8; }
.text-red-400 { color: #f87171; }
.text-green-400 { color: #4ade80; }
.text-primary { color: var(--primary); }

/* ============================================
   타이포그래피
   ============================================ */

.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.leading-normal { line-height: 1.5; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }

.tracking-\[-0.015em\] { letter-spacing: -0.015em; }
.tracking-\[-0.033em\] { letter-spacing: -0.033em; }
.tracking-\[0.015em\] { letter-spacing: 0.015em; }

.text-center { text-align: center; }
.whitespace-nowrap { white-space: nowrap; }
.break-words { 
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

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

/* 반응형 display 유틸리티 */
@media (min-width: 640px) {
    .sm\:flex { display: flex !important; }
    .sm\:block { display: block !important; }
    .sm\:inline-block { display: inline-block !important; }
    .sm\:grid { display: grid !important; }
}

@media (min-width: 768px) {
    .md\:flex { display: flex !important; }
    .md\:block { display: block !important; }
    .md\:inline-block { display: inline-block !important; }
    .md\:grid { display: grid !important; }
}

/* ============================================
   보더 및 둥근 모서리
   ============================================ */

/* border 클래스는 width만 설정 (style과 color는 별도 클래스 필요) */
.border { 
    border-width: 1px;
    /* style과 color는 별도 클래스로 설정해야 함 */
}
.border-t { 
    border-top-width: 1px;
    /* style과 color는 별도 클래스로 설정해야 함 */
}
.border-b { 
    border-bottom-width: 1px;
    /* style과 color는 별도 클래스로 설정해야 함 */
}
.border-solid { 
    /* 기본적으로는 모든 방향에 적용하지 않음 */
    /* 특정 방향과 조합될 때만 적용 */
}
.border-\[#302938\] { 
    border-color: #302938;
}
.border-transparent { 
    border-color: transparent;
}

/* border-b와 border-solid이 함께 사용될 때 - 하단만 */
.border-b.border-solid {
    border-bottom-style: solid;
    border-top-style: none;
    border-left-style: none;
    border-right-style: none;
}

/* border-t와 border-solid이 함께 사용될 때 - 상단만 */
.border-t.border-solid {
    border-top-style: solid;
    border-bottom-style: none;
    border-left-style: none;
    border-right-style: none;
}

/* border와 border-solid이 함께 사용될 때 - 모든 방향 */
.border.border-solid {
    border-style: solid;
}

.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* ============================================
   그리드
   ============================================ */

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ============================================
   크기
   ============================================ */

.size-4 { width: 1rem; height: 1rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }

.aspect-square { aspect-ratio: 1 / 1; }

/* ============================================
   배경 이미지
   ============================================ */

.bg-center { background-position: center; }
.bg-cover { background-size: cover; }
.bg-no-repeat { background-repeat: no-repeat; }

/* ============================================
   오버플로우
   ============================================ */

.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.resize-none { resize: none; }

/* ============================================
   커서
   ============================================ */

.cursor-pointer { cursor: pointer; }

/* ============================================
   전환 효과
   ============================================ */

.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-shadow { transition-property: box-shadow; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-300 { transition-duration: 300ms; }

/* ============================================
   호버 효과
   ============================================ */

.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.hover\:shadow-primary\/20:hover { box-shadow: 0 10px 15px -3px rgba(115, 23, 207, 0.2), 0 4px 6px -2px rgba(115, 23, 207, 0.1); }
.hover\:bg-primary\/90:hover { background-color: rgba(115, 23, 207, 0.9); }

/* ============================================
   포커스 효과
   ============================================ */

.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--primary); }
.focus\:ring-primary:focus { box-shadow: 0 0 0 2px var(--primary); }
.focus\:border-primary:focus { border-color: var(--primary); }
.focus\:border-transparent:focus { border-color: transparent; }

/* ============================================
   플레이스홀더
   ============================================ */

.placeholder-\[#ab9db8\]::placeholder { color: #ab9db8; }

/* ============================================
   스페이싱 유틸리티
   ============================================ */

.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* ============================================
   반응형 디자인 (미디어 쿼리)
   ============================================ */

/* sm: 640px 이상 */
@media (min-width: 640px) {
    .sm\:px-10 { padding-left: 2.5rem; padding-right: 2.5rem; }
    .sm\:text-5xl { font-size: 3rem; line-height: 1; }
}

/* md: 768px 이상 */
@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:px-10 { padding-left: 2.5rem; padding-right: 2.5rem; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* lg: 1024px 이상 */
@media (min-width: 1024px) {
    .lg\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .lg\:px-40 { padding-left: 10rem; padding-right: 10rem; }
    .lg\:max-w-full { max-width: 100%; }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Container Queries 대체 */
@container (min-width: 480px) {
    .\@\[480px\]\:flex-row { flex-direction: row; }
    .\@\[480px\]\:justify-around { justify-content: space-around; }
}

/* ============================================
   커스텀 컴포넌트
   ============================================ */

.layout-container {
    width: 100%;
}

.layout-content-container {
    width: 100%;
}

.group\/design-root {
    /* 그룹 스타일링이 필요한 경우 */
}

/* ============================================
   헤더 스타일
   ============================================ */

header {
    position: relative;
    z-index: 10;
}

header a {
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

header a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

header a:hover::after {
    width: 100%;
}

/* ============================================
   모바일 메뉴
   ============================================ */

#mobile-menu {
    z-index: 50;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #191121;
    border-top: 1px solid #302938;
    padding: 1rem;
}

#mobile-menu.hidden {
    display: none;
}

#mobile-menu a {
    display: block;
    padding: 0.5rem 0;
    transition: opacity 0.2s ease;
}

#mobile-menu a:hover {
    opacity: 0.7;
}

/* ============================================
   버튼 스타일
   ============================================ */

button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

button:focus,
button:active {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

button[type="submit"],
button.bg-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    outline: none;
}

button[type="submit"]:hover,
button.bg-primary:hover {
    background-color: rgba(115, 23, 207, 0.9);
}

button[type="submit"]:focus,
button.bg-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(115, 23, 207, 0.3);
}

/* 빨간색 버튼 (로그아웃 등) */
.bg-red-600 {
    background-color: #dc2626;
}

.bg-red-600:hover {
    background-color: #b91c1c;
}

.hover\:bg-red-700:hover {
    background-color: #b91c1c;
}

/* 헤더 버튼 스타일 */
header button {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

header button:focus,
header button:active {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

header button:hover {
    opacity: 0.8;
}

/* ============================================
   입력 필드 스타일
   ============================================ */

input[type="text"],
input[type="email"],
input[type="date"],
input[type="datetime-local"],
input[type="password"],
select,
textarea {
    background-color: #141118;
    border: 1px solid #302938;
    color: white;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(115, 23, 207, 0.2);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: #ab9db8;
}

/* 라디오 버튼 및 체크박스 */
input[type="radio"],
input[type="checkbox"] {
    accent-color: var(--primary);
}

/* ============================================
   링크 스타일
   ============================================ */

a {
    text-decoration: none;
    color: inherit;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

a:focus,
a:active {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

a:hover {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

/* 헤더 링크 스타일 (기본 스타일은 위의 header a::after에서 처리) */
header a {
    display: inline-block;
    padding: 0.25rem 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

header a:hover {
    opacity: 0.9;
}

header a:focus {
    outline: none;
}

header a:active {
    opacity: 0.8;
}

/* ============================================
   머티리얼 아이콘
   ============================================ */

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
}

