/* --- Cấu hình chung --- */
:root {
    --bg-color: #f0f2f5;
    --text-color: #050505;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --primary-blue: #0866ff;
    --hover-bg: #e4e6eb;
    --max-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Helvetica, Arial, sans-serif; }

body { background: var(--bg-color); color: var(--text-color); padding-bottom: 50px; min-height: 100vh; }
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* --- HEADER --- */
.glass-header { background: #fff; border-bottom: 1px solid #ddd; position: sticky; top: 0; z-index: 1000; height: 60px; display: flex; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 100%; width: 100%; }
.logo { font-size: 26px; font-weight: 900; letter-spacing: -1px; cursor: pointer; color: #222; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.action-btn { width: 40px; height: 40px; border-radius: 50%; background: #e4e6eb; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; color: #050505; transition: 0.2s; }
.action-btn:hover { background: #d0d2d6; }
.user-profile img { width: 40px; height: 40px; border-radius: 50%; cursor: pointer; object-fit: cover; }

/* --- POPUP SEARCH --- */
.search-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 2000; display: none; justify-content: center; align-items: flex-start; padding-top: 100px; backdrop-filter: blur(5px); }
.search-popup { width: 90%; max-width: 600px; background: white; padding: 30px; border-radius: 15px; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.3); animation: slideDown 0.3s ease; }
@keyframes slideDown { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 20px; cursor: pointer; color: #555; }
.search-popup h3 { margin-bottom: 20px; color: #333; }
.popup-form { display: flex; border: 2px solid var(--primary-blue); border-radius: 30px; overflow: hidden; padding: 5px; }
.popup-form input { flex-grow: 1; border: none; outline: none; padding: 10px 15px; font-size: 16px; }
.popup-form button { background: var(--primary-blue); color: white; border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 16px; }

/* --- BANNER CAROUSEL --- */
.banner-section { border-radius: 15px; overflow: hidden; margin: 25px 0 20px 0; position: relative; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.carousel { height: 300px; position: relative; }
.banner-img { width: 100%; height: 100%; background-size: cover; background-position: center; transition: transform 0.5s ease; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.8); border: none; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; z-index: 2; font-size: 18px; color: #333; transition: 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.nav-btn:hover { background: white; transform: translateY(-50%) scale(1.1); }
.nav-btn.prev { left: 15px; } .nav-btn.next { right: 15px; }
.carousel-dots { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.dot { width: 8px; height: 8px; background: rgba(255,255,255,0.5); border-radius: 50%; }
.dot.active { background: white; transform: scale(1.2); }

/* --- NEW SEARCH BAR (GIỐNG HÌNH MẪU) --- */
.search-location-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 0 5px; /* Một chút padding để bóng không bị cắt */
}

/* Nút thành phố bên trái */
.city-pill {
    background: #fff;
    border: none;
    border-radius: 50px; /* Bo tròn hoàn toàn */
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 700; /* Chữ đậm */
    color: #000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), -2px -2px 5px rgba(255,255,255,0.8); /* Hiệu ứng nổi */
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s;
}

.city-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* Thanh tìm kiếm bên phải */
.main-search-pill {
    flex-grow: 1;
    background: #fff;
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 5px; /* Khoảng cách giữa viền và nút tròn bên trong */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05) inset; /* Đổ bóng vào trong nhẹ để tạo chiều sâu */
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); /* Bóng ngoài */
}

.main-search-pill input {
    flex-grow: 1;
    border: none;
    background: transparent;
    outline: none;
    padding: 10px 20px;
    font-size: 16px;
    color: #333;
}

/* Nút tròn bên trong thanh tìm kiếm */
.circle-search-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff; /* Nền trắng */
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin-right: 2px;
}

.circle-search-btn:hover {
    background: #f5f5f5;
}

/* --- CONTENT SECTIONS --- */
.content-section { margin-bottom: 40px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.section-title { font-size: 20px; font-weight: 700; }
.see-more { text-decoration: none; color: var(--primary-blue); font-size: 14px; font-weight: 600; }

.card-grid { display: grid; gap: 15px; grid-template-columns: repeat(1, 1fr); }
@media (min-width: 600px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }

.card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); transition: transform 0.2s; text-decoration: none; color: inherit; display: flex; flex-direction: column; border: 1px solid rgba(0,0,0,0.05); }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.card-img { height: 180px; background-color: #ddd; background-size: cover; background-position: center; position: relative; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--primary-blue); color: white; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: bold; }
.tournament-badge { background: #e41e3f; }
.card-info { padding: 15px; display: flex; flex-direction: column; flex-grow: 1; }
.card-info h3 { font-size: 16px; margin-bottom: 5px; font-weight: 700; line-height: 1.4; }
.address { font-size: 13px; color: #65676b; margin-bottom: 12px; }
.card-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.price { color: var(--text-color); font-size: 15px; }
.rating { color: #f7b928; font-size: 13px; }
.prize-text { color: #e41e3f; font-weight: bold; }
.join-btn-full { width: 100%; margin-top: 12px; padding: 10px; background: #e7f3ff; color: var(--primary-blue); border: none; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.join-btn-full:hover { background: #dcecfc; }
/* --- ADMIN DASHBOARD STYLES --- */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #fff;
    border-right: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    height: 100vh;
}

.sidebar-logo {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 40px;
    color: #222;
    text-align: center;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    text-decoration: none;
    color: #555;
    border-radius: 10px;
    font-weight: 600;
    transition: 0.3s;
}

.sidebar-menu li.active a, .sidebar-menu li a:hover {
    background: var(--primary-blue);
    color: white;
}

.logout-btn { color: #d32f2f !important; }
.logout-btn:hover { background: #ffebee !important; color: #d32f2f !important; }

/* Admin Content */
.admin-content {
    flex-grow: 1;
    margin-left: 250px; /* Bằng width sidebar */
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-circle {
    width: 35px; height: 35px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card h4 { color: #666; font-size: 14px; margin-bottom: 5px; }
.stat-card h2 { font-size: 28px; font-weight: 800; }

/* Data Table */
.data-table-section {
    padding: 20px;
    border-radius: 15px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.add-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th { color: #888; font-weight: 600; font-size: 13px; }
.admin-table tr:last-child td { border-bottom: none; }

.badge-price {
    background: #e7f3ff;
    color: var(--primary-blue);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.action-btn {
    border: none;
    width: 30px; height: 30px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
}
.action-btn.edit { background: #fff7e6; color: #fa8c16; }
.action-btn.delete { background: #fff1f0; color: #f5222d; }
/* ... (Giữ nguyên code cũ) ... */

/* --- MODAL STYLES (POPUP) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none; /* Ẩn mặc định */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-box {
    width: 400px;
    background: white;
    padding: 25px;
    border-radius: 15px;
    animation: zoomIn 0.2s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-modal {
    background: none; border: none; font-size: 20px; cursor: pointer; color: #666;
}

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 14px; }
.form-group input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #ddd; outline: none; }
.form-group input:focus { border-color: var(--primary-blue); }

.save-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}
.save-btn:hover { opacity: 0.9; }
