/* ExpatHome Admin Panel CSS */

/* 通用变量 */
:root {
    --primary-color: #2F80ED;
    --secondary-color: #27AE60;
    --danger-color: #EB5757;
    --warning-color: #F2994A;
    --info-color: #56CCF2;
    --dark-color: #333333;
    --light-color: #F8F9FA;
    --border-color: #E0E0E0;
    --shadow: 0 5px 15px rgba(0,0,0,0.08);
    --radius: 10px;
    --radius-lg: 15px;
}

/* 基础样式重置 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
}

/* 侧边栏样式 */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), #1e5aa8);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 15px 20px;
    margin: 5px 15px;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
    text-decoration: none;
}

.sidebar .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.2);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

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

.sidebar-brand {
    padding: 20px;
    text-align: center;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}

/* 主内容区域 */
.main-content {
    margin-left: 250px;
    background: var(--light-color);
    min-height: 100vh;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* 顶部导航栏 */
.top-navbar {
    background: white;
    box-shadow: var(--shadow);
    padding: 15px 30px;
    display: flex;
    justify-content: between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-title {
    margin: 0;
    color: var(--dark-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 内容包装器 */
.content-wrapper {
    padding: 30px;
}

/* 统计卡片 */
.stats-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
    border: none;
    transition: all 0.3s ease;
    height: 100%;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark-color);
}

.stats-label {
    color: #6c757d;
    margin: 0;
    font-size: 0.9rem;
}

.stats-trend {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 表格样式 */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table {
    margin: 0;
}

.table th {
    background: var(--light-color);
    border: none;
    padding: 20px;
    font-weight: 600;
    color: var(--dark-color);
}

.table td {
    border: none;
    padding: 20px;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: rgba(47, 128, 237, 0.05);
}

/* 按钮样式 */
.btn {
    border-radius: var(--radius);
    padding: 12px 25px;
    font-weight: 500;
    border: none;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
}

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

.btn-success:hover {
    background: #16a085;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(22, 160, 133, 0.4);
}

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

.btn-danger:hover {
    background: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

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

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.4);
}

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

.btn-info:hover {
    background: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* 徽章样式 */
.badge {
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge.bg-success {
    background-color: var(--secondary-color) !important;
}

.badge.bg-danger {
    background-color: var(--danger-color) !important;
}

.badge.bg-warning {
    background-color: var(--warning-color) !important;
}

.badge.bg-info {
    background-color: var(--info-color) !important;
}

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

/* 警告框样式 */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--secondary-color);
    border-left: 4px solid var(--secondary-color);
}

.alert-danger {
    background-color: rgba(235, 87, 87, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: rgba(242, 153, 74, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: rgba(86, 204, 242, 0.1);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* 表单样式 */
.form-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}

.form-control, .form-select {
    border-radius: var(--radius);
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(47, 128, 237, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.input-group {
    position: relative;
}

.input-group-text {
    background: var(--light-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    color: #6c757d;
}

/* 模态框样式 */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 2px solid var(--light-color);
    padding: 25px 30px 20px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

.modal-body {
    padding: 30px;
}

.modal-footer {
    border-top: 2px solid var(--light-color);
    padding: 20px 30px 25px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-header {
    background: var(--light-color);
    border-bottom: 2px solid var(--border-color);
    padding: 20px 25px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-body {
    padding: 25px;
}

.card-footer {
    background: var(--light-color);
    border-top: 2px solid var(--border-color);
    padding: 15px 25px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* 面包屑导航 */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--dark-color);
    font-weight: 500;
}

/* 分页样式 */
.pagination {
    margin: 0;
}

.page-link {
    border: none;
    color: var(--primary-color);
    padding: 12px 16px;
    margin: 0 2px;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 5px 15px rgba(47, 128, 237, 0.4);
}

/* 下拉菜单 */
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 10px 0;
}

.dropdown-item {
    padding: 12px 20px;
    color: var(--dark-color);
    transition: all 0.3s ease;
}

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

.dropdown-item i {
    width: 20px;
    margin-right: 10px;
}

/* 进度条 */
.progress {
    height: 10px;
    border-radius: 5px;
    background-color: var(--light-color);
}

.progress-bar {
    border-radius: 5px;
}

/* 图表容器 */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 20px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #dee2e6;
}

.empty-state h5 {
    color: var(--dark-color);
    margin-bottom: 10px;
}

/* 加载状态 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    z-index: 1000;
}

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

/* 用户头像 */
.avatar {
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-md {
    width: 48px;
    height: 48px;
}

.avatar-lg {
    width: 64px;
    height: 64px;
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background-color: var(--secondary-color);
}

.status-offline {
    background-color: #6c757d;
}

.status-busy {
    background-color: var(--danger-color);
}

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

/* 搜索框 */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 45px;
}

.search-box .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* 标签 */
.tag {
    display: inline-block;
    background-color: var(--light-color);
    color: var(--dark-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin: 2px;
    border: 1px solid var(--border-color);
}

.tag.tag-primary {
    background-color: rgba(47, 128, 237, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.tag.tag-success {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .content-wrapper {
        padding: 20px;
    }
    
    .top-navbar {
        padding: 15px 20px;
    }
    
    .stats-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .table-responsive {
        border-radius: var(--radius-lg);
        overflow: hidden;
    }
}

@media (max-width: 576px) {
    .content-wrapper {
        padding: 15px;
    }
    
    .navbar-title {
        font-size: 1.25rem;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 20px;
    }
    
    .modal-body, .modal-header, .modal-footer {
        padding: 20px;
    }
}

/* 工具提示 */
.tooltip-inner {
    background-color: var(--dark-color);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 0.875rem;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* 打印样式 */
@media print {
    .sidebar,
    .top-navbar,
    .btn,
    .dropdown,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .stats-card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}
