/* 전역 변수 */
:root {
    /* 색상 */
    --primary: #007bff;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    
    /* 폰트 */
    --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    
    /* 간격 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* 그림자 */
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,.175);
    
    /* 전환 */
    --transition-base: all .2s ease-in-out;
    --transition-fade: opacity .15s linear;
    --transition-collapse: height .35s ease;
}

/* 기본 스타일 */
body {
    font-family: var(--font-family-sans-serif);
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 타이포그래피 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: #0056b3;
    text-decoration: none;
}

/* 버튼 */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: var(--transition-base);
}

.btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* 카드 */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: 0.25rem;
    transition: var(--transition-base);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* 테이블 */
.table {
    width: 100%;
    margin-bottom: var(--spacing-md);
    color: var(--dark);
    background-color: transparent;
}

.table th,
.table td {
    padding: var(--spacing-sm);
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background-color: var(--light);
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: rgba(0,0,0,.075);
}

/* 폼 */
.form-control {
    display: block;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: var(--transition-base);
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* 페이지네이션 */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
}

.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: var(--primary);
    background-color: #fff;
    border: 1px solid #dee2e6;
}

.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

/* 유틸리티 클래스 */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.rounded { border-radius: 0.25rem !important; }
.rounded-sm { border-radius: 0.2rem !important; }
.rounded-lg { border-radius: 0.3rem !important; }

/* 커스텀 뱃지 스타일 (Bootstrap 우선순위 문제 해결용) */
.badge-danger-custom {
    background-color: #dc3545 !important;
    color: white !important;
}

.badge-success-custom {
    background-color: #28a745 !important;
    color: white !important;
}

/* 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* 반응형 디자인 */
@media (max-width: 576px) {
    .container {
        max-width: 100%;
        padding-right: var(--spacing-sm);
        padding-left: var(--spacing-sm);
    }
}

@media (max-width: 768px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #2d2d2d;
        --dark: #f0f0f0;
    }
    
    body {
        background-color: #1a1a1a;
        color: var(--dark);
    }
    
    .card {
        background-color: #2d2d2d;
        border-color: #404040;
    }
    
    .table {
        color: var(--dark);
    }
    
    .table th,
    .table td {
        border-color: #404040;
    }
    
    .table thead th {
        background-color: #2d2d2d;
        border-color: #404040;
    }
    
    .table tbody tr:hover {
        background-color: rgba(255,255,255,.075);
    }
    
    .form-control {
        color: var(--dark);
        background-color: #2d2d2d;
        border-color: #404040;
    }
    
    .form-control:focus {
        color: var(--dark);
        background-color: #2d2d2d;
        border-color: #0056b3;
    }
    
    .page-link {
        color: var(--primary);
        background-color: #2d2d2d;
        border-color: #404040;
    }
}

/* 성능 최적화 */
* {
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
}

/* 접근성 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* 프린트 스타일 */
@media print {
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
    
    .no-print {
        display: none !important;
    }
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.logo:hover {
    color: #007bff;
    text-decoration: none;
}

