/**
 * 学生成绩分析系统 - 按钮组件样式
 */

/* 基础按钮 */
.button {
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 主要按钮 */
.button-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(78, 91, 240, 0.3);
}

.button-primary:hover {
    background: #4351d8; /* Darker shade of primary */
    transform: translateY(-1px);
}

/* 次要按钮 */
.button-secondary {
    background: #EBF0FF; /* Light Blue background */
    color: var(--primary-color); /* Primary text */
}

.button-secondary:hover {
    background: #D6E0FF;
    color: var(--primary-color);
}

/* 按钮内下拉选择 */
.button select {
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.button select option {
    background: var(--secondary-color);
    color: white;
}

/* 标签页按钮 */
.tab-button {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
}

.tab-button.active {
    color: var(--primary-color);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* 模式切换按钮 */
.mode-btn {
    padding: 8px 16px;
    border: none;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid #eee;
}

.mode-btn:last-child {
    border-right: none;
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
}

.mode-btn:hover:not(.active) {
    background: #f4f4f4;
}

/* 学科切换按钮 */
.subject-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.subject-btn:hover {
    background: #f0f0f0;
}

.subject-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* 关闭按钮 */
.close-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
}

/* 删除按钮 */
.remove-subject {
    color: #dc3545;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    position: relative;
}

/* 下拉箭头图标样式已移除 */

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 200px;
    display: none;
    margin-top: 2px;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-primary);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

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

.dropdown-item:active {
    background-color: #e9ecef;
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

/* 图标样式已移除 */

/* 确保no-icon类的按钮不显示任何图标 */
.button.no-icon::before,
.button.no-icon::after {
    display: none !important;
    content: none !important;
}

.button.no-icon * {
    font-family: inherit !important;
}

/* ========================================
   AI 智能分析按钮样式
   ======================================== */

/* AI 分析按钮 - 渐变紫色主题 */
.sidebar-tool-btn--ai {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    overflow: visible;
}

.sidebar-tool-btn--ai:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sidebar-tool-btn--ai:active {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* AI 按钮图标动画 */
.sidebar-tool-btn--ai i {
    animation: brain-pulse 2s ease-in-out infinite;
}

@keyframes brain-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* AI New 徽章 */
.ai-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(255, 71, 87, 0.4);
    animation: badge-bounce 2s ease-in-out infinite;
}

@keyframes badge-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

/* 侧边栏折叠时的 AI 按钮样式 */
.sidebar.collapsed .sidebar-tool-btn--ai .sidebar-btn-text {
    opacity: 0;
    width: 0;
}

.sidebar.collapsed .sidebar-tool-btn--ai .ai-badge {
    right: 2px;
    top: 2px;
}

/* AI 个性点评按钮 */
.personal-ai-btn {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #ffffff;
    color: #000000;
    box-shadow: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

.personal-ai-btn:hover {
    background: #f5f5f5;
    color: #000000;
}

.personal-ai-btn:active {
    background: #e4e4e4;
    color: #000000;
}
