/* --- 1. Global Variables & Design Rules (Premium Feel) --- */
:root {
    /* Brighter, professional student palette */
    --bg-color: #FFFFFF;          /* Main clean background */
    --bg-secondary: #F4F6F9;      /* Subtle secondary background */
    --text-primary: #1C1E21;      /* Crisp primary text */
    --text-secondary: #5F6368;    /* Softer descriptive text */
    --accent-color: #4A90E2;      /* Clear student accent blue */
    --accent-hover: #357ABD;      /* Hover state blue */
    --placeholder-color: #E0E3E8; /* Cleaner placeholder gray */
    
    --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Spacing system (increased for better breathability) */
    --section-padding-v: 120px;
    --container-max-width: 1140px;
}

/* --- 2. Base Styling Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.7; /* Increased for better legibility */
}

/* Common Container Class (Crucial for fix compactness) */
.container {
    width: 90%; /* For smaller screens */
    max-width: var(--container-max-width); /* Container width rule */
    margin: 0 auto;
    padding: 0 15px; /* Side padding inside container */
}

/* --- 3. Navigation Bar (Compact & Auth Added) --- */
.navbar {
    padding: 20px 0; /* 기존 40px에서 20px로 확 줄였습니다! */
    background-color: var(--bg-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* 상단바와 본문을 살짝 구분하는 연한 선 추가 */
}

.navbar-inner {
    display: flex;
    justify-content: space-between; /* 양끝으로 배치 (로고 <-> 버튼) */
    align-items: center;
}

.navbar .logo {
    font-weight: 800;
    font-size: 1.4rem;
}

/* 로그인 & 회원가입 버튼 영역 */
.auth-links {
    display: flex;
    align-items: center;
    gap: 24px; /* 버튼 사이 간격 */
}

/* 일반 텍스트 링크 (Log In) */
.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary); /* 마우스 올리면 진해짐 */
}

/* 서브 버튼 디자인 (Sign Up) */
.btn-secondary {
    display: inline-block;
    background-color: var(--bg-color);
    color: var(--text-primary);
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    border: 1px solid #D1D5DB; /* 깔끔한 회색 테두리 */
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--text-primary);
    color: white; /* 마우스 올리면 반전 (검은바탕에 흰글씨) */
}

/* --- 4. Hero Section (Spaced & Boosted Typography) --- */
.hero-section {
    padding: var(--section-padding-v) 0; /* Massive vertical padding */
    background-color: var(--bg-secondary);
    text-align: center;
}

.hero-content h1 {
    font-size: 4.5rem; /* Larger hero title */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 30px;
}

.hero-content .highlight {
    font-size: 2.2rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.hero-content p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 60px; /* Better spacing to button */
}

/* Modernized Button */
.btn-primary {
    display: inline-block;
    background-color: var(--text-primary);
    color: white;
    padding: 18px 50px; /* Larger button padding */
    font-size: 1.25rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--accent-color);
    transform: translateY(-4px); /* Boosted hover lift */
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

/* --- 5. Features (Spaced cards) --- */
.feature-container {
    padding: var(--section-padding-v) 0;
}

.feature-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 100px; /* More space between features */
}

/* Reverse layout for odd sections */
.feature-card.right-text {
    flex-direction: row-reverse;
}

.feature-text {
    width: 45%;
}

.feature-text h2 {
    font-size: 2.8rem; /* Larger feature titles */
    margin-bottom: 25px;
    line-height: 1.2;
}

.feature-text p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* UI Mock Placeholder Styling (Cleaner and modern cards) */
.feature-image {
    width: 45%;
    height: 350px; /* Increased height */
    background-color: white;
    border-radius: 20px; /* Softer corners */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ADB5BD;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.06); /* Modern shadow */
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.04);
}

.feature-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(0,0,0,0.1);
}

/* Placeholder colors from reference */
.feature-image.placeholder-bar-chart {
    background-color: #93BCDD; /* Brighter blue for bar chart */
    color: rgba(255,255,255,0.8);
}
.feature-image.placeholder-habit-analysis,
.feature-image.placeholder-ai-feedback {
    background-color: white;
}

/* --- 6. Footer (Spaced) --- */
footer {
    padding: 60px 0; /* More padding */
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 100px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
}

/* =========================================
   7. Auth Pages (Login / Signup)
========================================= */

/* 로그인 화면 전용 배경 (화면 전체 꽉 채우고 중앙 정렬) */
.auth-body {
    background-color: var(--bg-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0; /* body 기본 마진 제거 */
}

/* 로그인/회원가입 카드 디자인 */
.auth-container {
    background-color: white;
    width: 100%;
    max-width: 420px; /* 너무 넓어지지 않게 고정 */
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    text-align: center;
    position: relative;
}

/* 뒤로가기 버튼 */
.back-link {
    position: absolute;
    top: 25px;
    left: 25px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--text-primary);
}

/* 폼 내부 로고 및 제목 */
.auth-container .logo {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--accent-color); 
    font-weight: 800;
}

.auth-container h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    line-height: 1.2;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1rem;
}

/* 입력 폼 디자인 */
.auth-form {
    text-align: left;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--placeholder-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #FAFAFA;
}

.input-group input:focus {
    outline: none;
    background-color: white;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15); /* 포커스 시 파란색 테두리 효과 */
}

/* 로그인/회원가입 버튼 (기존 btn-primary 확장) */
.auth-btn {
    width: 100%;
    margin-top: 15px;
    padding: 16px;
    font-size: 1.1rem;
}

/* 하단 전환 링크 (Log in <-> Sign up) */
.auth-switch {
    margin-top: 25px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
}

.auth-switch a {
    color: var(--accent-color);
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}

.auth-switch a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* =========================================
   8. Tracker Page (input.html)
========================================= */

.bg-light { background-color: #F9FAFB; }

.tracker-container {
    padding: 60px 0;
}

.tracker-header {
    margin-bottom: 40px;
    text-align: center;
}

.tracker-header h2 { font-size: 2.5rem; font-weight: 800; }

.tracker-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr; /* 왼쪽 입력창을 더 넓게 */
    gap: 30px;
}

/* 카드 스타일 공통 */
.card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    margin-bottom: 25px;
    border: 1px solid rgba(0,0,0,0.03);
}

.card h3 { margin-bottom: 20px; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }

/* 입력 아이템 */
.input-item { margin-bottom: 25px; }
.input-item label { display: block; margin-bottom: 10px; font-weight: 600; color: var(--text-secondary); }

/* 슬라이더 디자인 */
/* 슬라이더 디자인 */
.slider {
    width: 100%;
    height: 6px;
    background: #E5E7EB;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none; /* 기존 코드 (크롬, 사파리용) */
    appearance: none;         /* ✅ 이 줄을 추가하세요! (표준 속성) */
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

/* 텍스트 입력창 */
.text-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    font-size: 1rem;
    background: #FDFDFD;
}

/* 결과창 전용 스타일 */
.score-display { margin: 20px 0; }
.score-num { font-size: 4rem; font-weight: 800; color: var(--accent-color); }
.score-total { font-size: 1.2rem; color: #ADB5BD; }

.status-bar { width: 100%; height: 10px; background: #EEE; border-radius: 5px; overflow: hidden; margin-bottom: 15px; }
.status-fill { height: 100%; background: var(--accent-color); transition: width 0.5s ease; }

.ai-preview-text { font-style: italic; color: var(--text-secondary); line-height: 1.5; }

/* 태그 디자인 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; }
.tag.green { background: #E8F5E9; color: #2E7D32; }
.tag.yellow { background: #FFFDE7; color: #F9A825; }
.tag.blue { background: #E3F2FD; color: #1565C0; }

.full-width { width: 100%; padding: 20px; }

/* --- 새로 추가된 Tracker 기능 스타일 --- */

/* Optional 뱃지 */
.badge-optional {
    background-color: #E5E7EB;
    color: #6B7280;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 500;
}

/* 커스텀 체크박스 디자인 (급식) */
.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #F3F4F6;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.custom-checkbox:hover input ~ .checkmark {
    background-color: #E5E7EB;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* 약간의 간격 띄우기 유틸리티 */
.mt-10 {
    margin-top: 10px;
}

/* --- 직접 입력 가능한 숫자 폼 디자인 --- */
.inline-num-input {
    width: 60px;
    padding: 4px 8px;
    margin: 0 5px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-color); /* 파란색으로 포인트 */
    background-color: #F9FAFB;
    transition: border-color 0.2s;
    font-family: inherit;
}

.inline-num-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: white;
}

/* --- [Refactored] Report Page Animations & Enhancements --- */

/* 리스트 아이템이 순차적으로 올라오는 애니메이션 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 주간 보고서 카드 아이템 */
.log-item {
    background: white;
    padding: 20px 25px;
    border-radius: 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.log-item:hover {
    transform: scale(1.01);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.report-tag {
    background: #F3F4F6;
    color: #4B5563;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 차트 컨테이너 보강 */
.chart-container {
    background: white;
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    margin-bottom: 40px;
}

.bar-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 250px; /* 차트 높이 상향 */
    padding-top: 20px;
    border-bottom: 2px solid #F3F4F6;
}

/* 평균 점수 강조 */
/* [Refactored for Maintenance] 평균 점수 강조 스타일 및 크로스 브라우징 대응 */
.big-avg {
    font-size: 5.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    
    /* 1. 배경 그라데이션 설정 */
    background: linear-gradient(135deg, #4A90E2, #63B3ED);
    
    /* 2. 배경을 텍스트 영역으로 제한 (표준 및 접두어 모두 작성) */
    -webkit-background-clip: text; /* Chrome, Safari, Edge 대응 */
    background-clip: text;         /* [Added] 표준 속성 추가 (IDE 경고 해결) */
    
    /* 3. 텍스트 내부를 투명하게 설정 */
    -webkit-text-fill-color: transparent; /* Chrome, Safari 대응 */
    color: transparent;                   /* [Added] 표준 속성 및 Fallback 대응 */
    
    /* [Performance Optimization] 하드웨어 가속을 활용한 부드러운 렌더링 */
    transform: translateZ(0); 
    display: inline-block; /* 그라데이션 범위가 텍스트에 정확히 맞도록 설정 */
}

/* ... (기존 style.css 내용 그대로 두시고 맨 밑에 추가) ... */

/* [Added for Maintenance] Unified UI Elements */
.navbar {
    position: sticky; top: 0; z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 0;
}
.navbar-inner { display: flex; justify-content: space-between; align-items: center; }
.nav-menu { display: flex; gap: 25px; align-items: center; } /* [Added] 메뉴 버튼들을 위한 정렬 */
.nav-item { text-decoration: none; color: var(--text-secondary); font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.nav-item:hover { color: var(--accent-color); }
.nav-auth { display: flex; align-items: center; gap: 15px; margin-left: 15px; padding-left: 20px; border-left: 1px solid #EEE; }

.main-footer { padding: 50px 0; background-color: var(--bg-secondary); text-align: center; margin-top: 80px; border-top: 1px solid #EEE; }
.main-footer p { color: #9CA3AF; font-size: 0.9rem; }

.btn-logout { padding: 6px 12px; font-size: 0.8rem; font-weight: 700; border-radius: 6px; background: #FFF; border: 1px solid #EF4444; color: #EF4444; cursor: pointer; }

/* [Senior Final] Unified Global Navbar & Footer Style */

.navbar {
    position: sticky; /* [Performance] 스크롤 시 상단 고정 */
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); /* [Design] 프리미엄 블러 효과 */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 0;
}

.navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

/* [Added] 상단 메뉴 영역 */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-item:hover {
    color: var(--accent-color);
}

/* [Added] 인증 버튼 영역 (세로선 구분) */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 10px;
    padding-left: 20px;
    border-left: 1px solid #EEE;
}

.btn-logout {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 6px;
    background: #FFF;
    border: 1px solid #EF4444;
    color: #EF4444;
    cursor: pointer;
    transition: 0.2s;
}

.btn-logout:hover {
    background: #FEF2F2;
}

/* [Senior Final] Global Master Style - Index.html Font Standardized */

/* 1. index.html에서 사용한 폰트와 동일한 설정 적용 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.8/dist/web/static/pretendard.css');

:root {
    --bg-color: #FFFFFF;
    --bg-secondary: #F4F6F9;
    --text-primary: #1C1E21;
    --text-secondary: #5F6368;
    --accent-color: #4A90E2;
    --border-color: #E5E7EB;
    /* [Modified] index.html 스타일의 폰트 우선순위 적용 */
    --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 2. 전역 폰트 강제 적용 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main); /* [Modified] 모든 요소에 index 폰트 적용 */
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.7;
}

/* --- [Modified] Unified Navbar & Footer Design --- */
.navbar {
    position: sticky; top: 0; z-index: 1000;
    padding: 18px 0; background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px); border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.navbar-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 800; font-size: 1.4rem; color: var(--text-primary); text-decoration: none; }
.nav-menu { display: flex; gap: 25px; align-items: center; }
.nav-item { text-decoration: none; color: var(--text-secondary); font-weight: 600; font-size: 0.95rem; transition: 0.3s; }
.nav-item:hover, .nav-item.active { color: var(--text-primary); }

.nav-auth { display: flex; align-items: center; gap: 15px; margin-left: 15px; padding-left: 20px; border-left: 1px solid var(--border-color); }
.btn-logout { padding: 6px 14px; font-size: 0.8rem; font-weight: 700; border-radius: 8px; background: #FFF; border: 1px solid #EF4444; color: #EF4444; cursor: pointer; }

.main-footer { padding: 60px 0; background-color: var(--bg-secondary); text-align: center; border-top: 1px solid var(--border-color); margin-top: 80px; }
.main-footer p { color: #9CA3AF; font-size: 0.9rem; }

/* ... 나머지 카드, 버튼, 입력폼 기존 스타일 유지 ... */

/* [Senior Added] Auth UI classes to fix VSC validation errors */
.auth-status-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.auth-btn-gap {
    margin-left: 10px;
}
/* [Modified] 기존 btn-logout에 여백 추가 */
.btn-logout {
    margin-left: 10px;
}