/* 메인 스타일 */

:root {
    --primary: #0D9488;
    --primary-dark: #0F766E;
    --primary-light: #14B8A6;
    --secondary: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --success: #0D9488;
    
    /* 카테고리별 색상 */
    --category-payment: #8B5CF6;    /* 결제 - 보라 */
    --category-consult: #06B6D4;    /* 상담 - 시안 */
    --category-test: #F59E0B;       /* 검사 - 주황 */
    --category-result: #EC4899;     /* 결과지 - 핑크 */
    --category-member: #0D9488;     /* 회원관리 - 티파니 그린 */
    --category-internal: #6B7280;   /* 내부업무 - 회색 */
    
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --top-header-height: 56px;
    --bottom-nav-height: 64px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-900);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 상단 헤더 */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-header-height);
    background: linear-gradient(135deg, #0D9488 0%, #0F766E 100%);
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.top-header.hidden {
    display: none;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.3px;
}

.header-logo .logo-icon {
    width: 28px;
    height: 28px;
    color: #FFD700;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 상담예약 폼 공유 버튼 */
.btn-share-form {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-share-form:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.btn-share-form:active {
    transform: translateY(0);
}

.btn-share-form i {
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.header-user-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.header-user-btn i {
    font-size: 24px;
    color: white;
}

.header-user-btn span {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

/* 사용자 메뉴 드롭다운 */
.user-menu {
    position: fixed;
    top: calc(var(--top-header-height) + 8px);
    right: 16px;
    width: 280px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    overflow: hidden;
}

.user-menu.hidden {
    display: none;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: var(--gray-50);
}

.user-avatar {
    font-size: 48px;
    color: var(--primary);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.user-role {
    font-size: 12px;
    color: var(--gray-600);
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.user-menu-divider {
    height: 1px;
    background: var(--gray-200);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    color: var(--gray-700);
}

.user-menu-item:hover {
    background: var(--gray-50);
}

.user-menu-item i {
    width: 20px;
    text-align: center;
    color: var(--gray-500);
}

.user-menu-item.logout-btn {
    color: var(--danger);
}

.user-menu-item.logout-btn i {
    color: var(--danger);
}

#app {
    min-height: 100vh;
    padding-top: var(--top-header-height);
    padding-bottom: var(--bottom-nav-height);
}

#app.no-header {
    padding-top: 0;
}

/* 하단 탭 네비게이션 */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: var(--bottom-nav-height) !important;
    background: white !important;
    border-top: 1px solid var(--gray-200) !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    z-index: 10000 !important;
    box-shadow: var(--shadow-lg) !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.bottom-nav.hidden {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
    border: none;
    background: none;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.nav-item i {
    font-size: 24px;
}

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

.nav-item:active {
    background-color: var(--gray-50);
}

/* 페이지 컨테이너 */
.page {
    min-height: calc(100vh - var(--top-header-height) - var(--bottom-nav-height));
    background-color: var(--gray-50);
}

.page-header {
    background: white;
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--gray-600);
}

.page-content {
    padding: 16px;
}

/* 버튼 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-200);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #DC2626;
}

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

/* 카드 */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
    background-color: var(--gray-50);
}

/* 리스트 */
.list {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.list-item {
    display: block;
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:active {
    background-color: var(--gray-50);
}

/* 배지 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge-gray {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

/* 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast 알림 */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-900);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s;
    max-width: 90%;
}

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

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

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

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

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

/* 유틸리티 클래스 */
.hidden {
    display: none !important;
}

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

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--gray-600);
}

.text-small {
    font-size: 12px;
}

.font-bold {
    font-weight: 700;
}

.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; }

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* 반응형 */
@media (min-width: 768px) {
    #app {
        max-width: 768px;
        margin: 0 auto;
        box-shadow: var(--shadow-lg);
    }
    
    .page-content {
        padding: 24px;
    }
    
    .top-header {
        max-width: 768px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .bottom-nav {
        max-width: 768px;
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (min-width: 1024px) {
    .bottom-nav {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #app {
        padding-bottom: 0;
    }
    
    .page {
        min-height: calc(100vh - var(--top-header-height));
    }
}

@media (max-width: 480px) {
    .header-user-btn span {
        display: none;
    }
    
    .user-menu {
        right: 8px;
        width: calc(100vw - 16px);
        max-width: 320px;
    }
}
