/**
 * 床位列表页面样式
 * Bed List Page Styles
 */

.hospital-bed-list-page {
    width: 100%;
    padding: 20px;
    font-size: 14px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.page-title {
    font-size: 28px;
    color: #2d3748;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title .dashicons {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 10px;
}

.bed-filters {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 400px;
}

.filter-group label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.filter-group select,
.filter-group input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 14px;
    min-height: 40px;
    box-sizing: border-box;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    border-color: transparent;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border-color: #cbd5e0;
}

.btn-secondary:hover {
    background: #cbd5e0;
    color: #2d3748;
    border-color: #a0aec0;
    text-decoration: none;
}

.bed-stats-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 30px;
}

.bed-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-total .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-available .stat-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.stat-occupied .stat-icon {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
}

.stat-maintenance .stat-icon {
    background: linear-gradient(135deg, #fd7e14 0%, #f39c12 100%);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-percentage {
    font-size: 12px;
    color: #999;
    font-weight: 600;
}

/* 占用率图表 */
.occupancy-chart {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.chart-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2d3748;
    font-weight: 600;
}

.occupancy-rate {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
}

.chart-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.chart-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    transition: width 0.8s ease;
}

.chart-legend {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.legend-occupied {
    color: #dc3545;
    font-weight: 600;
}

.legend-available {
    color: #28a745;
    font-weight: 600;
}

/* 科室统计 */
.department-stats {
    margin-bottom: 30px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    color: #2d3748;
    margin-bottom: 20px;
    font-weight: 600;
}

.section-title .dashicons {
    color: #667eea;
    font-size: 24px;
}

.department-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.department-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.department-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.department-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.department-header h4 {
    margin: 0;
    font-size: 16px;
    color: #2d3748;
    font-weight: 600;
}

.department-total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.department-breakdown {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.breakdown-item {
    text-align: center;
    flex: 1;
}

.breakdown-count {
    display: block;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.breakdown-item.available .breakdown-count {
    color: #28a745;
}

.breakdown-item.occupied .breakdown-count {
    color: #dc3545;
}

.breakdown-item.maintenance .breakdown-count {
    color: #fd7e14;
}

.breakdown-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.department-rate {
    text-align: center;
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
    padding: 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}

/* 床位网格容器 */
.beds-grid-container {
    margin-bottom: 30px;
}

.beds-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-top: 20px;
}

/* 床位卡片 */
.bed-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 280px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bed-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
}

.bed-card.bed-available {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

.bed-card.bed-occupied {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff8f8 0%, #ffeaea 100%);
}

.bed-card.bed-maintenance {
    border-color: #fd7e14;
    background: linear-gradient(135deg, #fffaf7 0%, #fff0e6 100%);
}

/* 床位状态指示器 */
.bed-card .bed-status-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px white;
}

.bed-status-indicator.status-available {
    background: #28a745;
    animation: pulse-green 2s infinite;
}

.bed-status-indicator.status-occupied {
    background: #dc3545;
    animation: pulse-red 2s infinite;
}

.bed-status-indicator.status-maintenance {
    background: #fd7e14;
    animation: pulse-orange 2s infinite;
}

/* 床位卡片头部 */
.bed-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.bed-card .bed-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.bed-available .bed-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.bed-occupied .bed-icon {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.bed-maintenance .bed-icon {
    background: linear-gradient(135deg, #fd7e14 0%, #f39c12 100%);
    box-shadow: 0 4px 8px rgba(253, 126, 20, 0.3);
}

.bed-basic-info {
    flex: 1;
}

.bed-card .bed-number {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 4px;
}

.bed-card .bed-type {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* 床位卡片信息段 */
.bed-card-section {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

.section-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 16px;
    flex-shrink: 0;
}

.section-content {
    flex: 1;
    min-width: 0;
}

.section-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-value {
    font-size: 14px;
    color: #2d3748;
    font-weight: 600;
    word-wrap: break-word;
}

/* 患者信息段 */
.patient-section {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
}

.patient-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.patient-name {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.patient-phone {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #666;
}

.patient-phone .dashicons {
    font-size: 14px;
}

.no-patient {
    font-size: 14px;
    color: #999;
    font-style: italic;
}

/* 脉冲动画 */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 3px white, 0 0 0 6px rgba(40, 167, 69, 0.3); }
    50% { box-shadow: 0 0 0 3px white, 0 0 0 10px rgba(40, 167, 69, 0.1); }
    100% { box-shadow: 0 0 0 3px white, 0 0 0 6px rgba(40, 167, 69, 0.3); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 3px white, 0 0 0 6px rgba(220, 53, 69, 0.3); }
    50% { box-shadow: 0 0 0 3px white, 0 0 0 10px rgba(220, 53, 69, 0.1); }
    100% { box-shadow: 0 0 0 3px white, 0 0 0 6px rgba(220, 53, 69, 0.3); }
}

@keyframes pulse-orange {
    0% { box-shadow: 0 0 0 3px white, 0 0 0 6px rgba(253, 126, 20, 0.3); }
    50% { box-shadow: 0 0 0 3px white, 0 0 0 10px rgba(253, 126, 20, 0.1); }
    100% { box-shadow: 0 0 0 3px white, 0 0 0 6px rgba(253, 126, 20, 0.3); }
}

.department-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.department-info .dashicons {
    color: #666;
    font-size: 14px;
}

.status-badge,
.bed-card .status-badge {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bed-card .status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    white-space: nowrap;
}

.status-available {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-occupied {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-maintenance {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}

.no-patient,
.no-room {
    color: #999;
    font-style: italic;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-data .dashicons {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-data p {
    font-size: 16px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .bed-stats-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .occupancy-chart {
        max-width: 400px;
        margin: 0 auto;
    }

    .beds-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .beds-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }

    .bed-card {
        min-height: 260px;
    }
}

@media (max-width: 768px) {
    .hospital-bed-list-page {
        padding: 15px;
    }

    .page-title {
        font-size: 24px;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: auto;
    }

    .bed-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .stat-card {
        padding: 16px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .stat-value {
        font-size: 24px;
    }

    .department-grid {
        grid-template-columns: 1fr;
    }

    .beds-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .bed-card {
        padding: 16px;
        min-height: 240px;
        gap: 12px;
    }

    .bed-card .bed-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .bed-card .bed-number {
        font-size: 18px;
    }

    .bed-card .bed-type {
        font-size: 13px;
    }

    .bed-card .status-badge {
        padding: 4px 8px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .bed-stats {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 12px;
    }

    .occupancy-chart {
        padding: 16px;
    }

    .chart-header h3 {
        font-size: 16px;
    }

    .occupancy-rate {
        font-size: 24px;
    }

    .beds-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .bed-card {
        padding: 12px;
        min-height: 200px;
        gap: 10px;
    }

    .bed-card .bed-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .bed-card .bed-number {
        font-size: 16px;
    }

    .bed-card .bed-type {
        font-size: 12px;
    }

    .bed-card .status-badge {
        padding: 3px 6px;
        font-size: 9px;
    }

    .section-label {
        font-size: 11px;
    }

    .section-value {
        font-size: 13px;
    }

    .patient-name {
        font-size: 13px;
    }

    .no-patient {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .beds-grid {
        grid-template-columns: 1fr;
    }

    .bed-card {
        min-height: 180px;
    }
}