/* Custom Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Container Max Width */
.container {
    max-width: 1200px !important;
}

@media (min-width: 1536px) {
    .container {
        max-width: 1280px !important;
    }
}

/* Scroll Buttons */
.scroll-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    outline: none;
}

.scroll-btn:focus {
    outline: none;
}

.scroll-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.scroll-btn i {
    color: #6b7280;
    font-size: 14px;
}

.scroll-btn:hover i {
    color: #374151;
}

#leaguesContainer {
    scroll-behavior: smooth;
}

/* League Buttons */
.league-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 60px;
    flex-shrink: 0;
    border-bottom: 3px solid transparent;
    outline: none;
}

.league-btn:focus {
    outline: none;
}

.league-btn:hover {
    background: #f9fafb;
}

.league-btn.active {
    border-bottom-color: #000000;
}

.league-btn img {
    transition: all 0.3s;
    opacity: 0.6;
}

.league-btn:hover img,
.league-btn.active img {
    opacity: 1;
}

.league-btn.all-btn,
.league-btn.politics-btn {
    color: #6b7280;
    font-weight: 500;
}

.league-btn.all-btn.active,
.league-btn.politics-btn.active {
    color: #000000;
    font-weight: 600;
}

/* Topic Buttons */
.topic-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #4b5563;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.topic-btn:hover {
    background: #f3f4f6;
    border-color: #6366f1;
}

.topic-btn.active {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

/* Filter Buttons */
.filter-btn {
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #4b5563;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #f3f4f6;
}

.filter-btn.active {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

/* Market Card */
.market-card {
    background: white;
    border-radius: 10px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s;
    cursor: pointer;
}

.market-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Dynamic Market Card - based on live data */
.market-card.dynamic-market {
    border: 1px solid #fbbf24;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.market-card.dynamic-market:hover {
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.2);
}

/* Live Match Badge */
.live-market-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 4px;
    animation: pulse 2s ease-in-out infinite;
}

.live-market-badge i {
    font-size: 8px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.market-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 3px;
}

.market-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.category-politics {
    background: #dbeafe;
    color: #1e40af;
}

.category-crypto {
    background: #fef3c7;
    color: #92400e;
}

.category-sports {
    background: #d1fae5;
    color: #065f46;
}

.category-tech {
    background: #e0e7ff;
    color: #3730a3;
}

.category-finance {
    background: #fce7f3;
    color: #831843;
}

.category-culture {
    background: #fed7aa;
    color: #7c2d12;
}

.market-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1.4;
}

.market-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f9fafb;
    transition: all 0.2s;
}

.option:hover {
    background: #f3f4f6;
}

.option-name {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.option-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-percentage {
    display: flex;
    align-items: center;
    gap: 6px;
}

.percentage-bar {
    width: 50px;
    height: 5px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.percentage-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 3px;
    transition: width 0.3s;
}

.percentage-text {
    font-weight: 700;
    color: #6366f1;
    font-size: 15px;
}

.market-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.volume {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

.volume i {
    color: #6366f1;
    font-size: 12px;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-ending {
    background: #fef3c7;
    color: #92400e;
}

.status-closed {
    background: #fee2e2;
    color: #991b1b;
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .market-card {
        padding: 12px;
    }
    
    .market-title {
        font-size: 14px;
    }
    
    .option {
        padding: 8px;
    }
    
    .percentage-text {
        font-size: 14px;
    }
}

/* Social Links */
.social-link {
    display: inline-block;
    transition: all 0.3s;
}

.social-link:hover {
    transform: translateY(-3px);
}

.social-link img {
    transition: all 0.3s;
}

.social-link:hover img {
    filter: brightness(1.2);
}

/* Stats Animation */
.stat-number {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Partner Logos */
.partners-logo {
    transition: all 0.3s;
}

.partners-logo:hover {
    transform: scale(1.1);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: #6366f1;
    color: white;
}

/* Focus States */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sidebar Styles */
#nbaSidebar, #nflSidebar, #soccerSidebar, #premierLeagueSidebar, #laLigaSidebar, #championsLeagueSidebar, #serieASidebar, #bundesligaSidebar {
    animation: slideIn 0.3s ease-out;
    width: 56px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#nbaFinishedGames::-webkit-scrollbar,
#nflFinishedGames::-webkit-scrollbar,
#soccerGames::-webkit-scrollbar,
#premierLeagueFinishedGames::-webkit-scrollbar,
#laLigaFinishedGames::-webkit-scrollbar,
#championsLeagueFinishedGames::-webkit-scrollbar,
#serieAFinishedGames::-webkit-scrollbar,
#bundesligaFinishedGames::-webkit-scrollbar {
    width: 4px;
}

#nbaFinishedGames::-webkit-scrollbar-track,
#nflFinishedGames::-webkit-scrollbar-track,
#soccerGames::-webkit-scrollbar-track,
#premierLeagueFinishedGames::-webkit-scrollbar-track,
#laLigaFinishedGames::-webkit-scrollbar-track,
#championsLeagueFinishedGames::-webkit-scrollbar-track,
#serieAFinishedGames::-webkit-scrollbar-track,
#bundesligaFinishedGames::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#nbaFinishedGames::-webkit-scrollbar-thumb,
#nflFinishedGames::-webkit-scrollbar-thumb,
#soccerGames::-webkit-scrollbar-thumb,
#premierLeagueFinishedGames::-webkit-scrollbar-thumb,
#laLigaFinishedGames::-webkit-scrollbar-thumb,
#championsLeagueFinishedGames::-webkit-scrollbar-thumb,
#serieAFinishedGames::-webkit-scrollbar-thumb,
#bundesligaFinishedGames::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

#nbaFinishedGames::-webkit-scrollbar-thumb:hover,
#nflFinishedGames::-webkit-scrollbar-thumb:hover,
#soccerGames::-webkit-scrollbar-thumb:hover,
#premierLeagueFinishedGames::-webkit-scrollbar-thumb:hover,
#laLigaFinishedGames::-webkit-scrollbar-thumb:hover,
#championsLeagueFinishedGames::-webkit-scrollbar-thumb:hover,
#serieAFinishedGames::-webkit-scrollbar-thumb:hover,
#bundesligaFinishedGames::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 侧边栏图标按钮悬停效果 */
#nbaToggle:hover,
#nflToggle:hover,
#soccerToggle:hover,
#premierLeagueToggle:hover,
#laLigaToggle:hover,
#championsLeagueToggle:hover,
#serieAToggle:hover,
#bundesligaToggle:hover {
    background-color: #f9fafb;
    transform: scale(1.05);
}

#nbaToggle,
#nflToggle,
#soccerToggle,
#premierLeagueToggle,
#laLigaToggle,
#championsLeagueToggle,
#serieAToggle,
#bundesligaToggle {
    transition: all 0.2s ease;
}

/* 响应式：在小屏幕上隐藏侧边栏 */
@media (max-width: 1280px) {
    #sportsSidebar {
        display: none !important;
    }
}

/* Crypto Price Cards */
.crypto-price-card {
    transition: all 0.2s ease;
    border: 1px solid transparent;
    padding: 8px !important;
}

.crypto-price-card:hover {
    border-color: #e5e7eb;
    transform: translateY(-2px);
}

.crypto-price-card img {
    width: 24px !important;
    height: 24px !important;
}

.crypto-price-card .crypto-symbol {
    font-size: 0.75rem;
    font-weight: 600;
}

.crypto-price-card .crypto-name {
    font-size: 0.625rem;
}

.crypto-price-card .crypto-price {
    font-size: 0.875rem;
    font-weight: 700;
}

.crypto-price-card .crypto-change {
    font-size: 0.625rem;
    font-weight: 600;
}

#cryptoPricesSection {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Market Detail Modal Styles */
#marketModal {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#marketModal > div {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal scrollbar */
#marketModal .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#marketModal .overflow-y-auto::-webkit-scrollbar-track {
    background: #f9fafb;
}

#marketModal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

#marketModal .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Bet Button Styles */
#modalOptions button {
    position: relative;
    overflow: hidden;
}

#modalOptions button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#modalOptions button:active::before {
    width: 300px;
    height: 300px;
}

/* Bet Modal Styles */
#betModal {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

#betModal > div {
    animation: slideUp 0.25s ease-out;
}

/* Bet Amount Input */
#betAmountInput::-webkit-outer-spin-button,
#betAmountInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#betAmountInput[type=number] {
    -moz-appearance: textfield;
}

/* Quick Bet Amount Buttons */
#betModal button[onclick^="setBetAmount"] {
    transition: all 0.2s ease;
}

#betModal button[onclick^="setBetAmount"]:active {
    transform: scale(0.95);
}

/* Currency Selection Buttons */
.currency-btn {
    cursor: pointer;
    transition: all 0.2s ease;
}

.currency-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.currency-btn.active {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.currency-btn:active {
    transform: scale(0.98);
}

/* Wallet Button Styles */
#connectWalletBtn {
    position: relative;
    overflow: hidden;
}

#connectWalletBtn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#connectWalletBtn:active::before {
    width: 300px;
    height: 300px;
}

/* Navigation Links */
.nav-link {
    position: relative;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #4f46e5;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: #4f46e5;
}

.nav-link.active::after {
    width: 100%;
}

/* Mobile Menu Animation */
#mobileMenu {
    animation: slideDown 0.3s ease-out;
}

/* 3D Mechanism Cards */
.mechanism-card-3d {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    transform-style: preserve-3d;
    box-shadow: 
        0 10px 30px -5px rgba(0, 0, 0, 0.1),
        0 20px 40px -10px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 左边卡片 - 向右偏转 */
.mechanism-card-3d:nth-child(1):hover {
    transform: perspective(1000px) rotateY(10deg) translateY(-10px);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 35px 60px -20px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* 中间卡片 - 变大并向上 */
.mechanism-card-3d:nth-child(2):hover {
    transform: perspective(1000px) scale(1.08) translateY(-15px);
    box-shadow: 
        0 30px 60px -12px rgba(0, 0, 0, 0.2),
        0 40px 70px -20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* 右边卡片 - 向左偏转 */
.mechanism-card-3d:nth-child(3):hover {
    transform: perspective(1000px) rotateY(-10deg) translateY(-10px);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 35px 60px -20px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mechanism-card-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 1;
}

.mechanism-card-3d::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 10%;
    right: 10%;
    height: 20px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.15) 0%, transparent 70%);
    filter: blur(10px);
    opacity: 0.5;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.mechanism-card-3d:hover::after {
    opacity: 0.8;
}

/* Technology Stack Logo */
.tech-stack-logo {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 50px;
    height: 50px;
    opacity: 0.15;
    object-fit: contain;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tech-stack-logo:hover {
    opacity: 0.25;
}

/* Leaderboard Styles */
.leaderboard-tab {
    color: #6b7280;
    background: transparent;
    cursor: pointer;
}

.leaderboard-tab:hover {
    color: #4b5563;
    background: #f9fafb;
}

.leaderboard-tab.active {
    color: #4f46e5;
    background: #eef2ff;
    font-weight: 600;
}

/* Market Tab Styles */
.market-tab {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.market-tab:hover {
    background: #f9fafb;
}

.market-tab.active {
    background: #fafafa;
}

/* Market Content Animation */
.market-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

