/* 全局样式 */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --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.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 60px; /* 为页脚预留空间 */
}

/* 让页脚始终在底部 */
.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60px; /* 设置页脚高度 */
    background-color: var(--light-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    padding: 0 1rem;
}

/* 主要内容区域样式 */
.container {
    margin-bottom: 2rem; /* 增加底部边距 */
}

/* 导航栏样式 */
.navbar {
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

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

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

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

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

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

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

/* 表单样式 */
.form-control {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    transition: var(--transition);
}

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

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

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

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

/* 座位预约样式 */
.seat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.seat {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.seat-available {
    background-color: #e7f5ff;
    color: var(--primary-color);
    border: 1px solid #b8daff;
}

.seat-available:hover {
    background-color: #cfe7ff;
}

.seat-occupied {
    background-color: #f8d7da;
    color: var(--danger-color);
    border: 1px solid #f5c2c7;
    cursor: not-allowed;
}

.seat-selected {
    background-color: #d1e7dd;
    color: var(--success-color);
    border: 1px solid #badbcc;
}

/* 响应式调整 */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px; /* 增加底部padding以适应移动端页脚 */
        font-size: 14px;
    }

    .container {
        padding-left: 12px;
        padding-right: 12px;
        margin-bottom: 2rem; /* 增加底部边距，确保内容不被页脚遮挡 */
    }
    
    .card {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* 用户信息区域优化 */
    .user-info-section {
        margin-bottom: 2rem; /* 增加底部间距 */
        padding: 1rem;
    }

    .user-info-section .list-group-item {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* 页脚优化 */
    .footer {
        height: auto;
        min-height: 60px;
        padding: 0.75rem;
        text-align: center;
        font-size: 0.75rem;
        position: fixed; /* 固定在底部 */
        background-color: rgba(248, 249, 250, 0.95); /* 半透明背景 */
        backdrop-filter: blur(5px); /* 毛玻璃效果 */
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05); /* 添加顶部阴影 */
    }

    /* 消息区域优化 */
    .message-section {
        margin-bottom: 4rem; /* 确保消息区域不被页脚遮挡 */
    }

    /* 按钮组优化 */
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .btn-group .btn {
        flex: 1;
        min-width: auto;
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    /* 表单控件优化 */
    .form-control {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    /* 标题优化 */
    h3, .h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    h4, .h4 {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }

    .container {
        padding-left: 8px;
        padding-right: 8px;
        margin-bottom: 1rem;
    }
    
    .card {
        margin-bottom: 0.75rem;
        border-radius: 0.5rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .card-header {
        padding: 0.75rem;
    }

    /* 移动端表格优化 */
    .table-responsive {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        width: 100%;
        margin-bottom: 0;
        font-size: 0.875rem;
    }

    .table td, .table th {
        padding: 0.5rem;
        white-space: nowrap;
        min-width: 80px;  /* 设置最小宽度 */
    }

    .table td:first-child, .table th:first-child {
        position: sticky;
        left: 0;
        background: #fff;
        z-index: 1;
    }

    /* 移动端按钮和操作列优化 */
    .table td:last-child {
        min-width: 120px;
        text-align: right;
    }

    .table .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        margin: 0.125rem;
        width: auto;
    }

    /* 移动端状态标签优化 */
    .table .badge {
        font-size: 0.75rem;
        padding: 0.25em 0.5em;
        white-space: nowrap;
        display: inline-block;
    }

    /* 移动端用户管理卡片优化 */
    .col-lg-8 {
        padding: 0;
    }

    /* 移动端系统操作卡片优化 */
    .col-lg-4 {
        padding: 0;
    }

    /* 移动端按钮组优化 */
    .btn-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .btn-group .btn {
        flex: 1;
        min-width: auto;
        white-space: nowrap;
    }

    /* 移动端头部信息优化 */
    .avatar-circle {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    /* 移动端警告框优化 */
    .alert {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
        font-size: 0.875rem;
    }

    /* 移动端列表组优化 */
    .list-group-item {
        padding: 0.625rem;
    }

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

    .modal-body {
        padding: 1rem;
        font-size: 0.875rem;
    }

    .modal-footer {
        padding: 0.75rem;
    }

    /* 移动端导航栏优化 */
    .navbar-brand {
        font-size: 1rem;
    }

    .nav-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

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

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

/* 加载动画 */
.spinner {
    width: 40px;
    height: 40px;
    margin: 30px auto;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* 自定义徽章样式 */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* 表单验证样式 */
.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* 用户头像 */
.avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

/* 倒计时样式 */
.countdown-timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    background: rgba(0, 123, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: inline-block;
    margin-bottom: 0.25rem;
}

/* 预约状态通知样式 */
#reservation-status {
    transition: all 0.3s ease;
}

#reservation-status.alert-success {
    background-color: rgba(40, 167, 69, 0.15);
    border-color: rgba(40, 167, 69, 0.3);
    color: #155724;
}

#reservation-status.alert-danger {
    background-color: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
    color: #721c24;
}

#reservation-status.alert-warning {
    background-color: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.3);
    color: #856404;
} 