/* 老赵的私教课堂 - 自定义样式 */

/* 全局样式 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* 渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-alt {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 学习路径时间线样式 */
.learning-path-step {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.learning-path-step:nth-child(1) { animation-delay: 0.1s; }
.learning-path-step:nth-child(2) { animation-delay: 0.2s; }
.learning-path-step:nth-child(3) { animation-delay: 0.3s; }
.learning-path-step:nth-child(4) { animation-delay: 0.4s; }
.learning-path-step:nth-child(5) { animation-delay: 0.5s; }
.learning-path-step:nth-child(6) { animation-delay: 0.6s; }

/* 时间线节点悬停效果 */
.learning-path-step:hover .w-16.h-16 {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* 进度条动画 */
.learning-path-step .h-3 {
    position: relative;
    overflow: hidden;
}

.learning-path-step .h-3::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 路径动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 脉动动画增强 */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* 按钮悬停效果增强 */
.learning-path-step a:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 卡片阴影渐变 */
.learning-path-step .shadow-xl {
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

.learning-path-step:hover .shadow-xl {
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* 移动端导航菜单 */
.mobile-menu {
    display: none;
}

.mobile-menu.active {
    display: block;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* 移动端课程卡片优化 */
@media (max-width: 640px) {
    .course-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .course-card {
        margin-bottom: 1rem;
    }

    .course-header {
        height: 100px;
    }

    .course-type-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* 移动端侧边栏适配 */
@media (max-width: 768px) {
    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: white;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .mobile-sidebar.active {
        left: 0;
    }

    .mobile-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .mobile-sidebar-overlay.active {
        display: block;
    }

    .hamburger {
        display: flex;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .learning-path-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .learning-path-step .ml-8 {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
    }

    .absolute.left-8 {
        left: 50% !important;
        transform: translateX(-50%);
    }

    .learning-path-step .relative.z-10 {
        position: relative;
        z-index: 10;
    }
}

/* 按钮动画 */
.btn-animate {
    transition: all 0.2s ease;
}

.btn-animate:hover {
    transform: scale(1.05);
}

/* 进度条动画 */
.progress-bar {
    transition: width 0.5s ease-in-out;
}

/* 课程卡片样式增强 */
.course-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.course-header {
    height: 128px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-header.video {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.course-header.pdf {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.course-header.html {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.course-header.ppt {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* 用户信息卡片 */
.user-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 章节项目样式 */
.chapter-item.active {
    background: linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
}

.chapter-item.locked {
    background: #f9fafb;
    opacity: 0.6;
    cursor: not-allowed;
}

.chapter-item.locked:hover {
    background: #f9fafb;
    transform: none;
}

/* 进度条样式 */
.progress-container {
    background: #e5e7eb;
    border-radius: 9999px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    height: 100%;
    border-radius: 9999px;
    transition: width 0.5s ease-in-out;
}

/* 视频播放器样式 */
video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 章节列表样式 */
.chapter-item {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.chapter-item:hover {
    background-color: #f3f4f6;
    border-left-color: #e5e7eb;
}

.chapter-item.active {
    background-color: #dbeafe;
    border-left-color: #3b82f6;
}

.chapter-item.completed {
    background-color: #d1fae5;
    border-left-color: #10b981;
}

/* 侧边栏滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 内容区域滚动条样式 */
.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.content-area::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 表单样式增强 */
.form-input {
    transition: all 0.2s ease;
}

.form-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

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

/* 课程类型图标样式 */
.course-type-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

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

.course-type-pdf {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.course-type-html {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.course-type-ppt {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

/* 统计卡片样式 */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

/* 移动端表格适配 */
@media (max-width: 768px) {
    .mobile-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    .mobile-card {
        display: block;
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .mobile-card-header {
        font-weight: 600;
        color: #374151;
        margin-bottom: 0.5rem;
    }

    .mobile-card-content {
        color: #6b7280;
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .mobile-card-actions {
        margin-top: 1rem;
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .mobile-card-actions button,
    .mobile-card-actions a {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* 移动端表单优化 */
@media (max-width: 640px) {
    .form-container {
        padding: 1rem;
    }

    .form-input {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 0.75rem;
    }

    .form-button {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        margin-top: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

/* 移动端导航优化 */
.mobile-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 1001;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    display: none; /* 默认隐藏 */
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.mobile-nav-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-nav {
        display: block; /* 移动端显示 */
    }

}

.mobile-nav-header {
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav-links {
    padding: 1rem 0;
}

.mobile-nav-link {
    display: block;
    padding: 1rem 1.5rem;
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.mobile-nav-link:hover {
    background-color: #f9fafb;
}

.mobile-nav-link i {
    margin-right: 0.75rem;
    width: 1.25rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .content-area {
        height: auto;
    }

    .chapter-item {
        padding: 12px;
        font-size: 0.9rem;
    }

    .stat-card {
        padding: 16px;
    }

    .container-padding {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .text-responsive {
        font-size: 0.875rem;
    }

    .button-responsive {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* 打印样式 */
@media print {
    .sidebar,
    nav,
    .btn-animate,
    .notification {
        display: none !important;
    }

    .content-area {
        width: 100% !important;
        height: auto !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #1a202c;
        color: #e2e8f0;
    }

    .dark-mode .sidebar {
        background-color: #2d3748;
        border-color: #4a5568;
    }

    .dark-mode .chapter-item:hover {
        background-color: #4a5568;
    }

    .dark-mode .chapter-item.active {
        background-color: #3182ce;
    }
}

/* 无障碍支持 */
.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;
}

/* 焦点样式 */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 触摸优化 */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.touch-friendly {
    padding: 0.75rem 1rem;
    margin: 0.25rem;
}

/* 移动端特定样式 */
@media (max-width: 480px) {
    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-text-sm {
        font-size: 0.75rem;
    }

    .mobile-p-2 {
        padding: 0.5rem;
    }

    .mobile-m-1 {
        margin: 0.25rem;
    }

    .mobile-full-width {
        width: 100% !important;
    }

    .mobile-center {
        text-align: center;
    }

    /* 移动端课程页面优化 */
    .mobile-course-layout {
        display: flex;
        flex-direction: column;
        height: 100vh;
    }

    .mobile-course-header {
        flex-shrink: 0;
        padding: 0.75rem 1rem;
        background: white;
        border-bottom: 1px solid #e5e7eb;
    }

    .mobile-course-content {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
    }

    .mobile-chapter-toggle {
        position: fixed;
        bottom: 1rem;
        right: 1rem;
        z-index: 100;
        background: #3b82f6;
        color: white;
        border: none;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        font-size: 1.25rem;
    }

    .mobile-chapter-list {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e5e7eb;
        max-height: 50vh;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 99;
    }

    .mobile-chapter-list.active {
        transform: translateY(0);
    }

    .mobile-chapter-item {
        padding: 1rem;
        border-bottom: 1px solid #f3f4f6;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .mobile-chapter-item:last-child {
        border-bottom: none;
    }
}

/* 移动端管理后台优化 */
@media (max-width: 768px) {
    .admin-mobile-header {
        padding: 1rem;
        background: white;
        border-bottom: 1px solid #e5e7eb;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .admin-mobile-nav {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding: 1rem;
        background: #f9fafb;
    }

    .admin-mobile-nav a {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        background: white;
        border-radius: 0.5rem;
        text-decoration: none;
        color: #374151;
        font-size: 0.875rem;
        border: 1px solid #e5e7eb;
    }

    .admin-mobile-nav a.active {
        background: #3b82f6;
        color: white;
        border-color: #3b82f6;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .card-hover {
        border: 2px solid #000;
    }

    .btn-animate {
        border: 2px solid #000;
    }
}
