.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: 15px;
}

/* Ticker dưới header - Tối ưu cho mobile */
.ticker-bar {
    position: fixed;
    width: 100%;
    height: 32px;
    background: #0a0a0a;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
    z-index: 9000;
    top: 70px;
    -webkit-overflow-scrolling: touch;
    /* Tối ưu hiệu năng cho mobile */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.ticker-wrapper {
    display: flex;
    width: max-content;
    height: 100%;
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.ticker-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    height: 100%;
    color: #ff2b2b;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.95;
    font-size: 12px;
    padding: 0 30px;
    animation: tickerMove 25s linear infinite;
    -webkit-animation: tickerMove 25s linear infinite;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Tối ưu GPU acceleration */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.ticker-content span {
    margin: 0 8px;
    display: inline-block;
}

.ticker-content.ticker-dup {
    animation-delay: 12.5s;
    -webkit-animation-delay: 12.5s;
}

@keyframes tickerMove {
    0% { transform: translateX(0) translateZ(0); }
    100% { transform: translateX(-50%) translateZ(0); }
}

@-webkit-keyframes tickerMove {
    0% { -webkit-transform: translateX(0) translateZ(0); }
    100% { -webkit-transform: translateX(-50%) translateZ(0); }
}

/* Mask 2 đầu để chữ mờ dần, nhìn mượt hơn */
.ticker-mask-left,
.ticker-mask-right {
    position: absolute;
    top: 0;
    width: 40px;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.ticker-mask-left {
    left: 0;
    background: linear-gradient(90deg, #0a0a0a 0%, transparent 100%);
}

.ticker-mask-right {
    right: 0;
    background: linear-gradient(270deg, #0a0a0a 0%, transparent 100%);
}

@media (min-width: 768px) {
    .header-actions {
        gap: 25px;
        margin-left: 20px;
    }
    .ticker-bar {
        top: 80px;
        height: 36px;
    }
    .ticker-content {
        font-size: 14px;
        animation-duration: 30s;
        -webkit-animation-duration: 30s;
    }
    .ticker-content.ticker-dup {
        animation-delay: 15s;
        -webkit-animation-delay: 15s;
    }
}

/* Tối ưu cho mobile nhỏ */
@media (max-width: 480px) {
    .header-actions {
        gap: 12px !important;
        margin-left: 10px;
    }
    
    .ticker-bar {
        height: 28px;
    }
    .ticker-content {
        font-size: 11px;
        padding: 0 20px;
        animation-duration: 20s;
        -webkit-animation-duration: 20s;
        letter-spacing: 0.3px;
    }
    .ticker-content span {
        margin: 0 6px;
    }
    .ticker-content.ticker-dup {
        animation-delay: 10s;
        -webkit-animation-delay: 10s;
    }
    .ticker-mask-left,
    .ticker-mask-right {
        width: 30px;
    }
}

@media (max-width: 400px) {
    .header-actions {
        gap: 10px !important;
        margin-left: 8px;
    }
}

@media (max-width: 360px) {
    .header-actions {
        gap: 8px !important;
        margin-left: 6px;
    }
}

.search-form {
    position: relative;
    width: 190px;
    height: 35px;
    margin-right: 10px;
}

@media (min-width: 768px) {
    .search-form {
        width: 260px;
        height: 40px;
        margin-right: 15px;
    }
}

@media (max-width: 480px) {
    .search-form {
        width: 200px !important;
        min-width: 200px;
        height: 32px;
        margin-right: 10px;
        flex-shrink: 0;
    }
    
    .search-form input {
        padding: 6px 30px 6px 10px !important;
        font-size: 16px; /* Tăng lên 16px để tránh auto-zoom trên iOS Safari */
        box-sizing: border-box;
    }
    
    .search-form input::placeholder {
        font-size: 14px !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        letter-spacing: 0.2px;
    }
    
    .search-form i {
        right: 10px !important;
        font-size: 13px;
        width: 16px;
    }
}

@media (max-width: 400px) {
    .search-form {
        width: 185px !important;
        min-width: 185px;
        margin-right: 8px;
    }
    
    .search-form input {
        padding: 6px 28px 6px 10px !important;
    }
    
    .search-form input::placeholder {
        font-size: 13.5px !important;
    }
    
    .search-form i {
        right: 9px !important;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .search-form {
        width: 175px !important;
        min-width: 175px;
        margin-right: 6px;
    }
    
    .search-form input {
        padding: 6px 26px 6px 10px !important;
    }
    
    .search-form input::placeholder {
        font-size: 13px !important;
    }
    
    .search-form i {
        right: 8px !important;
        font-size: 12px;
    }
}

.search-form input {
    width: 100%;
    height: 100%;
    padding: 8px 45px 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.search-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.search-form input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(229, 9, 20, 0.5);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.15),
                0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.search-form i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
    transition: all 0.3s ease;
}

.search-form input:focus + i {
    color: #e50914;
    transform: translateY(-50%) scale(1.1);
}

/* Language Switcher */
.language-switcher {
    position: relative;
    margin-right: 10px;
    z-index: 1000;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: bold;
}

@media (min-width: 768px) {
    .lang-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.lang-text {
    margin-left: 4px;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: rgba(26, 26, 26, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.language-switcher:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 14px;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lang-option .flag {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.lang-option span:not(.flag) {
    flex: 1;
}

.lang-option .fa-check {
    color: #e50914;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lang-option.active .fa-check {
    opacity: 1;
}

/* Language Switcher - Simple Icon Button */
.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 10px;
    z-index: 1000;
    border: none;
}

@media (min-width: 768px) {
    .lang-btn {
        width: 42px;
        height: 42px;
        margin-right: 12px;
    }
}

.lang-btn i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lang-btn:active {
    transform: scale(0.95);
}

.lang-btn:hover i {
    transform: rotate(-15deg);
    color: #e50914;
}

/* Light mode for language switcher */
body.light-mode .lang-btn {
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
}

body.light-mode .lang-btn:hover {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(229, 9, 20, 0.3);
}

body.light-mode .lang-btn:hover i {
    color: #e50914;
}

/* Theme Toggle Button */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-right: 10px;
    z-index: 1000;
}

@media (min-width: 768px) {
    .theme-toggle {
        width: 40px;
        height: 40px;
        margin-right: 15px;
    }
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.theme-toggle i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(15deg);
}

/* Dark/Light Mode Toggle Button */
.theme-toggle-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    min-height: 35px !important;
    background: #e50914 !important;
    border: none !important;
    border-radius: 50% !important;
    color: #fff !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 1001 !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 0 !important;
}

.theme-toggle-btn:hover {
    background: #f40612 !important;
    transform: scale(1.1) !important;
}

.theme-toggle-btn svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 20px !important;
    height: 20px !important;
    transition: all 0.3s ease !important;
    color: currentColor !important;
}

.theme-toggle-btn:hover svg {
    transform: rotate(15deg) scale(1.1) !important;
}

@media (min-width: 768px) {
    .theme-toggle-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }
    
    .theme-toggle-btn svg {
        width: 22px !important;
        height: 22px !important;
    }
}

@media (max-width: 767px) {
    .theme-toggle-btn {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

body.light-mode .theme-toggle-btn {
    background: #e50914 !important;
    color: #fff !important;
}

body.light-mode .theme-toggle-btn:hover {
    background: #f40612 !important;
}

.user-menu {
    position: relative;
}

.user-btn {
    background: #e50914;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1000;
    overflow: hidden; /* đảm bảo ảnh không tràn ra ngoài */
}

@media (min-width: 768px) {
    .user-btn {
        width: 40px;
        height: 40px;
    }
}

.user-btn:hover {
    background: #b2070f;
    transform: scale(1.05);
}

/* Disable hover effects on mobile */
@media (max-width: 576px){
    .user-btn:hover{ background:#e50914; transform:none; }
    .user-menu:hover .dropdown-menu{ opacity:0; visibility:hidden; transform: translateY(-10px); }
}

.user-btn i {
    font-size: 18px;
    color: #fff;
}

/* Nếu có dùng img bên trong, vẫn ép kích thước nhỏ */
.user-btn img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block}

.user-menu .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: linear-gradient(135deg, #282a36, #1e1e2e);
    border-radius: 15px;
    padding: 0;
    min-width: 280px;
    max-width: 90vw;
    box-shadow: 0 15px 40px rgba(0,0,0,0.7);
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
    .user-menu .dropdown-menu {
        min-width: 300px;
        max-width: none;
    }
}

.user-menu.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    transform: rotate(45deg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-right: none;
}

/* User Info Section */
.user-info-section {
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-name {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.user-name h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.premium-badge {
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    color: #000;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.upgrade-text {
    color: #ccc;
    font-size: 12px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.upgrade-btn {
    width: 100%;
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    color: #000;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

/* Balance Section */
.balance-section {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.balance-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.balance-header span {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.balance-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.balance-amount {
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-number {
    color: #ffd700;
    font-size: 18px;
    font-weight: bold;
}

.balance-currency {
    background: #ffd700;
    color: #000;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.deposit-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.deposit-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Menu Items */
.menu-items {
    padding: 10px 0;
}

.dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dropdown-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #ffd700;
    padding-left: 25px;
}

.dropdown-menu .dropdown-item i {
    margin-right: 12px;
    width: 18px;
    text-align: center;
    font-size: 16px;
}

.dropdown-menu .dropdown-item.logout {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 5px;
    color: #ff6b6b;
}

.dropdown-menu .dropdown-item.logout:hover {
    background: rgba(255, 107, 107, 0.1);
    border-left-color: #ff6b6b;
}

/* Search Container */
.search-container {
    position: relative;
    display: inline-block;
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    backdrop-filter: blur(10px);
    margin-top: 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(229, 9, 20, 0.5) rgba(255, 255, 255, 0.05);
}

/* Custom scrollbar for search suggestions */
.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 8px 0;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(229, 9, 20, 0.6) 0%, rgba(229, 9, 20, 0.4) 100%);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(229, 9, 20, 0.8) 0%, rgba(229, 9, 20, 0.6) 100%);
    box-shadow: 0 0 8px rgba(229, 9, 20, 0.4);
}

.search-suggestions.show {
    display: block;
}

.suggestions-section {
    padding: 15px 0;
}

.suggestions-title {
    padding: 0 20px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #e50914;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.suggestion-item:hover {
    background: rgba(229, 9, 20, 0.1);
}

.suggestion-item.active {
    background: rgba(229, 9, 20, 0.2);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-movie {
    display: flex;
    align-items: center;
    width: 100%;
}

.suggestion-poster {
    width: 40px;
    height: 60px;
    border-radius: 5px;
    object-fit: cover;
    margin-right: 15px;
    background: #333;
}

.suggestion-info {
    flex: 1;
}

.suggestion-title {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 5px;
}

.suggestion-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.suggestion-quality {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 10px;
}

.suggestion-actor {
    display: flex;
    align-items: center;
    width: 100%;
}

.suggestion-actor-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e50914, #ff1744);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
    font-size: 16px;
}

.suggestion-actor-name {
    font-size: 14px;
    color: #ffffff;
}

.no-suggestions {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Mobile Responsive for Suggestions */
@media (max-width: 768px) {
    .search-suggestions {
        max-height: 300px;
    }
    
    .suggestion-poster {
        width: 35px;
        height: 50px;
    }
    
    .suggestion-actor-icon {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .suggestion-poster {
        width: 30px;
        height: 45px;
    }
    
    .suggestion-actor-icon {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .suggestion-title {
        font-size: 13px;
    }
    
    .suggestion-meta {
        font-size: 11px;
    }
}