/**
 * 巴西台球之家 - 主样式表
 * Brazil Billiards Home - Main Stylesheet
 * 
 * Color Palette:
 * - Primary Green: #006B3F (Brazil Green)
 * - Secondary Gold: #FFCD00 (Brazil Yellow)
 * - Dark Green: #004D2C
 * - Light Gold: #FFE066
 * - Text Dark: #1a1a1a
 * - Text Light: #f5f5f5
 */

/* ===== CSS Variables ===== */
:root {
    /* Colors */
    --primary: #006B3F;
    --primary-dark: #004D2C;
    --primary-light: #008B4F;
    --secondary: #FFCD00;
    --secondary-dark: #D4A800;
    --secondary-light: #FFE066;
    --accent: #1E90FF;
    
    --text-dark: #1a1a1a;
    --text-light: #f5f5f5;
    --text-muted: #6c757d;
    
    --bg-dark: #0a0a0a;
    --bg-light: #f8f9fa;
    --bg-card: #ffffff;
    
    --border-color: #e0e0e0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    
    /* Typography */
    --font-primary: 'Montserrat', 'Noto Sans SC', sans-serif;
    --font-size-base: 16px;
    
    /* Spacing */
    --container-width: 1280px;
    --header-height: 80px;
    
    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: var(--font-size-base);
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ===== Container ===== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: var(--shadow);
    z-index: 1000;
}

.main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 90px;
    width: auto;
    max-width: 200px;
}

/* ===== Navigation ===== */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    gap: 8px;
}

.nav-list li a {
    display: block;
    padding: 10px 18px;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-list li a:hover,
.nav-list li.active a {
    background: rgba(255, 205, 0, 0.2);
    color: var(--secondary);
}

/* ===== Header Actions ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Switcher */
.language-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-light);
    font-size: 0.9rem;
    border-radius: 8px;
    transition: var(--transition);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}

.language-switcher:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown a {
    display: block;
    padding: 12px 16px;
    color: var(--text-dark);
    transition: var(--transition-fast);
}

.lang-dropdown a:hover,
.lang-dropdown a.active {
    background: var(--bg-light);
    color: var(--primary);
}

.lang-dropdown a:first-child {
    border-radius: 12px 12px 0 0;
}

.lang-dropdown a:last-child {
    border-radius: 0 0 12px 12px;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: var(--text-light);
    font-size: 0.9rem;
    border-radius: 8px;
    transition: var(--transition);
}

.user-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-dark);
    transition: var(--transition-fast);
}

.user-dropdown a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.user-dropdown a:first-child {
    border-radius: 12px 12px 0 0;
}

.user-dropdown a:last-child {
    border-radius: 0 0 12px 12px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 10px;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: var(--text-dark);
    box-shadow: 0 4px 15px rgba(255, 205, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 205, 0, 0.4);
}

.btn-outline {
    border: 2px solid var(--secondary);
    color: var(--secondary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--secondary);
    color: var(--text-dark);
}

.btn-green {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-green:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 107, 63, 0.3);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* ===== Mobile Menu Toggle ===== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-light);
    transition: var(--transition);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-top: var(--header-height);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="%23FFCD00" stroke-width="0.5" opacity="0.1"/></svg>') repeat;
    background-size: 200px;
    animation: float 20s linear infinite;
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-50px) rotate(360deg); }
}

.hero .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-title span {
    color: var(--secondary);
}

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Stats Section ===== */
.stats-section {
    padding: 80px 0;
    background: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.stat-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--bg-light) 0%, white 100%);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary);
    background: linear-gradient(135deg, rgba(0, 107, 63, 0.1) 0%, rgba(255, 205, 0, 0.1) 100%);
    border-radius: 50%;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===== Section Headers ===== */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Players Section ===== */
.players-section {
    padding: 80px 0;
    background: var(--bg-light);
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.player-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.player-rank {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 50%;
    background: var(--primary);
    color: white;
}

.player-rank.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: var(--text-dark);
}

.player-rank.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
}

.player-rank.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #B8860B 100%);
}

.player-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    object-fit: cover;
    border: 3px solid var(--secondary);
}

.player-name {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 5px;
}

.player-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.player-info span {
    margin: 0 5px;
}

.player-medals {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.medal {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: 600;
}

.medal.gold { color: #FFD700; }
.medal.silver { color: #C0C0C0; }
.medal.bronze { color: #CD7F32; }

.player-points {
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    color: white;
    font-weight: 700;
}

/* ===== Tournaments Section ===== */
.tournaments-section {
    padding: 80px 0;
    background: white;
}

.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.tournament-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.tournament-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tournament-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.tournament-content {
    padding: 25px;
}

.tournament-status {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 10px;
}

.tournament-status.upcoming {
    background: rgba(30, 144, 255, 0.1);
    color: #1E90FF;
}

.tournament-status.registration {
    background: rgba(255, 205, 0, 0.2);
    color: var(--secondary-dark);
}

.tournament-status.ongoing {
    background: rgba(0, 107, 63, 0.1);
    color: var(--primary);
}

.tournament-status.completed {
    background: rgba(108, 117, 125, 0.1);
    color: var(--text-muted);
}

.tournament-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.tournament-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.tournament-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tournament-actions {
    display: flex;
    gap: 10px;
}

/* ===== Footer ===== */
.main-footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--bg-dark) 100%);
    color: var(--text-light);
}

.footer-top {
    padding: 60px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
}

.footer-logo {
    height: 80px;
    margin-bottom: 20px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    line-height: 1.7;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-light);
    font-size: 1.1rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary);
    color: var(--text-dark);
    transform: translateY(-3px);
}

.footer-links h3,
.footer-contact h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--secondary);
}

.footer-links ul li,
.footer-contact ul li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--secondary);
    padding-left: 5px;
}

.footer-contact ul li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
}

.footer-contact ul li i {
    color: var(--secondary);
    margin-top: 4px;
}

.footer-bottom {
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* ===== Flash Messages ===== */
.flash-message {
    padding: 15px 0;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 999;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.flash-message .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flash-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.flash-error {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
}

.flash-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: var(--text-dark);
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
}

.flash-close:hover {
    opacity: 1;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 107, 63, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

/* ===== Cards ===== */
.card {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.card-body {
    padding: 25px;
}

/* ===== Tables ===== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    background: var(--bg-light);
    color: var(--text-dark);
}

.table tbody tr:hover {
    background: rgba(0, 107, 63, 0.03);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.pagination a {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
}

.pagination a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination span.current {
    background: var(--primary);
    color: white;
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.hidden { display: none; }
.visible { display: block; }
