/* 自定义动画和样式 */

/* CSS 变量定义 */
:root {
  --card-border-radius: 16px;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --price-gradient: linear-gradient(135deg, #ff6b6b, #ffa500);
  --offer-gradient: linear-gradient(135deg, #4facfe, #00f2fe);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 跑马灯动画 */
@keyframes marquee {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.animate-marquee {
    animation: marquee 20s linear infinite;
}

/* 卡片进入动画 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in {
    animation: slideInUp 0.6s ease-out forwards;
}

/* 优化后的卡片样式 */
.course-card {
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    overflow: hidden;
    position: relative;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--price-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    border-color: hsl(var(--primary) / 0.2);
}

.course-card:hover::before {
    opacity: 1;
}

/* 图片区域优化 */
.course-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.course-image {
    transition: transform 0.4s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-card:hover .course-image {
    transform: scale(1.08);
}

/* 图片叠加信息优化 */
.image-overlay {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 6px 12px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.city-badge {
    top: 12px;
    left: 12px;
    background: var(--offer-gradient);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.distance-badge {
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.8);
}

.rating-badge {
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 球场信息区域优化 */
.course-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.course-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: hsl(var(--base-content));
    line-height: 1.3;
    margin-bottom: 4px;
}

.course-location {
    color: hsl(var(--base-content) / 0.7);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 特色标签优化 */
.features-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.feature-badge {
    background: hsl(var(--base-200));
    color: hsl(var(--base-content) / 0.8);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid hsl(var(--base-300));
    transition: var(--transition-smooth);
}

.feature-badge:hover {
    background: hsl(var(--primary) / 0.1);
    border-color: hsl(var(--primary) / 0.3);
    color: hsl(var(--primary));
}

/* 优惠信息优化 */
.offer-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(135deg, hsl(var(--primary) / 0.1), hsl(var(--secondary) / 0.1));
    border-radius: 12px;
    border: 1px solid hsl(var(--primary) / 0.2);
    position: relative;
    overflow: hidden;
}

.offer-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.offer-container:hover::before {
    left: 100%;
}

.offer-icon {
    width: 24px;
    height: 24px;
    background: var(--price-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.offer-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--primary));
}

/* 价格区域优化 */
.price-section {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: auto;
}

.price-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.current-price {
    font-size: 2rem;
    font-weight: 800;
    background: var(--price-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.current-price::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--price-gradient);
    transition: width 0.3s ease;
}

.course-card:hover .current-price::after {
    width: 100%;
}

.original-price {
    font-size: 0.875rem;
    color: hsl(var(--base-content) / 0.5);
    text-decoration: line-through;
    font-weight: 500;
}

.price-savings {
    font-size: 0.75rem;
    color: hsl(var(--success));
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.price-savings::before {
    content: '💰';
    font-size: 0.875rem;
}

/* 按钮组优化 */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-contact {
    background: hsl(var(--base-200));
    color: hsl(var(--base-content));
    border: 1px solid hsl(var(--base-300));
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn-contact:hover {
    background: hsl(var(--base-300));
    transform: translateY(-1px);
}

.btn-booking {
    background: var(--price-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-booking::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-booking:active::after {
    width: 300px;
    height: 300px;
}

.btn-booking:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

/* 响应式优化 */
@media (max-width: 1024px) {
    .course-card {
        margin-bottom: 16px;
    }
    
    .course-info {
        padding: 16px;
        gap: 12px;
    }
    
    .current-price {
        font-size: 1.75rem;
    }
}

@media (max-width: 640px) {
    .course-card {
        margin-bottom: 12px;
    }
    
    .course-card:hover {
        transform: none;
    }
    
    .course-info {
        padding: 12px;
        gap: 10px;
    }
    
    .course-header h3 {
        font-size: 1.125rem;
    }
    
    .current-price {
        font-size: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 6px;
    }
    
    .btn-contact,
    .btn-booking {
        width: 100%;
        text-align: center;
    }
}

/* 加载动画优化 */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--base-200));
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--base-300));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--primary));
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 焦点样式优化 */
.input:focus,
.btn:focus {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
}

/* 渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--secondary)) 100%);
}

/* 文字渐变 */
.gradient-text {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--secondary)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 阴影效果 */
.shadow-soft {
    box-shadow: var(--card-shadow);
}

.shadow-medium {
    box-shadow: var(--card-shadow-hover);
}

/* 动画延迟类 */
.animate-delay-100 {
    animation-delay: 0.1s;
}

.animate-delay-200 {
    animation-delay: 0.2s;
}

.animate-delay-300 {
    animation-delay: 0.3s;
}

.animate-delay-400 {
    animation-delay: 0.4s;
}

/* 特殊效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 打字机效果 */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 2s steps(40, end);
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 新增：卡片网格布局优化 */
.course-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .course-grid {
        grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    }
}

/* 新增：悬浮提示样式 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}