/* 学生请假管理系统样式文件 */

/* 全局样式 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --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);
    --transition: all 0.15s ease-in-out;
}

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

/* 导航栏样式 */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

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

.card-header {
    border-bottom: none;
    font-weight: 600;
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    transition: var(--transition);
}

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

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* 轮播图样式 */
#schoolCarousel {
    margin-bottom: 0;
}

.carousel-image {
    height: 500px;
    object-fit: cover;
    object-position: center;
}

.carousel-caption {
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--border-radius);
    padding: 2rem;
    bottom: 2rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
}

.carousel-overlay {
    backdrop-filter: blur(5px);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.carousel-caption h2 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
}

.carousel-caption p {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    font-size: 1.1rem;
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
    transition: var(--transition);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-indicators {
    margin-bottom: 1rem;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid white;
    transition: var(--transition);
}

.carousel-indicators button.active {
    background-color: white;
    transform: scale(1.2);
}

/* 首页特色样式 */
.hero-section {
    padding: 3rem 0;
}

.feature-icon {
    margin-bottom: 1rem;
}

.step-number {
    margin-bottom: 1rem;
}

.step-number .badge {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* 仪表板样式 */
.dashboard-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.dashboard-card .card-body {
    padding: 2rem;
}

.dashboard-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-card {
    transition: var(--transition);
}

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

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* 侧边栏样式 */
.sidebar {
    min-height: calc(100vh - 76px);
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    transition: var(--transition);
}

.sidebar .nav-link {
    color: var(--dark-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.25rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

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

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

/* 移动端侧边栏优化 */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 56px);
        z-index: 1040;
        background-color: white;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar .nav-link {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-radius: 0;
        margin-bottom: 0;
        border-bottom: 1px solid #f8f9fa;
    }

    .sidebar .nav-link i {
        width: 24px;
        margin-right: 1rem;
        font-size: 1.1rem;
    }

    /* 移动端遮罩层 */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1039;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* 主内容区域调整 */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 1rem;
    }
}

/* 表格样式 */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table th {
    background-color: var(--light-color);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* 状态标签样式 */
.status-pending {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.status-approved {
    background-color: var(--success-color);
    color: white;
}

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

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

/* 时间轴样式 */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 3px solid white;
    box-shadow: 0 0 0 3px #dee2e6;
}

/* 文件上传样式 */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--success-color);
    background-color: rgba(25, 135, 84, 0.05);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .carousel-image {
        height: 300px;
    }

    .carousel-caption {
        padding: 1rem;
        bottom: 1rem;
        width: 90%;
    }

    .carousel-caption h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .carousel-caption p {
        font-size: 0.9rem;
        margin-bottom: 0;
    }

    .hero-section {
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

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

    .sidebar {
        min-height: auto;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    /* 移动端页面标题优化 */
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .btn-toolbar {
        margin-top: 1rem;
        margin-bottom: 0 !important;
    }

    /* 移动端卡片优化 */
    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* 移动端表格优化 */
    .table-responsive {
        border: none;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }

    /* 移动端按钮优化 */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        margin-bottom: 0.5rem;
        border-radius: 0.375rem !important;
    }
}

@media (max-width: 576px) {
    .carousel-image {
        height: 250px;
    }

    .carousel-caption {
        display: none !important;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 8%;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    /* 超小屏幕优化 */
    .navbar-brand {
        font-size: 1rem;
    }

    .navbar-brand i {
        display: none;
    }

    .display-4 {
        font-size: 1.8rem;
    }

    .lead {
        font-size: 1rem;
    }

    /* 移动端表格进一步优化 */
    .table th,
    .table td {
        padding: 0.25rem;
        font-size: 0.75rem;
    }

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

    /* 移动端模态框优化 */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    /* 移动端表单优化 */
    .form-control,
    .form-select {
        font-size: 16px; /* 防止iOS缩放 */
    }

    .form-label {
        font-size: 0.9rem;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .sidebar,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
    
    .table {
        font-size: 0.875rem;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #343a40;
        --dark-color: #f8f9fa;
    }
    
    body {
        background-color: #121212;
        color: var(--dark-color);
    }
    
    .card {
        background-color: #1e1e1e;
        color: var(--dark-color);
    }
    
    .table {
        color: var(--dark-color);
    }
    
    .table th {
        background-color: #2d2d2d;
        border-color: #404040;
    }
    
    .sidebar {
        background-color: #1e1e1e;
        border-color: #404040;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

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

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

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

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

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