:root {
    --primary-color: #e50914;
    --secondary-color: #000;
    --text-color: #fff;
    --accent-color: #f5c518;
}

body {
    background-color: #141414;
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
}

.header {
    background-color: rgba(0, 0, 0, 0.9);
    padding: 10px 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header__logo {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.header__logo i {
    margin-right: 10px;
}

.main-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.main-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.main-menu a:hover {
    color: var(--primary-color);
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header__search { position: relative; margin-left: 20px; }
.header__search input { background: #222; border: 1px solid #333; color: #fff; padding: 8px 35px 8px 15px; border-radius: 20px; outline: none; transition: 0.3s; }
.header__search input:focus { border-color: var(--primary-color); background: #1a1a1a; }
.header__search button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #888; cursor: pointer; }
.header__search button:hover { color: var(--primary-color); }

.auth-btn {
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    font-weight: 500;
}

.auth-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
    transition: all 0.3s ease;
}

.auth-btn:hover .user-avatar {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* User Dropdown Styles */
.user-dropdown {
    position: relative;
    display: inline-block;
    padding-bottom: 10px; /* Tạo vùng đệm để hover không bị mất */
    margin-bottom: -10px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%; /* Căn lề sát dưới */
    background-color: #1f1f1f;
    min-width: 200px; /* Tăng chiều rộng một chút */
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    z-index: 1001;
    border-radius: 12px;
    border: 1px solid #333;
    overflow: hidden;
    animation: dropdownFade 0.25s ease-out;
}

/* Pseudo-element để cầu nối khi di chuột từ nút xuống menu */
.user-dropdown::before {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    height: 15px;
    display: none;
}

.user-dropdown:hover::before,
.user-dropdown:hover .dropdown-content {
    display: block;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    color: #eee !important;
    padding: 14px 22px; /* Tăng padding để dễ bấm */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s ease;
    border-bottom: 1px solid #2a2a2a;
    font-size: 15px; /* Tăng size chữ */
    font-weight: 500;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #2a2a2a;
    color: var(--primary-color) !important;
    padding-left: 28px; /* Hiệu ứng đẩy nhẹ khi hover */
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.dropdown-toggle-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 18px;
    border-radius: 30px;
    transition: all 0.3s;
    border: 1px solid transparent;
    background-color: rgba(255,255,255,0.03);
}

.dropdown-toggle-btn:hover {
    background-color: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.1);
}

.dropdown-toggle-btn span {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-toggle-btn::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 5px;
    font-size: 12px;
    color: #666;
    transition: all 0.3s ease;
}

.user-dropdown:hover .dropdown-toggle-btn::after {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.user-dropdown:hover .dropdown-toggle-btn {
    background-color: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #b20710 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff1f2a 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--primary-color);
    padding: 8px 22px;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Form styles */
.main-content {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin: 50px auto;
    border: 1px solid #333;
}

.form-control {
    background-color: #333 !important;
    border: 1px solid #444 !important;
    color: white !important;
    padding: 12px 15px !important;
    border-radius: 6px !important;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary-color) !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.2);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #ccc;
}

.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    color: #999;
    z-index: 10;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* Custom Modal Logout Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: #1f1f1f;
    padding: 35px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid #333;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.9);
    animation: slideIn 0.3s forwards ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-card h3 {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-card p {
    color: #ccc;
    margin: 20px 0 30px;
    font-size: 16px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-buttons button {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    cursor: pointer;
}

.main-container {
    min-height: 80vh;
    padding: 20px 5%;
}

.footer {
    background-color: #000;
    padding: 40px 5%;
    margin-top: 50px;
    border-top: 1px solid #333;
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.footer h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer li {
    margin-bottom: 10px;
}

.footer a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: #fff;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    color: #666;
    font-size: 14px;
}

/* Global Animations & Utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(229, 9, 20, 0.2); }
    50% { box-shadow: 0 0 20px rgba(229, 9, 20, 0.6); }
    100% { box-shadow: 0 0 5px rgba(229, 9, 20, 0.2); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-color) 0%, #ff9800 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.glass-panel {
    background: rgba(31, 31, 31, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-primary { background: var(--primary-color); color: white; }
.badge-accent { background: var(--accent-color); color: black; }

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #141414;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Location Toggle Switch */
.location-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 15px;
}

.location-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.location-toggle i {
    color: var(--accent-color);
    font-size: 16px;
}

.location-toggle span {
    font-size: 13px;
    font-weight: 600;
    color: #ccc;
}

.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 18px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.alert {
    padding: 15px 25px;
    margin-bottom: 15px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: alertSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.alert-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border-left: 5px solid #fff;
}

.alert-error {
    background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
    border-left: 5px solid #fff;
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.alert-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.2s;
}

.alert-close:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* AI Chat Box Styles */
.ai-chat-widget {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    z-index: 99999 !important;
    display: block !important;
}

.ai-chat-button {
    width: 60px !important;
    height: 60px !important;
    background: linear-gradient(135deg, var(--primary-color) 0%, #b20710 100%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 10px 25px rgba(229, 9, 20, 0.4) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.ai-chat-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(229, 9, 20, 0.6);
}

.ai-chat-button i {
    font-size: 28px;
    color: white;
}

.ai-chat-window {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: #1f1f1f;
    border-radius: 20px;
    border: 1px solid #333;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-chat-header {
    background: linear-gradient(135deg, #222 0%, #111 100%);
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-avatar i {
    font-size: 20px;
    color: white;
}

.ai-chat-header-text h4 {
    margin: 0;
    font-size: 16px;
    color: var(--accent-color);
}

.ai-chat-header-text span {
    font-size: 12px;
    color: #888;
}

.ai-chat-close {
    cursor: pointer;
    color: #666;
    transition: 0.3s;
}

.ai-chat-close:hover {
    color: var(--primary-color);
}

.ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #181818;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.message-ai {
    align-self: flex-start;
    background: #2a2a2a;
    color: #eee;
    border-bottom-left-radius: 2px;
}

.message-user {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 2px;
}

.ai-feedback {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.ai-feedback i {
    cursor: pointer;
    transition: 0.2s;
}

.ai-feedback i:hover {
    color: var(--accent-color);
}

.ai-feedback i.active {
    color: var(--accent-color);
}

.ai-chat-input-area {
    padding: 20px;
    background: #1f1f1f;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
}

.ai-chat-input {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 25px;
    padding: 10px 18px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: 0.3s;
}

.ai-chat-input:focus {
    border-color: var(--primary-color);
}

.ai-chat-send {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    color: white;
    transition: 0.3s;
}

.ai-chat-send:hover {
    transform: scale(1.1);
    background: #ff1f2a;
}

.typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #2a2a2a;
    border-radius: 15px;
    width: fit-content;
}

.dot {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

.chat-link {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: bold;
}
