/**
 * CS2排行榜网站 - 主样式文件
 * 参考god网站的设计风格，现代简洁的暗色主题
 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 暗色主题变量 */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent-primary: #ff6b35;
    --accent-secondary: #4ecdc4;
    --border-color: #333333;
    --shadow: rgba(0, 0, 0, 0.3);
    --gradient-primary: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    --gradient-secondary: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    --card-bg: #1a1a1a;
    --accent-rgb: 255, 107, 53;
}

/* 头部样式 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 60px;
    width: auto;
}

.search-section {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}

/* 搜索图标按钮 */
.search-icon-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* 展开的搜索栏 - 占据整个导航栏宽度 */
.search-expanded {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: scaleY(0);
    transform-origin: top;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.search-expanded.active {
    opacity: 1;
    visibility: visible;
    transform: scaleY(1);
}

/* 展开的搜索表单 */
.search-form-expanded {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-input-wrapper-expanded {
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 6px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-input-expanded {
    width: 100%;
    padding: 16px 60px 16px 24px;
    background: transparent;
    border: none;
    border-radius: 24px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    outline: none;
}

.search-input-expanded::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

.search-input-expanded:focus {
    background: rgba(255, 255, 255, 0.05);
}

.search-btn-expanded {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.search-btn-expanded:hover {
    color: #007bff;
    transform: translateY(-50%) scale(1.1);
}


/* CS2评分和排名样式 - 参照cssbans项目 */
.cs2rating {
    height: 24px;
    font-size: 16px;
    align-items: center;
    justify-content: center;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    text-shadow: 0 1px 0 black;
    font-weight: 700;
    margin: auto;
}

[class^="cs2rating-text-"] {
    position: absolute;
    padding-left: 14px;
    padding-top: 2px;
    font-style: italic;
    font-weight: bold;
}

.cs2rating-text-unusual { color: yellow; }
.cs2rating-text-common { color: #B1C3D9; }
.cs2rating-text-uncommon { color: #5E98D7; }
.cs2rating-text-rare { color: #4B69FF; }
.cs2rating-text-mythical { color: #8846FF; }
.cs2rating-text-legendary { color: #D22CE6; }
.cs2rating-text-ancient { color: #EB4B4B; }


/* 主要内容区域 */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
    padding: 2rem;
    transition: filter 0.3s ease;
}

/* 主要内容模糊效果 */
.main-content.blurred {
    filter: blur(5px);
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: 600;
}

.page-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: scale(1.05);
}

.page-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.3);
}

/* 返回按钮 */
.back-section {
    text-align: center;
    margin-top: 2rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-header img {
    width: 24px;
    height: 24px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--accent-primary);
}

.modal-body { padding: 1.5rem; }

/* 页脚样式 */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo img {
    height: 30px;
}

.footer-info h5,
.footer-info h6 {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 400;
}

.footer-info h5 { font-size: 0.9rem; }
.footer-info h6 { font-size: 0.8rem; }

.footer-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-nav a:hover { color: var(--accent-primary); }

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container { padding: 0 1rem; }
    .search-section { margin: 0 1rem; }
    .search-icon-btn { font-size: 18px; padding: 10px; }
    .search-form-expanded { max-width: 100%; margin: 0 1rem; }
    .search-input-expanded { padding: 14px 50px 14px 20px; font-size: 16px; }
    .footer-content { flex-direction: column; gap: 1rem; text-align: center; }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.player-row {
    animation: fadeIn 0.5s ease forwards;
}

.player-row:nth-child(even) {
    animation-delay: 0.1s;
}

.player-row:nth-child(odd) {
    animation-delay: 0.2s;
}

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

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