/**
 * 영업 관리 시스템 스타일시트
 * 작성일: 2025-08-31
 * Bootstrap 5 기반 커스텀 스타일
 */

/* 공통 스타일 */
:root {
    --primary-color: #2c5aa0;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #fd7e14;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    line-height: 1.6;
}

/* 헤더 스타일 */
.navbar-brand {
    font-weight: bold;
    color: var(--primary-color) !important;
}

.navbar-custom {
    background: linear-gradient(135deg, var(--primary-color), #1e4080);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-custom .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: color 0.3s ease;
}

.navbar-custom .navbar-nav .nav-link:hover,
.navbar-custom .navbar-nav .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

/* 사이드바 스타일 */
.sidebar {
    min-height: calc(100vh - 56px);
    background: #ffffff;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    border-right: 1px solid #e9ecef;
}

.sidebar .nav-link {
    color: var(--dark-color);
    padding: 0.75rem 1rem;
    margin: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white !important;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

/* 메인 콘텐츠 스타일 */
.main-content {
    background-color: #f5f7fa;
    min-height: calc(100vh - 56px);
    padding: 2rem 0;
}

/* 카드 스타일 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #1e4080);
    color: white;
    border-bottom: none;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* 대시보드 통계 카드 */
.stats-card {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-left: 4px solid var(--primary-color);
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stats-card p {
    color: var(--secondary-color);
    margin-bottom: 0;
    font-weight: 500;
}

/* 테이블 스타일 */
.table-custom {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table-custom thead {
    background: var(--light-color);
}

.table-custom th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
    padding: 1rem;
}

.table-custom td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(0, 0, 0, 0.02);
}

/* 버튼 스타일 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #1e4080);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e4080, var(--primary-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(44, 90, 160, 0.3);
}

.btn-sm {
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 폼 스타일 */
.form-control {
    border: 1px solid #e0e6ed;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-select {
    border: 1px solid #e0e6ed;
    border-radius: var(--border-radius);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

/* 알림 스타일 */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #0a3622;
    border-left-color: var(--success-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #58151c;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #664d03;
    border-left-color: var(--warning-color);
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #055160;
    border-left-color: var(--info-color);
}

/* 모달 스타일 */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: var(--light-color);
    border-bottom: 1px solid #e9ecef;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-title {
    color: var(--dark-color);
    font-weight: 600;
}

/* 로딩 스피너 */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 2rem;
}

.spinner-border {
    color: var(--primary-color);
}

/* 페이지네이션 스타일 */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #e9ecef;
    padding: 0.5rem 0.75rem;
}

.pagination .page-link:hover {
    background-color: var(--light-color);
    border-color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 드롭다운 스타일 */
.dropdown-menu {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--light-color);
}

/* 배지 스타일 */
.badge {
    border-radius: var(--border-radius);
    padding: 0.375rem 0.75rem;
    font-weight: 500;
}

/* 푸터 스타일 */
.footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 1rem 0;
    margin-top: auto;
    text-align: center;
}

/* 로그인 페이지 스타일 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #1e4080);
}

.login-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--secondary-color);
    margin-bottom: 0;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stats-card h3 {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        border-radius: var(--border-radius);
    }
    
    .sidebar {
        position: fixed;
        top: 56px;
        left: -250px;
        width: 250px;
        height: calc(100vh - 56px);
        z-index: 1050;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .table-custom th,
    .table-custom td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* 커스텀 유틸리티 클래스 */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.border-primary-custom {
    border-color: var(--primary-color) !important;
}

.shadow-custom {
    box-shadow: var(--box-shadow) !important;
}

.rounded-custom {
    border-radius: var(--border-radius) !important;
}

/* 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

/* 차트 컨테이너 */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* 프린트 스타일 */
@media print {
    .navbar,
    .sidebar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}