/* ========================================
   공통 스타일 - 모든 페이지 적용
   ======================================== */

/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1c2833;
    --secondary-color: #007bbf;
    --accent-color: #4CAF50;
    --warning-color: #FF5722;
    --light-gray: #f8f9fa;
    --medium-gray: #6c757d;
    --dark-gray: #495057;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c3e50 100%);
    min-height: 100vh;
    color: #333;
    padding: 10px;
}

/* 컨테이너 - 모바일 최적화 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

/* ========================================
   헤더
   ======================================== */
.header {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--primary-color);
}

.professional-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-content {
    padding: 20px 15px;
}

.header h1 {
    font-size: 1.5em;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 300;
    padding-right: 80px;
}

.header .subtitle {
    color: var(--medium-gray);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.header-divider {
    height: 1px;
    background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
    margin: 15px 0;
}

.header-info {
    text-align: center;
    color: var(--medium-gray);
    font-size: 12px;
    margin-bottom: 15px;
}

/* 사용자 스위치 */
.user-switch {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.user-switch a {
    flex: 1;
    max-width: 150px;
    padding: 10px 20px;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.user-switch a.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.user-switch a:not(.active) {
    background: white;
    color: var(--primary-color);
    border-color: #e9ecef;
}

/* ========================================
   네비게이션 버튼
   ======================================== */
.nav-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.nav-link {
    padding: 12px 10px;
    background: white;
    color: var(--dark-gray);
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid transparent;
}

.nav-link:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.nav-link.success { 
    border-color: var(--accent-color); 
    color: var(--accent-color); 
}

.nav-link.danger { 
    border-color: var(--warning-color); 
    color: var(--warning-color); 
}

.nav-link.primary { 
    border-color: var(--secondary-color); 
    color: var(--secondary-color); 
}

/* ========================================
   섹션 헤더
   ======================================== */
.section-header {
    position: relative;
    margin: 20px 0 15px 0;
    padding: 12px 0;
}

.section-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 100%;
    background: var(--secondary-color);
    transform: translateY(-50%);
    border-radius: 2px;
}

.section-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--secondary-color) 0%, transparent 50%);
}

.section-title {
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 15px;
    margin-bottom: 3px;
}

.section-subtitle {
    font-size: 11px;
    color: var(--medium-gray);
    margin-left: 15px;
    letter-spacing: 0.5px;
}

/* ========================================
   카드
   ======================================== */
.card {
    background: white;
    border-radius: 15px;
    padding: 20px 15px;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* 구간별 페이스 분석 컨테이너 */
.pace-analysis-container {
    margin-top: 25px;
    background: var(--light-gray);
    padding: 20px 15px;
    border-radius: 10px;
}

/* ========================================
   폼 요소
   ======================================== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 191, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--medium-gray);
    font-size: 11px;
}

/* ========================================
   버튼
   ======================================== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-submit {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #0056b3 100%);
    color: white;
    width: 100%;
    padding: 14px;
    font-size: 15px;
    margin-top: 15px;
    box-shadow: 0 8px 25px rgba(0, 123, 191, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 123, 191, 0.4);
}

.btn-detail {
    background: var(--secondary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    margin-top: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-detail:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 191, 0.3);
}

/* ========================================
   통계 그리드
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.stat-box {
    background: var(--light-gray);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid var(--secondary-color);
}

.stat-label {
    font-size: 11px;
    color: var(--medium-gray);
    margin-bottom: 6px;
    font-weight: 600;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ========================================
   알림
   ======================================== */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid;
    font-size: 13px;
}

.alert-success {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--accent-color);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--warning-color);
}

/* ========================================
   빈 상태
   ======================================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--medium-gray);
}

.empty-state p {
    font-size: 14px;
    margin-top: 8px;
}

/* ========================================
   태블릿 (768px 이상)
   ======================================== */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }
    
    .container {
        padding: 0;
    }
    
    .header-content {
        padding: 30px;
    }
    
    .header h1 {
        font-size: 2.2em;
    }
    
    .professional-badge {
        top: 20px;
        right: 20px;
        padding: 8px 16px;
        font-size: 11px;
    }
    
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .nav-link {
        flex: 0 0 auto;
        font-size: 14px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .card {
        padding: 30px;
        margin-bottom: 25px;
    }
    
    .pace-analysis-container {
        padding: 30px;
    }
    
    .section-header {
        margin: 30px 0 20px 0;
    }
    
    .user-switch {
        gap: 15px;
    }
    
    .user-switch a {
        max-width: 200px;
        padding: 12px 30px;
        font-size: 15px;
    }
}

/* ========================================
   고정 하단 네비게이션
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
    border-top: 1px solid #e9ecef;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--medium-gray);
    padding: 4px 12px;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 100px;
}

.nav-item:hover {
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.nav-item.active {
    color: var(--secondary-color);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
}

/* 본문 하단 여백 (네비 가리지 않도록) */
body {
    padding-bottom: 70px;
}

/* 데스크톱 스타일 */
@media (min-width: 768px) {
    body {
        padding-bottom: 70px;
    }
}