/* --- BIẾN TOÀN CỤC --- */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --header-bg: #1e293b;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --toast-success: linear-gradient(135deg, #22c55e, #16a34a);
    --toast-error: linear-gradient(135deg, #ef4444, #dc2626);
}

/* --- RESET & CƠ BẢN --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.toast-container {
    position: fixed;
    top: 4rem;
    right: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    z-index: 10000;
}

.custom-toast {
    pointer-events: auto;
    min-width: 200px;
    max-width: 300px;
    background: #1e293b;
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: toastIn 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.custom-toast.success { border-left: 4px solid #22c55e; }
.custom-toast.error { border-left: 4px solid #ef4444; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

main.container {
    flex: 1 0 auto;
    width: 100%;
    margin-top: 1rem;
}

/* --- HEADER & NAVIGATION --- */
.header {
    background-color: var(--header-bg);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: flex-start; 
    align-items: center;
    padding: 15px 20px; /* Giảm nhẹ padding để cân đối */
    gap: 50px;
    max-width: 100% ;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffffff;
    text-transform: uppercase;
}

.header h1 a{
    color: #fff;
    text-decoration: none;
    user-select: none;
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* NAVIGATION LINKS */
.nav a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 1rem;
    padding: 10px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 600;
    white-space: nowrap;
}

.nav a:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

.nav a.active {
    color: #3b82f6 ;
    border-bottom: 3px solid #3b82f6 ;
    font-weight: 700 ;
}

/* --- COMPONENTS (CARD, FILTERS) --- */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

input, select {
    padding: 0.6rem 0; /* Sửa lỗi padding 3rem gây lệch text */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--primary-color);
}

/* --- MAIN LAYOUT (Flexbox) --- */
.main-layout {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
}

.table-wrapper {
    flex: 2; /* Bảng chiếm nhiều không gian hơn detail */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
}

#player-details {
    max-width: 450px;
}

/* --- TABLE --- */
.players-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.players-table th {
    text-align: left;
    padding: 1rem;
    background: #f1f5f9;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.players-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.player-row:hover {
    background-color: #f8fafc;
}

.pos-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    display: inline-block;
    min-width: 42px;
    text-align: center;
}

/* --- PAGINATION --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding: 20px 0 10px 0;
    border-top: 1px solid var(--border-color);
}

.pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #eff6ff;
}

.pagination button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    background-color: #f8fafc;
    color: #cbd5e1;
    cursor: not-allowed;
}

/* --- FOOTER --- */
.footer {
    background-color: var(--header-bg);
    color: #f1f5f9;
    padding: 60px 0 20px 0;
    margin-top: 60px;
    border-top: 4px solid var(--primary-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-section h3.footer-logo {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #fff;
}

.footer-section h3.footer-logo span { color: var(--primary-color); }

.footer-section h4 {
    font-size: 1.1rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-section p, .footer-section ul li a {
    color: #94a3b8;
    font-size: 0.95rem;
}

.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 12px; }

.footer-section ul li a {
    text-decoration: none;
    transition: 0.3s;
}

.footer-section ul li a:hover {
    color: #fff;
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 36px;
    height: 36px;
    background-color: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    transition: 0.3s;
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: #64748b;
    font-size: 0.85rem;
}

/* LANGUAGE SWITCH */
.lang-switch {
    margin-left: auto;
}
.lang-switch select {
    background-color: #334155;
    color: #94a3b8;
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 6px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-exit {
    animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(100%); }
}

@media (max-width: 480px) {
    .toast-container {
        align-items: center;
        right: 0;
        left: 0;
    }
}
/* --- LOGIC DROPDOWN CHO DESKTOP --- */
.nav-dropdown {
    display: flex;
    flex-direction: column;
}
@media screen and (min-width: 1025px) {
    .nav-dropdown {
        position: relative;
        display: inline-block;
    }

    .dropdown-content {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #ffffff;
        min-width: 200px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2);
        border-radius: 8px;
        padding: 10px 0;
        z-index: 9999;
        border: 1px solid var(--border-color);
        margin-top: 5px;
    }

    .nav-dropdown:hover .dropdown-content {
        display: block;
        animation: navSlideIn 0.2s ease-out;
    }

    .dropdown-content a {
        display: block;
        padding: 10px 20px ;
        color: var(--text-main) ;
        font-size: 0.85rem ;
        font-weight: 500 ;
        border: none ;
        border-radius: 0 ;
        background: transparent ;
    }

    .dropdown-content a:hover {
        background-color: #f1f5f9 ;
        color: var(--primary-color) ;
        padding-left: 25px ;
    }

    .main-link::after {
        content: '\f107';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        margin-left: 5px;
        font-size: 0.7rem;
    }

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

.player-sub-info {
    display: none;
}