:root {
    --primary-gradient-start: #ADD8E6;
    --primary-gradient-end: #87CEEB;
    --secondary-color: #f093fb;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --white: #ffffff;
    --black: #000000;
    
    /* 화려한 색상 팔레트 */
    --vibrant-pink: #ff6b9d;
    --vibrant-purple: #a855f7;
    --vibrant-blue: #3b82f6;
    --vibrant-green: #10b981;
    --vibrant-yellow: #f59e0b;
    --vibrant-orange: #f97316;
    --vibrant-red: #ef4444;
    --neon-cyan: #06d6a0;
    --neon-magenta: #f72585;
    --gold: #ffd700;
    
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --border-radius-sm: 8px;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    --shadow-xl: 0 12px 48px rgba(0,0,0,0.3);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --header-height: 60px;
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    min-height: 100vh;
    color: var(--dark-color);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 로딩 화면 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.loading-screen.active {
    opacity: 1;
    pointer-events: all;
}

.loading-content {
    text-align: center;
}

.loading-box {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
}

.loading-box-inner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--white);
    font-size: 18px;
    font-weight: 500;
}

/* 헤더 */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.header-content {
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 768px;
    margin: 0 auto;
}

.app-title {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mileage-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--gold), var(--vibrant-orange));
    border-radius: var(--border-radius-lg);
    color: var(--white);
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: mileageGlow 2s ease-in-out infinite alternate;
}

@keyframes mileageGlow {
    0% { box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4); }
    100% { box-shadow: 0 6px 25px rgba(255, 215, 0, 0.8); }
}

.mileage-icon {
    font-size: 24px;
}

.mileage-amount {
    font-size: 16px;
    font-weight: 700;
}

.mileage-unit {
    font-size: 14px;
    opacity: 0.9;
}

/* 메인 컨텐츠 */
.main-content {
    flex: 1;
    padding: calc(var(--header-height) + 20px) 20px calc(var(--nav-height) + 20px);
    max-width: 768px;
    width: 100%;
    margin: 0 auto;
}

/* 하단 네비게이션 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item.active {
    color: var(--primary-gradient-end);
}

.nav-item:active {
    transform: scale(0.95);
}

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

.nav-label {
    font-size: 12px;
    font-weight: 500;
}

.badge {
    position: absolute;
    top: 8px;
    right: calc(50% - 20px);
    background: var(--danger-color);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* 버튼 스타일 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--vibrant-purple), var(--vibrant-pink));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--vibrant-pink), var(--vibrant-purple));
    box-shadow: 0 6px 25px rgba(247, 37, 133, 0.5);
    transform: translateY(-2px);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-gradient-end);
    border: 2px solid var(--primary-gradient-end);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
    border-radius: var(--border-radius-lg);
}

.btn-block {
    width: 100%;
}

/* 카드 스타일 */
.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* 모달 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 토스트 메시지 */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--dark-color);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 3000;
    max-width: calc(100% - 40px);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
}

.toast.warning {
    background: var(--warning-color);
}

.toast.error {
    background: var(--danger-color);
}

/* 애니메이션 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 유틸리티 클래스 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none !important; }