/* Multi Football Team Menus - Frontend Styles */

/* 主容器 */
.mfm-frontend-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    border-radius: 0;
    margin: 0;
    padding: 0;
    max-width: 100%;
}


/* 侧边栏+网格布局 */
.mfm-sidebar-grid-layout {
    display: flex;
    min-height: 500px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
}

/* 左侧边栏 */
.mfm-sidebar {
    width: 280px;
    background: #f5f5f5;
    border-right: 1px solid #ddd;
    flex-shrink: 0;
}

.mfm-categories-nav {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    padding-left: 0 !important;
}

.mfm-category-nav-item {
    position: relative;
    border-bottom: 1px solid #e8e9ea;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.mfm-category-nav-item:hover {
    background-color: #e9ecef;
}

.mfm-category-nav-item.active {
    background-color: #2c5aa0;
    color: #fff;
    font-weight: 600;
}

.mfm-category-nav-item.active::before {
    display: none;
}

.mfm-category-nav-name {
    display: block;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #586069;
    text-decoration: none;
    position: relative;
}

.mfm-category-nav-item.active .mfm-category-nav-name {
    color: #fff;
    font-weight: 600;
}

/* 右侧内容区域 */
.mfm-content-area {
    flex: 1;
    background: #fff;
    position: relative;
    padding: 30px;
}

/* 搜索栏 */
.mfm-search-bar {
    margin-bottom: 25px;
}

.mfm-search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.mfm-search-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    background: #fff;
}

/* 项目网格容器 */
.mfm-items-grid-container {
    position: relative;
    min-height: 400px;
}

.mfm-items-grid {
    display: none;
}

.mfm-items-grid.active {
    display: block;
}

.mfm-items-grid-inner {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    max-width: 100%;
    padding: 15px;
}

/* 项目卡片 */
.mfm-item-card {
    background: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    padding: 25px 15px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mfm-item-card:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-color: #c6cbd1;
}

.mfm-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

.mfm-item-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 项目图标 */
.mfm-item-icon-wrapper {
    margin-bottom: 12px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mfm-item-icon {
    max-width: 70px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}

/* 项目名称 */
.mfm-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    text-align: center;
    line-height: 1.4;
    word-break: break-word;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 无项目提示 */
.mfm-no-items {
    text-align: center;
    padding: 80px 30px;
    color: #6c757d;
}

.mfm-no-items p {
    font-size: 16px;
    margin: 0;
    font-style: italic;
}

/* 错误提示 */
.mfm-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
    text-align: center;
}

/* 大屏幕优化 */
@media (min-width: 1200px) {
    .mfm-items-grid-inner {
        grid-template-columns: repeat(6, 1fr);
        gap: 25px;
        padding: 20px;
    }
    
    .mfm-content-area {
        padding: 35px;
    }
    
    .mfm-sidebar {
        width: 300px;
    }
}

/* 中等屏幕优化 */
@media (min-width: 992px) and (max-width: 1199px) {
    .mfm-items-grid-inner {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
        padding: 15px;
    }
}

/* 小屏幕平板优化 */
@media (min-width: 769px) and (max-width: 991px) {
    .mfm-items-grid-inner {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
        padding: 12px;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .mfm-sidebar-grid-layout {
        flex-direction: row; /* 保持水平布局 */
    }
    
    .mfm-sidebar {
        width: 25%; /* 左侧菜单占25%宽度 */
        order: 1; /* 菜单放左侧 */
        border-right: 1px solid #ddd;
        border-left: none;
    }

    .mfm-content-area {
        width: 75%; /* 内容区占75%宽度 */
        order: 2; /* 内容放右侧 */
    }
    
    .mfm-categories-nav {
        display: block; /* 垂直排列 */
        overflow-y: visible; /* 移除滚动条 */
        max-height: none; /* 移除最大高度限制 */
        padding: 0;
    }
    
    .mfm-category-nav-item {
        border-bottom: 1px solid #e8e9ea;
        border-right: none;
        width: 100%;
    }
    
    .mfm-category-nav-item:last-child {
        border-bottom: none;
    }
    
    .mfm-category-nav-item.active {
        background-color: #2c5aa0;
        color: #fff;
    }
    
    .mfm-category-nav-item.active::before {
        display: none;
    }
    
    .mfm-category-nav-name {
        padding: 10px 8px;
        font-size: 12px;
        text-align: left;
        line-height: 1.2;
        word-break: break-word;
    }
    
    .mfm-content-area {
        padding: 10px 8px;
    }

    .mfm-items-grid-inner {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 4px;
    }
    
    .mfm-item-card {
        padding: 20px 12px;
        min-height: 130px;
    }
    
    .mfm-item-icon-wrapper {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
    
    .mfm-item-icon {
        max-width: 60px;
        max-height: 60px;
    }
    
    .mfm-item-name {
        font-size: 12px;
        font-weight: 500;
    }
    
}

@media (max-width: 480px) {
    .mfm-sidebar {
        width: 40%; /* 小屏幕上菜单占40% */
    }
    
    .mfm-content-area {
        width: 60%;
        padding: 8px 6px;
    }

    .mfm-items-grid-inner {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        padding: 2px;
    }
    
    .mfm-category-nav-name {
        padding: 10px 8px;
        font-size: 11px;
    }
    
    .mfm-item-card {
        padding: 12px 8px;
        min-height: 100px;
    }
    
    .mfm-item-icon-wrapper {
        width: 45px;
        height: 45px;
        margin-bottom: 6px;
    }
    
    .mfm-item-icon {
        max-width: 45px;
        max-height: 45px;
    }
    
    .mfm-item-name {
        font-size: 11px;
        line-height: 1.2;
    }
    
    .mfm-search-input {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* 加载状态 */
.mfm-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
    color: #6c757d;
}

.mfm-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: mfm-spin 1s linear infinite;
    margin-left: 10px;
}

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