/* CSS Variables */
:root {
    /* Colors */
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #007bff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    /* Text Colors */
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --text-light: #fff;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-light: #f1f3f4;
    --bg-dark: #343a40;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 50%;
    
    /* Box Shadow */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Layout */
    --header-height: 126px; /* 업데이트된 헤더 높이 (78px + 48px) */
    --container-max-width: 1200px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

ul, ol, li {
    margin: 0;
    padding: 0;
    list-style: none;
}

body {
    font-family: var(--font-family-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #F6F4F4;
    padding-top: 126px; /* JavaScript에서 동적으로 재설정됨 */
    margin: 0;
    overflow-x: hidden;
}

/* Utility Classes */
.main-hidden {
    display: none !important;
}

.main-show {
    display: block !important;
}

.main-show-flex {
    display: flex !important;
}

.main-show-inline {
    display: inline !important;
}

.show-inline-block {
    display: inline-block !important;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* Layout */
.layout-main .layout-main-content {
    min-height: calc(100vh - 140px); /* header + footer 높이 제외 */
    margin-top: 0; /* sticky header 사용으로 margin 제거 */
}

/* 페이지 컨테이너 - header 겹침 방지 */
main, .container, .page-container, .content-wrapper {
    margin-top: 0; /* sticky header로 인해 margin 불필요 */
}

/* 이미 margin-top이 있는 경우 덮어쓰지 않음 */
main:has([style*="margin-top"]), 
.container:has([style*="margin-top"]), 
.page-container:has([style*="margin-top"]) {
    margin-top: inherit;
}

/* Global Loading Indicator */
.global-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.global-loading.show {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Banner Loading Skeleton */
.banner-skeleton {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, 
        rgba(240, 240, 240, 0) 0%, 
        rgba(240, 240, 240, 0.8) 50%, 
        rgba(240, 240, 240, 0) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive Utilities */
@media (max-width: 768px) {
    body {
        padding-top: 90px; /* 태블릿에서 전체 헤더 높이 */
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }
    
    .loading-text {
        font-size: var(--font-size-base);
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 80px; /* 작은 모바일에서 전체 헤더 높이 */
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    
    .loading-text {
        font-size: var(--font-size-sm);
    }
}


