/**
 * 智慧停车管理系统 - 自定义样式
 */

/* ==================== 全局样式 ==================== */
:root {
    --sidebar-width: 250px;
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

/* ==================== 侧边栏 ==================== */
#sidebar-wrapper {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.25s ease-out;
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.2rem;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: calc(-1 * var(--sidebar-width));
}

/* ==================== 卡片增强 ==================== */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

/* ==================== 统计卡片 ==================== */
.stat-card {
    border-left: 4px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-card.primary {
    border-left-color: var(--primary-color);
}

.stat-card.success {
    border-left-color: #198754;
}

.stat-card.warning {
    border-left-color: #ffc107;
}

.stat-card.danger {
    border-left-color: #dc3545;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* ==================== 表格样式 ==================== */
.table th {
    font-weight: 600;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

/* ==================== 状态徽章 ==================== */
.badge-status {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* ==================== 表单优化 ==================== */
.form-control:focus,
.form-select:focus {
    border-color: rgba(13, 110, 253, 0.25);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ==================== 按钮增强 ==================== */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
}

/* ==================== 导航栏 ==================== */
.navbar {
    height: 56px;
}

/* ==================== 内容区 ==================== */
#page-content-wrapper {
    min-width: 0;
    width: 100%;
}

footer {
    width: 100%;
}

.container-fluid {
    max-width: 100%;
}

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

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

.search-box .form-control {
    padding-left: 36px;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==================== 加载动画 ==================== */
.loading-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #dee2e6;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }

    .stat-card {
        margin-bottom: 1rem;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    #sidebar-wrapper,
    .navbar,
    footer {
        display: none !important;
    }

    #page-content-wrapper {
        margin: 0 !important;
    }
}
