:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --success: #10b981;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border: #e2e8f0;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Space Grotesk', -apple-system, system-ui, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--primary);
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Hero */
.hero {
    background: var(--bg-primary);
    padding: 1.5rem 0 2rem;
    border-bottom: 1px solid var(--border);
    background-image: url('bg.jpg');
    background-position: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: white;
    font-weight: 400;
    /*margin-bottom: 2rem;*/
}

/* Search Section */
.search-section {
    background: var(--bg-primary);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}

.search-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s;
    overflow: hidden;
}

.search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.gender-selector {
    display: flex;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

.gender-option {
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: var(--text-secondary);
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.gender-option:first-child {
    border-right: 1px solid var(--border);
}

.gender-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.gender-option.active {
    background: var(--primary-light);
    color: var(--primary);
}

.gender-option input {
    display: none;
}

.search-input {
    flex: 1;
    padding: 1rem 3.5rem 1rem 1.25rem;
    font-size: 1rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
}

.search-input:focus {
    outline: none;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-actions {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.clear-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.25rem;
}

.clear-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

.clear-btn.show {
    display: flex;
}

.search-icon {
    color: var(--text-tertiary);
    font-size: 1.25rem;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

/* Ad Banner */
.ad-banner {
    /*background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;*/
    /*padding: 1rem;*/
    margin-bottom: 2rem;
    text-align: center;
    /*min-height: 120px;*/
    display: flex;
    align-items: center;
    justify-content: center;
    /*box-shadow: var(--shadow-sm);*/
}

.ad-banner img {
    max-width: 70%;
    height: auto;
    box-shadow: var(--shadow-sm);
}
/* Responsive */
@media (max-width: 768px) {
	.ad-banner img {
		max-width: 100%;
	}
}

.ad-placeholder {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.results-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.loading-state,
.no-results-state {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.loading-state {
    color: var(--primary);
    font-weight: 500;
}

.no-results-state {
    color: var(--text-secondary);
}

/* Table */
.table-wrapper {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

td {
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.9375rem;
    white-space: nowrap;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: var(--bg-secondary);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 0.375rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    border-radius: 6px;
}

.player-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.evolution-up {
    color: var(--success);
    font-weight: 600;
}

.evolution-down {
    color: #ef4444;
    font-weight: 600;
}

.evolution-stable {
    color: var(--text-tertiary);
    font-weight: 500;
}

.best-badge {
    color: #f59e0b;
    font-weight: 700;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin: 2rem 0;
}

.load-more-btn {
    background: var(--primary);
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    font-family: 'Space Grotesk', sans-serif;
}

.load-more-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.load-more-btn:disabled {
    background: var(--border);
    color: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
}

.load-more-btn.hidden {
    display: none;
}

.load-more-btn .spinner {
    display: inline-block;
    margin-right: 0.5rem;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Footer */
footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    /*margin-top: 4rem;*/
}

.footer-content {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-content p {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--primary-dark);
}

/* Responsive */
@media (max-width: 768px) {
	.main-content {
		padding: 2rem 0;
	}
    .container {
        padding: 0 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .header-wrapper {
        flex-direction: column;
        gap: 1rem;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .search-container {
        flex-direction: column;
    }

    .gender-selector {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .gender-option {
        flex: 1;
        padding: 0.75rem 1rem;
    }

    .gender-option:first-child {
        border-right: 1px solid var(--border);
    }

    .search-input {
        padding: 10px;
        width: 100%;
    }

    .rank-badge {
        min-width: 40px;
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
    }

    /* Amélioration scroll horizontal sur mobile */
    .table-wrapper {
        margin: 0 -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    table {
        font-size: 0.8125rem;
        min-width: 900px;
    }

    th, td {
        padding: 0.875rem 0.75rem;
        font-size: 0.8125rem;
    }

    .player-cell {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .load-more-btn {
        width: 100%;
        max-width: 300px;
    }
    
	.search-actions {
		top: 77.5%;
	}
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 1.125rem;
    }
}

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

/* Legal Popup */
.legal-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

.legal-popup.show {
    opacity: 1;
    visibility: visible;
}

.legal-popup-content {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.legal-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-tertiary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 1;
}

.legal-popup-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.legal-popup-content h2 {
    font-size: 1.5rem;
    margin: 0;
    padding: 2rem 2rem 1rem 2rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.legal-popup-body {
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.legal-popup-body h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-popup-body h3:first-child {
    margin-top: 0;
}

.legal-popup-body p {
    margin-bottom: 1rem;
}

.legal-popup-body ul {
    margin: 1rem 0 1rem 1.5rem;
    list-style: none;
    padding: 0;
}

.legal-popup-body li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.legal-popup-body strong {
    color: var(--text-primary);
}

.legal-popup-body a {
    color: var(--primary);
    text-decoration: none;
}

.legal-popup-body a:hover {
    text-decoration: underline;
}

.legal-popup-accept {
    width: calc(100% - 4rem);
    margin: 0 2rem 2rem 2rem;
    background: var(--primary);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Space Grotesk', sans-serif;
}

.legal-popup-accept:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#famous {
	margin: 0 auto;
	text-align: center;
	font-size: 12px;
	display: block;
	margin-top: 0.5em;
}
@media (max-width: 768px) {
	#famous {
		display: none;
	}
}

@media (max-width: 768px) {
    .legal-popup-content {
        max-height: 90vh;
    }

    .legal-popup-content h2 {
        font-size: 1.25rem;
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }

    .legal-popup-body {
        font-size: 0.9375rem;
        padding: 1rem 1.5rem;
    }

    .legal-popup-body h3 {
        font-size: 1rem;
    }

    .legal-popup-accept {
        width: calc(100% - 3rem);
        margin: 0 1.5rem 1.5rem 1.5rem;
    }
}
