/* 商家后台样式 */

/* 图表容器样式 */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin-bottom: 2rem;
}

.chart-container canvas {
    max-height: 300px !important;
}

/* 确保图表不会无限延伸 */
#bookingTrendChart,
#courtUsageChart,
#revenueChart {
    max-height: 300px !important;
    height: 300px !important;
}

/* 场地排布编辑器样式 */
.layout-canvas-container {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    min-height: 400px;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.layout-canvas {
    width: 100%;
    height: 100%;
    min-height: 400px;
    position: relative;
    background-image: 
        linear-gradient(rgba(0,0,0,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* 场地元素样式 */
.court-item {
    position: absolute;
    width: 120px;
    height: 80px;
    border: 2px solid #007bff;
    border-radius: 0.5rem;
    background: white;
    cursor: move;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    user-select: none;
}

.court-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.court-item.dragging {
    opacity: 0.7;
    transform: rotate(5deg);
    z-index: 1000;
}

.court-item.selected {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

/* 场地类型样式 */
.court-item.standard {
    border-color: #007bff;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.court-item.vip {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
}

.court-item.training {
    border-color: #28a745;
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
}

.court-item.competition {
    border-color: #dc3545;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

.court-item.maintenance {
    border-color: #6c757d;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    opacity: 0.6;
}

.court-item.occupied {
    border-color: #fd7e14;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

/* 场地信息显示 */
.court-info {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;
}

.court-name {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.court-status {
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
    color: white;
}

.court-status.available {
    background: #28a745;
}

.court-status.occupied {
    background: #fd7e14;
}

.court-status.maintenance {
    background: #6c757d;
}

/* 场地工具箱样式 */
.court-toolbox {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
}

.toolbox-item {
    text-align: center;
    padding: 1rem;
    border-radius: 0.5rem;
    cursor: grab;
    transition: all 0.2s ease;
    background: white;
    border: 2px solid transparent;
}

.toolbox-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.toolbox-item:active {
    cursor: grabbing;
}

.court-preview {
    width: 60px;
    height: 40px;
    margin: 0 auto 0.5rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.court-preview.standard-court {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.court-preview.vip-court {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.court-preview.training-court {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.court-preview.competition-court {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* 拖拽状态样式 */
.layout-canvas.drag-over {
    background-color: #e3f2fd;
    border-color: #007bff;
}

/* 场地编辑模式 */
.court-item.editing {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

.court-name-input {
    background: transparent;
    border: none;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    width: 100%;
    outline: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .court-item {
        width: 100px;
        height: 70px;
    }
    
    .court-preview {
        width: 50px;
        height: 35px;
        font-size: 1rem;
    }
    
    .layout-canvas {
        min-height: 300px;
    }
}
.sidebar {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 4px 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

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

/* 商家专用样式 */
.merchant-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.merchant-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.merchant-card:hover {
    transform: translateY(-2px);
}

/* 场地状态样式 */
.court-status-available {
    color: #28a745;
    font-weight: bold;
}

.court-status-occupied {
    color: #ffc107;
    font-weight: bold;
}

.court-status-maintenance {
    color: #dc3545;
    font-weight: bold;
}

/* 预订状态样式 */
.booking-status-pending {
    color: #6c757d;
}

.booking-status-confirmed {
    color: #28a745;
}

.booking-status-cancelled {
    color: #dc3545;
}

.booking-status-completed {
    color: #007bff;
}

/* 评价样式 */
.rating-stars {
    color: #ffc107;
}

.rating-breakdown .progress {
    height: 20px;
    background-color: #e9ecef;
}

.rating-breakdown .progress-bar {
    background-color: #ffc107;
}

/* 财务统计样式 */
.finance-summary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
}

.finance-item {
    text-align: center;
    padding: 15px;
}

.finance-item h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.finance-item p {
    margin-bottom: 0;
    opacity: 0.9;
}

/* 设置面板样式 */
.settings-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.settings-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
}

/* 通知样式 */
.notification-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid #007bff;
}

.notification-item.unread {
    border-left-color: #dc3545;
    background-color: #fff5f5;
}

.notification-item.success {
    border-left-color: #28a745;
    background-color: #f8fff8;
}

.notification-item.warning {
    border-left-color: #ffc107;
    background-color: #fffef8;
}

/* 日历样式 */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.calendar-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-nav button {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.calendar-nav button:hover {
    background: #e9ecef;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-day {
    background: white;
    padding: 10px;
    text-align: center;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.calendar-day:hover {
    background: #f8f9fa;
}

.calendar-day.today {
    background: #007bff;
    color: white;
}

.calendar-day.has-booking {
    background: #28a745;
    color: white;
}

.calendar-day.fully-booked {
    background: #dc3545;
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .merchant-sidebar {
        min-height: auto;
    }
    
    .merchant-card {
        margin-bottom: 15px;
    }
    
    .finance-summary {
        padding: 15px;
    }
    
    .finance-item h3 {
        font-size: 1.5rem;
    }
    
    .settings-panel {
        padding: 15px;
    }
    
    .calendar-grid {
        gap: 0.5px;
    }
    
    .calendar-day {
        padding: 5px;
        min-height: 30px;
        font-size: 0.8rem;
    }
}

/* 动画效果 */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.content-section {
    animation: slideInFromRight 0.3s ease-out;
}

.content-section.slide-left {
    animation: slideInFromLeft 0.3s ease-out;
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
