:root {
    --vovinam-blue: #0055A4;
    --vovinam-yellow: #FFD700;
    --vovinam-red: #DA251D;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background-color: #f0f2f5; color: #333; line-height: 1.6; padding-bottom: 50px; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* HEADER */
header { background-color: var(--vovinam-blue); color: white; padding: 0.5rem 1rem; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.header-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }

/* LOGO STYLING */
.logo-container { display: flex; align-items: center; cursor: pointer; gap: 10px; transition: transform 0.2s ease; }
.logo-container:hover { transform: scale(1.05); }
.logo { height: 55px; width: 55px; object-fit: contain; background-color: white; border-radius: 50%; border: 2px solid #FFD700; padding: 2px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
h1 { font-size: 1.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #FFD700; text-shadow: 1px 1px 2px rgba(0,0,0,0.3); }

/* NAV */
#main-nav { flex-grow: 1; margin: 0 20px; }
.main-menu { display: flex; gap: 20px; }
.main-menu li { position: relative; }
.main-menu a { color: white; font-weight: 500; padding: 10px; transition: 0.3s; border-radius: 4px; display: block; }
.main-menu a:hover { background-color: rgba(255,255,255,0.2); }
.dropdown-content { display: none; position: absolute; background-color: white; min-width: 200px; box-shadow: 0 8px 16px rgba(0,0,0,0.2); z-index: 1001; border-radius: 5px; overflow: hidden; top: 100%; left: 0; }
.dropdown-content li a { color: #333; padding: 12px 16px; display: block; text-align: left; }
.dropdown-content li a:hover { background-color: #f1f1f1; color: var(--vovinam-blue); }
.dropdown:hover .dropdown-content { display: block; }

/* BUTTONS */
.auth-buttons button, .btn-login, .btn-register { padding: 8px 15px; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; transition: 0.3s; margin-left: 10px; }
.btn-login { background-color: white; color: var(--vovinam-blue); }
.btn-register { background-color: var(--vovinam-yellow); color: var(--vovinam-blue); }
.btn-login:hover { background-color: #eee; } .btn-register:hover { background-color: #e6c200; }
.user-info { display: flex; align-items: center; gap: 10px; }
.btn-user-menu { background: none; border: none; color: white; font-size: 1rem; cursor: pointer; display: flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid rgba(255,255,255,0.3); border-radius: 20px; }
.user-dropdown { position: relative; }
.user-dropdown-content { display: none; position: absolute; right: 0; background: white; min-width: 180px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); border-radius: 5px; z-index: 1002; overflow: hidden; margin-top: 10px; }
.user-dropdown:hover .user-dropdown-content { display: block; }
.user-dropdown-content li a { color: #333; padding: 10px 15px; display: block; }
.user-dropdown-content li a:hover { background: #f8f9fa; }

/* MAIN LAYOUT */
main { max-width: 1200px; margin: 20px auto; padding: 0 15px; min-height: 60vh; }
section { background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); padding: 20px; margin-bottom: 20px; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.section-title { color: var(--vovinam-blue); border-bottom: 2px solid var(--vovinam-yellow); padding-bottom: 10px; margin-bottom: 20px; }

/* BANNER SLIDER */
.banner-slider-container { position: relative; width: 100%; height: 350px; overflow: hidden; border-radius: 8px; margin-bottom: 30px; }
.banner-wrapper { display: flex; width: 100%; height: 100%; transition: transform 0.5s ease-in-out; }
.slide { min-width: 100%; position: relative; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-content { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0, 85, 164, 0.7); color: white; padding: 20px; text-align: center; }
.banner-content h2 { margin-bottom: 5px; color: var(--vovinam-yellow); text-shadow: 1px 1px 2px black; }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: white; border: none; padding: 10px 15px; cursor: pointer; border-radius: 50%; font-size: 1.2rem; z-index: 10; transition: 0.3s; }
.prev { left: 10px; } .next { right: 10px; } .slider-btn:hover { background: rgba(0,0,0,0.8); }
.slider-dots { text-align: center; position: absolute; bottom: 10px; width: 100%; z-index: 10; }
.dot { height: 10px; width: 10px; background-color: rgba(255,255,255,0.5); border-radius: 50%; display: inline-block; margin: 0 5px; cursor: pointer; }
.dot.active { background-color: var(--vovinam-yellow); }
.btn-config-banner { position: absolute; top: 10px; right: 10px; z-index: 20; background: rgba(0,0,0,0.6); color: white; border: none; padding: 5px 10px; cursor: pointer; border-radius: 4px; font-size: 0.9rem; }

/* CLUB CARDS */
.club-slider h3 { text-align: center; color: var(--vovinam-blue); margin-bottom: 20px; }
.slider-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
.club-card { background: linear-gradient(135deg, #0055A4, #003366); color: white; padding: 20px; border-radius: 10px; width: 180px; text-align: center; cursor: pointer; transition: transform 0.3s, box-shadow 0.3s; box-shadow: 0 4px 6px rgba(0,0,0,0.1); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.club-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,85,164,0.3); }
.club-card i { font-size: 2rem; color: var(--vovinam-yellow); }

/* FORMS */
.auth-container { max-width: 400px; margin: 0 auto; text-align: center; }
.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 1rem; }
.btn-submit { background-color: var(--vovinam-blue); color: white; border: none; padding: 10px 20px; border-radius: 5px; width: 100%; cursor: pointer; font-size: 1rem; font-weight: bold; transition: 0.3s; }
.btn-submit:hover { background-color: #004488; }
.auth-link { margin-top: 15px; font-size: 0.9rem; }
.auth-link a { color: var(--vovinam-blue); font-weight: bold; }

/* CLUB MANAGER */
.club-tabs { display: flex; border-bottom: 2px solid #eee; margin-bottom: 20px; }
.tab-btn { background: none; border: none; padding: 10px 20px; cursor: pointer; font-size: 1rem; color: #666; font-weight: 500; border-bottom: 3px solid transparent; }
.tab-btn.active { color: var(--vovinam-blue); border-bottom-color: var(--vovinam-blue); }
.attendance-toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; margin-bottom: 15px; gap: 10px; background: #f8f9fa; padding: 10px; border-radius: 5px; }
.filter-group, .action-group { display: flex; gap: 10px; align-items: center; }
.btn-tool { padding: 6px 12px; border: 1px solid #ddd; background: white; border-radius: 4px; cursor: pointer; font-size: 0.9rem; color: #555; display: flex; align-items: center; gap: 5px; }
.btn-tool:hover { background: #e9ecef; } .btn-export { color: #217346; border-color: #217346; } .btn-save-attendance { background: var(--vovinam-blue); color: white; border: none; padding: 8px 20px; border-radius: 5px; cursor: pointer; font-weight: bold; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { border: 1px solid #eee; padding: 10px; text-align: left; vertical-align: middle; }
th { background-color: #f8f9fa; color: var(--vovinam-blue); font-weight: bold; }
.student-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #2196F3; }
input:checked + .slider:before { transform: translateX(26px); }
.note-input { width: 100%; border: none; border-bottom: 1px dashed #ccc; padding: 5px; outline: none; background: transparent; }
.btn-edit-student { background: none; border: none; color: #666; cursor: pointer; margin-left: 10px; }

/* HISTORY TABLE */
.history-controls { display: flex; gap: 15px; margin-bottom: 15px; align-items: flex-end; flex-wrap: wrap; background: #f1f1f1; padding: 10px; border-radius: 5px; }
.control-group { display: flex; flex-direction: column; }
.control-group label { font-size: 0.8rem; margin-bottom: 3px; font-weight: bold; }
.history-table th { background: #0055A4; color: white; }
.status-badge { padding: 4px 8px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; }
.status-present { background-color: #d4edda; color: #155724; }
.status-absent { background-color: #f8d7da; color: #721c24; }

/* NEWS */
.news-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.btn-create-news { background: #28a745; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer; }
.news-filters { display: flex; gap: 15px; margin-bottom: 15px; flex-wrap: wrap; background: #f9f9f9; padding: 10px; border-radius: 5px; }
.news-item { background: white; border: 1px solid #eee; padding: 15px; margin-bottom: 15px; border-radius: 8px; transition: 0.3s; }
.news-item:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.08); }
.news-item h3 { color: var(--vovinam-blue); margin-bottom: 5px; }
.news-preview { max-height: 100px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; color: #555; margin: 10px 0; }
.news-preview img, .news-preview video { max-width: 100px; height: auto; display: none; }
.read-more-btn { color: var(--vovinam-blue); font-weight: bold; cursor: pointer; display: inline-block; margin-top: 5px; }
.rich-editor-toolbar { background: #eee; padding: 5px; border-radius: 5px 5px 0 0; display: flex; gap: 5px; border: 1px solid #ccc; border-bottom: none; }
.rich-editor-toolbar button, .btn-tool-media { background: white; border: 1px solid #ccc; padding: 5px 10px; cursor: pointer; border-radius: 3px; min-width: 30px; }
.post-editor { border: 1px solid #ccc; min-height: 150px; padding: 10px; border-radius: 0 0 5px 5px; margin-bottom: 15px; max-height: 400px; overflow-y: auto; }
.post-editor img, .post-editor video { max-width: 100%; margin-top: 10px; border-radius: 5px; }
.post-input { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 5px; font-weight: bold; font-size: 1.1rem; }
.btn-back-custom { background: #6c757d; color: white; border: none; padding: 5px 15px; border-radius: 4px; cursor: pointer; margin-bottom: 15px; }
.article-content img, .article-content video { max-width: 100%; height: auto; margin: 15px 0; border-radius: 5px; display: block; }
.comment-section { margin-top: 30px; background: #f8f9fa; padding: 15px; border-radius: 8px; }
.comment-item { background: white; padding: 10px; border-radius: 5px; margin-bottom: 10px; border-left: 3px solid #ccc; }
.comment-item.is-admin { border-left-color: var(--vovinam-red); background: #fff5f5; }
.comment-header { display: flex; justify-content: space-between; font-size: 0.85rem; color: #777; margin-bottom: 5px; }
.comment-author-name { font-weight: bold; color: #333; }
.comment-role-badge { background: var(--vovinam-red); color: white; font-size: 0.7rem; padding: 1px 4px; border-radius: 3px; margin-left: 5px; }
.comment-toolbar { background: #eee; padding: 2px 5px; border-radius: 3px 3px 0 0; border: 1px solid #ddd; border-bottom: none; }
#comment-input-rich { border: 1px solid #ddd; background: white; min-height: 50px; padding: 10px; border-radius: 0 0 3px 3px; margin-bottom: 10px; }
.btn-send-comment { background: var(--vovinam-blue); color: white; border: none; padding: 6px 15px; border-radius: 4px; cursor: pointer; }
.admin-actions { margin-top: 10px; display: flex; gap: 10px; }
.btn-edit-post { background: #ffc107; color: #333; border: none; padding: 3px 8px; border-radius: 3px; cursor: pointer; font-size: 0.8rem; }
.btn-delete-post, .btn-delete-cmt { background: #dc3545; color: white; border: none; padding: 3px 8px; border-radius: 3px; cursor: pointer; font-size: 0.8rem; }

/* SHOP */
.shop-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.cart-summary { background: var(--vovinam-red); color: white; padding: 8px 15px; border-radius: 20px; cursor: pointer; font-weight: bold; display: flex; align-items: center; gap: 8px; transition: 0.3s; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.cart-summary:hover { transform: scale(1.05); }
.shop-controls { margin-bottom: 25px; }
.search-bar { display: flex; margin-bottom: 15px; }
.search-bar input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 5px 0 0 5px; outline: none; }
.search-bar button { padding: 10px 15px; background: var(--vovinam-blue); color: white; border: none; border-radius: 0 5px 5px 0; cursor: pointer; }
.category-tabs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.cat-btn { padding: 8px 16px; border: 1px solid #ddd; background: white; border-radius: 20px; cursor: pointer; white-space: nowrap; transition: 0.3s; color: #555; font-size: 0.9rem; }
.cat-btn.active, .cat-btn:hover { background: var(--vovinam-blue); color: white; border-color: var(--vovinam-blue); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.product-card { border: 1px solid #eee; border-radius: 8px; overflow: hidden; transition: 0.3s; background: white; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.1); transform: translateY(-3px); }
.product-card img { width: 100%; height: 180px; object-fit: cover; }
.product-info { padding: 10px; flex-grow: 1; display: flex; flex-direction: column; }
.product-card h4 { margin-bottom: 5px; font-size: 1rem; color: #333; height: 40px; overflow: hidden; }
.product-card .price { color: var(--vovinam-red); font-weight: bold; font-size: 1.1rem; margin-bottom: 10px; }
.btn-add-cart { margin-top: auto; width: 100%; background: white; border: 1px solid var(--vovinam-blue); color: var(--vovinam-blue); padding: 8px; border-radius: 4px; cursor: pointer; transition: 0.2s; font-weight: bold; }
.btn-add-cart:hover { background: var(--vovinam-blue); color: white; }

/* MODAL */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(2px); }
.modal-content { background-color: #fefefe; margin: 10% auto; padding: 20px; border: 1px solid #888; width: 90%; max-width: 500px; border-radius: 8px; position: relative; animation: slideIn 0.3s; }
.modal-cart-content { max-width: 600px; }
@keyframes slideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close-modal { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-modal:hover { color: black; }
.cart-table th { background: #eee; color: #333; font-size: 0.9rem; }
.cart-table td { padding: 8px; }
.cart-total { text-align: right; font-size: 1.2rem; font-weight: bold; margin: 15px 0; color: var(--vovinam-red); }
.btn-checkout { background: var(--vovinam-red); }
.qr-payment-section { text-align: center; margin-top: 15px; background: #e3f2fd; padding: 15px; border-radius: 5px; border: 1px dashed var(--vovinam-blue); }
.qr-img { max-width: 200px; margin: 10px auto; display: block; }
.qr-note { font-size: 0.9rem; color: #555; margin-top: 5px; }

/* TOAST NOTIFICATION */
#toast-container { position: fixed; top: 80px; right: 20px; z-index: 3000; }
.toast { background: white; border-left: 5px solid var(--vovinam-blue); padding: 15px 20px; margin-bottom: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.15); border-radius: 4px; display: flex; align-items: center; gap: 10px; animation: slideLeft 0.3s; min-width: 250px; }
@keyframes slideLeft { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast i { color: #28a745; font-size: 1.2rem; }

/* PROFILE AVATAR */
.avatar-wrapper { position: relative; width: 100px; height: 100px; margin: 0 auto 10px; }
.profile-avatar-large { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--vovinam-blue); }
.btn-upload-avatar { position: absolute; bottom: 0; right: 0; background: var(--vovinam-blue); color: white; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid white; }
.profile-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-edit { background: #ffc107; flex: 1; border: none; padding: 10px; border-radius: 5px; cursor: pointer; font-weight: bold; }
.btn-save { background: #28a745; flex: 1; border: none; padding: 10px; border-radius: 5px; cursor: pointer; font-weight: bold; color: white; }

/* FOOTER DESIGN */
footer { background-color: var(--vovinam-blue); color: white; padding-top: 30px; margin-top: 50px; border-top: 4px solid var(--vovinam-yellow); }
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; padding: 0 20px 20px; }
.footer-section { flex: 1; min-width: 250px; margin-bottom: 20px; text-align: center; }
.footer-section h3 { font-size: 1.4rem; color: var(--vovinam-yellow); text-transform: uppercase; margin-bottom: 10px; font-weight: bold; }
.footer-section h4 { font-size: 1.1rem; margin-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.3); display: inline-block; padding-bottom: 5px; }
.footer-section p { margin-bottom: 8px; font-size: 0.95rem; color: #e0e0e0; }
.footer-section i { margin-right: 8px; color: var(--vovinam-yellow); }
.social-icons a { color: white; font-size: 1.5rem; margin: 0 10px; transition: 0.3s; }
.social-icons a:hover { color: var(--vovinam-yellow); transform: translateY(-3px); }
.footer-bottom { background-color: #004080; text-align: center; padding: 15px 0; font-size: 0.85rem; border-top: 1px solid rgba(255,255,255,0.1); }

/* RESPONSIVE */
@media screen and (max-width: 768px) {
    .header-content { flex-wrap: wrap; }
    #main-nav { display: none; width: 100%; order: 3; margin: 10px 0; }
    #main-nav.active { display: block; }
    .main-menu { flex-direction: column; gap: 0; }
    .main-menu a { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .dropdown-content { position: static; box-shadow: none; padding-left: 20px; background: rgba(0,0,0,0.1); }
    .dropdown-content li a { color: white; }
    .auth-buttons { display: none; width: 100%; order: 4; justify-content: center; margin-top: 10px; }
    .auth-buttons.active, #main-nav.active ~ .auth-buttons { display: flex; }
    .hide-on-mobile { display: none; }
    .mobile-header-top { display: flex; width: 100%; justify-content: space-between; align-items: center; }
    .mobile-menu-btn { display: block; background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }
    .user-info { margin-left: auto; }
    .club-card { width: 45%; }
    .banner-slider-container { height: 200px; }
    .shop-controls { flex-direction: column; gap: 10px; }
    .search-bar { width: 100%; }
    .category-tabs { width: 100%; }
    .footer-content { flex-direction: column; text-align: center; }
    .form-group-inline { flex-direction: column; }
    .logo { height: 45px; width: 45px; }
}