/* Ant Design inspired navigation styles */

/* Navigation Bar Styles */
.navbar {
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    border-bottom: 1px solid #f0f0f0;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
}

.navbar-brand {
    color: #1890ff !important;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.navbar-brand:hover {
    color: #40a9ff !important;
}

.navbar-nav .nav-link {
    color: rgba(0,0,0,.85) !important;
    font-size: 14px;
    font-weight: 400;
    padding: 8px 12px !important;
    border-radius: 4px;
    margin: 0 2px;
    transition: all 0.3s;
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #1890ff !important;
    background-color: #e6f7ff !important;
}

.navbar-nav .nav-link.active {
    font-weight: 500;
}

/* Dropdown styles */
.dropdown-toggle::after {
    transition: transform 0.3s;
}

.show.dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    border: 1px solid #f0f0f0;
    box-shadow: 0 3px 6px -4px rgba(0,0,0,.12), 0 6px 16px 0 rgba(0,0,0,.08), 0 9px 28px 8px rgba(0,0,0,.05);
    border-radius: 6px;
    padding: 4px 0;
    min-width: 120px;
}

.dropdown-item {
    padding: 8px 12px;
    border-radius: 0;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: #e6f7ff;
    color: #1890ff;
}

/* Navbar toggler for mobile */
.navbar-toggler {
    border: none;
    outline: none !important;
    box-shadow: none;
}

.navbar-toggler:focus {
    outline: none !important;
    box-shadow: none !important;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280,0,0,0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Additional global styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    margin: 0;
    padding-top: 40px; /* Reduced padding to bring content closer to top */
}

.container {
    max-width: 1400px;
    margin: 10px auto; /* Reduced top margin */
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 20px;
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-top: 0px; /* Reduced top margin */
    margin-bottom: 15px;
    font-weight: 600;
    position: relative;
}

h1:after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: #3498db;
    margin: 10px auto;
    border-radius: 2px;
}

.date-selector, .facility-type-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 25px;
}

.date-selector > *, .facility-type-selector > * {
    margin: 5px;
}

.date-btn, .facility-type-btn {
    min-width: 120px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.date-btn:hover, .facility-type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    display: block;
}

.time-table-container {
    overflow-x: auto;
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-top: 20px;
}

.table-name-cell, .facility-name-cell {
    flex: 0 0 120px;
    padding: 15px 10px;
    text-align: center;
    font-weight: bold;
    background-color: #f8f9fa;
    color: #2c3e50;
    border-right: 1px solid #e0e6ed;
    border-bottom: 1px solid #e0e6ed;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-header {
    display: flex;
    min-width: 1440px; /* 减少宽度，因为去掉了时间标签列 */
    background-color: #f8f9fa;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.header-cell {
    flex: 1;
    padding: 12px 5px;
    text-align: center;
    background-color: #3498db;
    color: white;
    border-right: 1px solid #e0e6ed;
    font-weight: 600;
    min-width: 60px;
    font-size: 12px;
}

.header-cell:first-child {
    border-radius: 10px 0 0 0;
}

.header-cell:last-child {
    border-right: none;
    border-radius: 0 10px 0 0;
}

.time-row {
    display: flex;
    min-width: 1440px; /* 减少宽度，因为去掉了时间标签列 */
    border-bottom: 1px solid #e0e6ed;
}

.time-row:last-child {
    border-bottom: none;
}

.time-slots {
    display: flex;
    flex: 1;
}

.time-slot {
    flex: 1;
    height: 60px;
    border-right: 1px solid #e0e6ed;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #e8f4fc;
    min-width: 60px;
}

.time-slot:last-child {
    border-right: none;
}

.time-slot.available {
    background-color: #d4edda;
}

.time-slot.available:hover {
    background-color: #c3e6cb;
    transform: scale(1.05);
    z-index: 1;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

.time-slot.booked {
    background-color: #fadbd8;
    cursor: not-allowed;
}

.time-slot.selected {
    background-color: #aed6f1;
}

.booking-info {
    position: absolute;
    top: 50%;
    left: 2px;
    right: 2px;
    transform: translateY(-50%);
    font-size: 10px;
    text-align: center;
    color: #7f8c8d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

/* 设施标题样式 */
.facility-title {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0 5px 0;
    text-align: center;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

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

.modal-header {
    background: linear-gradient(to right, #3498db, #2c3e50);
    color: white;
    border-radius: 10px 10px 0 0;
}

.modal-title {
    font-weight: 600;
}

.modal-footer {
    background-color: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* 表单元素样式 */
.form-control, .form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 8px 12px;
    transition: border-color 0.3s;
}

.form-control:focus, .form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 10px;
    }

    .date-selector {
        gap: 5px;
    }

    .date-btn {
        min-width: 90px;
        font-size: 12px;
        padding: 6px 8px;
    }

    .time-table-container {
        font-size: 12px;
    }

    .header-cell, .time-slot {
        min-width: 35px;
        padding: 8px 2px;
        font-size: 11px;
    }

    .table-name {
        min-width: 70px;
        padding: 10px 5px;
        font-size: 14px;
    }

    h1 {
        font-size: 1.5rem;
    }
    
    body {
        padding-top: 0;
    }
}

/* 预订列表样式 */
.booking-list-container {
    margin-top: 30px;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.booking-list-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.booking-item {
    background-color: white;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.booking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.booking-info {
    flex: 1;
}

.booking-date {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 16px;
}

.booking-time {
    color: #3498db;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.booking-table {
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 14px;
}

.booking-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 13px;
}

.booking-name, .booking-phone, .booking-remark {
    display: inline-flex;
    align-items: center;
}

.booking-name strong, .booking-phone strong, .booking-remark strong {
    margin-right: 5px;
    color: #2c3e50;
}

.booking-created {
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
}

.cancel-btn {
    margin-left: 15px;
    min-width: 60px;
}

.no-bookings {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 20px;
}