/**
 * 智慧林业管理平台 - 增强样式文件
 * 专为林业管理人员优化的界面改进
 */

/* 1. 延长通知停留时间 - 修改通知显示时长为5秒 */
.notification {
    background: var(--card-bg);
    color: var(--text-white);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--accent-green);
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease;
    min-width: 300px;
    max-width: 400px;
    /* 增加停留时间到5秒 */
    animation-duration: 5s;
}

/* 2. 修复左侧实时监控状态文字超出问题 */
.monitoring-status .status-info {
    flex: 1;
    min-width: 0; /* 允许flex项目缩小 */
}

.monitoring-status .status-title {
    font-size: 0.85rem !important;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.monitoring-status .status-value {
    font-size: 0.8rem !important;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.monitoring-status .status-detail {
    font-size: 0.75rem !important;
    color: var(--text-muted);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 确保状态项目不会超出容器 */
.monitoring-status .status-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.8rem;
    margin-bottom: 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border-left: 6px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

/* 3. 修复右侧今日重点工作按钮居中问题 */
.task-actions {
    display: flex;
    justify-content: center; /* 居中对齐 */
    align-items: center;
    gap: 0.8rem;
    margin-top: 1rem;
    padding: 0.8rem 0;
}

.task-actions .action-btn {
    flex: 1;
    max-width: 120px; /* 限制按钮最大宽度 */
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.task-actions .action-btn.primary {
    background: var(--accent-green);
    color: var(--text-white);
}

.task-actions .action-btn.primary:hover {
    background: var(--light-green);
    transform: translateY(-1px);
}

.task-actions .action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border: 1px solid var(--border-color);
}

.task-actions .action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* 4. 去除护林员状态下面的白色背景 */
.ranger-summary {
    background: transparent !important; /* 移除白色背景 */
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.ranger-stat-item {
    background: var(--primary-green) !important;
    border-radius: 8px;
    padding: 0.8rem;
    text-align: center;
    border: 1px solid var(--accent-green);
    transition: all 0.3s ease;
}

.ranger-item {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--nature-green);
    margin-bottom: 0.6rem;
    transition: all 0.3s ease;
    padding: 0.6rem;
    border-radius: 8px;
}

/* 5. 加大左下角智慧林业管理平台文字大小到1.3rem */
.status-footer {
    background: rgba(255, 255, 255, 0.95);
    color: #555555;
    padding: 0.6rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
}

/* 系统状态保持原有大小，去掉平台名称相关样式 */
.status-footer .system-status {
    font-size: 0.8rem !important;
    font-weight: 500;
    color: #555555 !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

/* 6. 模块化整理 - 统一组件样式 */

/* 6.1 统一面板样式 */
.panel-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    color: var(--text-white);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-title i {
    color: var(--accent-green);
    font-size: 1rem;
}

/* 6.2 统一按钮样式 */
.btn-primary {
    background: var(--accent-green);
    color: var(--text-white);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-primary:hover {
    background: var(--light-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(82, 183, 136, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* 6.3 统一状态标签样式 */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    display: inline-block;
}

.status-badge.normal,
.status-badge.online {
    background: var(--success-green);
    color: var(--text-white);
}

.status-badge.warning {
    background: var(--warning-orange);
    color: var(--text-white);
}

.status-badge.danger,
.status-badge.error {
    background: var(--danger-red);
    color: var(--text-white);
}

.status-badge.info {
    background: var(--info-blue);
    color: var(--text-white);
}

.status-badge.in-progress {
    background: var(--warning-orange);
    color: var(--text-white);
}

.status-badge.pending {
    background: var(--text-secondary);
    color: var(--text-white);
}

.status-badge.completed {
    background: var(--success-green);
    color: var(--text-white);
}

/* 6.4 统一卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    color: var(--text-white);
    font-size: 0.9rem;
    font-weight: 600;
}

.card-content {
    color: var(--text-white);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 6.5 统一图标样式 */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.9rem;
    color: var(--text-white);
}

.icon.primary {
    background: var(--accent-green);
}

.icon.success {
    background: var(--success-green);
}

.icon.warning {
    background: var(--warning-orange);
}

.icon.danger {
    background: var(--danger-red);
}

.icon.info {
    background: var(--info-blue);
}

/* 6.6 统一列表样式 */
.list-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    margin-bottom: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border-left: 4px solid var(--accent-green);
    transition: all 0.3s ease;
    cursor: pointer;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
}

.list-item-icon {
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.list-item-action {
    flex-shrink: 0;
}

/* 6.7 响应式设计优化 */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 300px 1fr 300px;
    }
    
    .stats-grid-top {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.8rem;
    }
}

@media (max-width: 992px) {
    .main-container {
        grid-template-columns: 250px 1fr 250px;
    }
    
    .stats-grid-top {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .task-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .task-actions .action-btn {
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .left-sidebar,
    .right-sidebar {
        order: 2;
    }
    
    .map-section {
        order: 1;
    }
    
    .stats-grid-top {
        grid-template-columns: 1fr;
    }
}

/* 6.8 动画和过渡效果统一 */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-in-out;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 6.9 可访问性改进 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点样式 */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent-green);
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.8);
        --text-muted: #CCCCCC;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}