body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: visibility 0s, opacity 0.3s ease-in-out;
}
.container {
    max-width: 800px;
    margin-top: 30px;
    padding: 0 15px;
}
.card {
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: none;
    overflow: hidden;
}
.card-header {
    background-color: #ff0050;
    color: white;
    border-radius: 15px 15px 0 0 !important;
    font-weight: bold;
    font-size: 1.2rem;
    text-align: center;
    padding: 12px 15px;
}
.card-body {
    padding: 20px;
}
.btn-primary {
    background-color: #ff0050;
    border-color: #ff0050;
}
.btn-primary:hover {
    background-color: #d10045;
    border-color: #d10045;
}
.btn-success {
    background-color: #25F4EE;
    border-color: #25F4EE;
    color: #000;
}
.btn-success:hover {
    background-color: #20d6d1;
    border-color: #20d6d1;
    color: #000;
}
.btn-outline-primary {
    border-color: #ff0050;
    color: #ff0050;
}
.btn-outline-primary:hover {
    background-color: #ff0050;
    color: white;
}
.form-control:focus {
    border-color: #ff0050;
    box-shadow: 0 0 0 0.25rem rgba(255, 0, 80, 0.25);
}
.spinner-border {
    color: #ff0050;
}
.video-info {
    display: flex;
    flex-direction: column;
}
.video-metadata {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.video-info p {
    margin: 10px 0;
    white-space: pre-line;
    word-break: break-word;
}

/* CSS đặc biệt cho mô tả người dùng */
.user-description {
    text-align: center;
    width: 100%;
    display: inline-block;
}

.author-info {
    margin-left: 10px;
    flex: 1;
    min-width: 200px;
}
.author-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f0f0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.video-stats {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    color: #6c757d;
    flex-wrap: wrap;
    justify-content: center;
}
.stat-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
.stat-item i {
    margin-right: 5px;
}
.video-preview {
    position: relative;
    width: 100%;
    max-width: 450px;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px auto;
    aspect-ratio: 9/16;
    background-color: #000;
}
.video-preview img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    display: block;
    object-fit: contain;
}
.video-preview video {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    display: block;
    background-color: #000;
    object-fit: contain;
}
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}
.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 10px;
    z-index: 3;
}
.video-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #ff0050;
    border-width: 0.25rem;
}
.video-loading-text {
    position: absolute;
    bottom: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}
.download-options {
    margin-top: 20px;
}
.logo {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ff0050;
}
.logo i {
    color: #25F4EE;
    margin-right: 10px;
}
.error-message {
    color: #dc3545;
    font-weight: bold;
    text-align: center;
}
.loading-text {
    margin-left: 10px;
}
.footer {
    background-color: #f8f9fa;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #e7e7e7;
    font-size: 14px;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    width: 100%;
    position: relative;
    left: 0;
    right: 0;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

/* Đảm bảo footer nằm ngoài container chính */
.main-content > .footer {
    margin-left: -15px;
    margin-right: -15px;
    width: calc(100% + 30px);
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 0;
    padding: 15px;
    max-width: 800px;
}
.copyright {
    font-weight: 500;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}
.footer-link {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-link:hover {
    color: #ff3b5c;
    text-decoration: underline;
}
@media (min-width: 768px) {
    .footer {
        padding: 15px 0;
    }
    
    .footer .container {
        flex-direction: row;
        justify-content: space-between;
        max-width: 800px;
    }
    
    .footer-links {
        margin-left: auto;
    }
}
.account-stats {
    font-size: 0.85rem;
    color: #6c757d;
}
.account-stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.account-bio {
    color: #6c757d;
    white-space: pre-line;
}
.follow-stats {
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 8px 0;
}
.follow-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}
.follow-stat-item .fw-bold {
    font-size: 1rem;
}
.tiktok-stat-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-right: 12px;
}
.stat-number {
    font-weight: 600;
    color: #333;
}
.stat-label {
    color: #6c757d;
    font-size: 0.85rem;
}
.user-bio {
    color: #212529;
    font-size: 0.9rem;
    white-space: pre-line;
    margin-top: 8px;
}
.video-count {
    font-size: 0.85rem;
    margin-top: 5px;
}
.username-container {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.username-container h5 {
    font-size: 1.25rem;
    margin-right: 5px;
}
.download-btn-container {
    margin-left: auto;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: flex-end;
}
.download-btn-container .btn {
    width: 100%;
    margin-bottom: 0;
}
/* Responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    .video-metadata {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 10px;
    }
    .author-info {
        margin-left: 0;
        margin-top: 15px;
        text-align: center;
        width: 100%;
    }
    .author-avatar {
        width: 140px;
        height: 140px;
        margin: 0 auto;
        display: block;
        border: 4px solid #f0f0f0;
    }
    #user-stats {
        justify-content: center;
        margin: 10px auto;
        gap: 15px;
    }
    .username-container {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    .username-container h5 {
        margin-right: 0;
        margin-bottom: 5px;
    }
    .download-btn-container {
        margin: 15px auto 0;
        width: 100%;
        max-width: 300px;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        align-items: center;
    }
    .download-btn-container .btn {
        flex: 1;
        width: auto;
        min-width: 45%;
    }
    .video-preview {
        max-width: 100%;
        width: 80%;
    }
    .play-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    .btn {
        padding: 8px 16px;
        font-size: 0.95rem;
    }
    .desktop-only {
        display: none !important;
    }
    .tiktok-stat-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-right: 0;
        min-width: 60px;
    }
    .stat-number {
        font-size: 1rem;
    }
    .video-info p {
        display: flex;
        justify-content: center;
        text-align: center;
        width: 100%;
        margin: 15px auto;
        padding: 0 5px;
        white-space: normal;
    }
    
    /* Đảm bảo div bọc ngoài cũng sử dụng flexbox */
    .text-center.w-100 {
        display: flex;
        justify-content: center;
    }
    
    /* CSS đặc biệt cho mô tả người dùng trên thiết bị di động */
    .user-description {
        text-align: center !important;
        justify-content: center !important;
        width: 100% !important;
        margin: 0 auto !important;
        display: inline-block !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    }
}
@media (min-width: 769px) {
    .desktop-only {
        display: inline-flex !important;
    }
}
@media (max-width: 480px) {
    .logo {
        font-size: 1.7rem;
    }
    .card-header {
        font-size: 1.1rem;
        padding: 10px;
    }
    .author-avatar {
        width: 100px;
        height: 100px;
        margin: 0 auto;
        display: block;
        border-width: 3px;
    }
    .video-preview {
        width: 100%;
        margin: 10px auto;
    }
    .play-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    .video-stats {
        gap: 10px;
        justify-content: space-around;
    }
    .stat-item {
        font-size: 0.9rem;
    }
    .username-container h5 {
        font-size: 1.1rem;
    }
    .tiktok-stat-item {
        min-width: 50px;
    }
    .stat-number {
        font-size: 0.9rem;
    }
    .stat-label {
        font-size: 0.75rem;
    }
    .carousel-container button.carousel-control-prev,
    .carousel-container button.carousel-control-next {
        width: 40px;
        height: 40px;
    }
    
    .carousel-container .carousel-control-prev-icon,
    .carousel-container .carousel-control-next-icon {
        width: 20px;
        height: 20px;
    }
    
    #imageCarousel .carousel-indicators {
        margin-bottom: 15px;
    }
    
    #imageCarousel .carousel-indicators button {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
}
.btn-danger {
    background-color: #ff3b5c;
    border-color: #ff3b5c;
    color: white;
    transition: all 0.3s ease;
}
.btn-danger:hover {
    background-color: #e6344f;
    border-color: #e6344f;
    transform: scale(1.05);
}
.btn-danger i {
    font-size: 1rem;
}
/* Hiệu ứng nút */
.btn {
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}
/* CSS cho carousel ảnh */
#imageCarousel {
    max-width: 100%;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
    isolation: isolate; /* Tạo stacking context mới để giới hạn z-index */
    touch-action: pan-y; /* Cải thiện cử chỉ vuốt trên thiết bị di động */
}
/* Ngăn chặn hiển thị nút bên ngoài carousel */
.carousel-container {
    position: relative;
    max-width: 100%;
    width: 100%;
    margin: 15px auto;
    border-radius: 10px;
    overflow: hidden;
    z-index: 1; /* Tạo stacking context mới */
    background-color: #000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    height: auto; /* Chiều cao sẽ theo chiều cao của carousel-inner */
}
/* Đảm bảo các nút chỉ hiển thị trong container */
.carousel-container button.carousel-control-prev,
.carousel-container button.carousel-control-next {
    position: absolute;
    z-index: 10; /* Tăng z-index để đảm bảo nút luôn ở trên cùng */
    opacity: 0.7;
    background-color: rgba(0,0,0,0.3);
    border: none;
    width: 50px; /* Tăng kích thước */
    height: 50px; /* Tăng kích thước */
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer; /* Đảm bảo con trỏ hiển thị là pointer */
    padding: 0;
    margin: 0;
    outline: none;
    border: none;
    touch-action: manipulation; /* Cải thiện tương tác trên thiết bị cảm ứng */
}
.carousel-container button.carousel-control-prev {
    left: 15px;
}
.carousel-container button.carousel-control-next {
    right: 15px;
}
.carousel-container button.carousel-control-prev:hover,
.carousel-container button.carousel-control-next:hover {
    background-color: rgba(0,0,0,0.5);
    opacity: 0.9;
}
.carousel-container button.carousel-control-prev:active,
.carousel-container button.carousel-control-next:active {
    background-color: rgba(0,0,0,0.7);
}
.carousel-container .carousel-control-prev-icon,
.carousel-container .carousel-control-next-icon {
    width: 25px; /* Tăng kích thước icon */
    height: 25px; /* Tăng kích thước icon */
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}
/* Đảm bảo indicators chỉ hiển thị trong container */
.carousel-container .carousel-indicators {
    margin-bottom: 20px;
    z-index: 2;
}
#imageCarousel .carousel-inner {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: calc(100vw * 16/9); /* Tỷ lệ 9:16 dựa vào chiều rộng của carousel */
    max-height: 80vh; /* Giới hạn chiều cao tối đa là 80% chiều cao của viewport */
    min-height: 600px; /* Chiều cao tối thiểu */
    border-radius: 10px;
}
#imageCarousel .carousel-item {
    text-align: center;
    height: 100%; /* Chiều cao theo container cha */
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .6s ease-in-out;
    opacity: 1; /* Thay đổi: không còn hiệu ứng mờ dần */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: translateX(100%); /* Bắt đầu ở ngoài màn hình bên phải */
    visibility: hidden; /* Ẩn các slide không active */
}
#imageCarousel .carousel-item.active {
    visibility: visible;
    transform: translateX(0); /* Hiển thị chính giữa */
    position: relative;
    z-index: 5;
}
#imageCarousel .carousel-item img {
    width: auto; 
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}
#imageCarousel .carousel-item.carousel-item-prev,
#imageCarousel .carousel-item.carousel-item-start {
    transform: translateX(-100%); /* Slide đã hiển thị trước đó chuyển ra bên trái */
    visibility: visible;
}
#imageCarousel .carousel-item.carousel-item-next,
#imageCarousel .carousel-item.carousel-item-end {
    transform: translateX(0); /* Slide mới đi vào từ bên phải */
    visibility: visible;
}
/* Sửa lỗi carousel chỉ hiển thị ảnh cuối cùng */
.carousel-inner .carousel-item {
    display: block; /* Thay đổi từ none sang block */
    visibility: hidden; /* Kiểm soát hiển thị bằng visibility thay vì display */
}
.carousel-inner .carousel-item.active,
.carousel-inner .carousel-item.carousel-item-start,
.carousel-inner .carousel-item.carousel-item-end,
.carousel-inner .carousel-item.carousel-item-next,
.carousel-inner .carousel-item.carousel-item-prev {
    visibility: visible;
}
/* Thay đổi hiệu ứng từ fade sang slide */
@-webkit-keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
@-webkit-keyframes slideOut {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}
@keyframes slideOut {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}
/* Thay thế animation cũ */
.carousel-item.active {
    -webkit-animation: none; /* Gỡ bỏ animation fade */
    animation: none; /* Gỡ bỏ animation fade */
}
/* Đảm bảo transition mượt mà */
#imageCarousel .carousel-inner {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: calc(100vw * 16/9); /* Tỷ lệ 9:16 dựa vào chiều rộng của carousel */
    max-height: 80vh; /* Giới hạn chiều cao tối đa là 80% chiều cao của viewport */
    min-height: 600px; /* Chiều cao tối thiểu */
    border-radius: 10px;
}
/* Cải thiện hiệu ứng trên thiết bị di động */
@media (max-width: 768px) {
    #imageCarousel .carousel-inner {
        height: calc(100vw * 16/9); /* Tỷ lệ 9:16 */
        min-height: 500px; /* Chiều cao tối thiểu cho màn hình trung bình */
    }
}
@media (max-width: 480px) {
    #imageCarousel .carousel-inner {
        height: calc(100vw * 16/9); /* Tỷ lệ 9:16 */
        min-height: 400px; /* Chiều cao tối thiểu cho màn hình nhỏ */
    }
}
/* Đảm bảo nút hiển thị đúng kích thước và vị trí */
#imageCarousel .carousel-control-prev-icon,
#imageCarousel .carousel-control-next-icon {
    width: 25px;
    height: 25px;
    background-size: 100%;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}
/* Đặt vị trí và kiểu hiển thị cho indicators */
#imageCarousel .carousel-indicators {
    margin-bottom: 20px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 15;
    display: flex;
    justify-content: center;
    padding: 0;
    margin-right: 15%;
    margin-left: 15%;
    list-style: none;
}
/* Kiểu dáng cho từng indicator */
#imageCarousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.6);
    margin: 0 6px;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease, transform 0.3s ease;
}
#imageCarousel .carousel-indicators button.active {
    background-color: #ff0050;
    transform: scale(1.2);
}
/* CSS cho nút tải ảnh đơn lẻ */
.image-buttons-container {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    width: 100%;
}
.download-single-image {
    min-width: 36px;
    height: 36px;
    padding: 5px 6px;
    border-radius: 5px;
    font-size: 0.8rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.download-single-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 5px rgba(0,0,0,0.1);
}
.download-single-image i {
    margin-right: 3px;
    font-size: 0.75rem;
}
@media (max-width: 768px) {
    .image-buttons-container {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 480px) {
    .download-single-image {
        min-width: 32px;
        height: 32px;
        padding: 4px 4px;
        font-size: 0.7rem;
    }
    .download-single-image i {
        margin-right: 2px;
        font-size: 0.7rem;
    }
    .image-buttons-container {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }
}
.input-group .btn-action {
    width: auto;
    padding: 0.375rem 0.75rem;
    position: relative;
}
/* Điều chỉnh vị trí cho cả hai nút nằm ở cùng vị trí */
.input-group .btn-container {
    position: relative;
}
/* Thêm style cho phần giới thiệu */
.guide-steps ol {
    padding-left: 1.5rem;
}
.guide-steps li {
    margin-bottom: 0.5rem;
}
.feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}
.feature-item i {
    margin-right: 10px;
    font-size: 1.2rem;
    margin-top: 3px;
}
.accordion-button:not(.collapsed) {
    background-color: rgba(255, 0, 80, 0.1);
    color: #ff0050;
}
.accordion-button:focus {
    border-color: #ff0050;
    box-shadow: 0 0 0 0.25rem rgba(255, 0, 80, 0.25);
}
/* Language Selector */
.language-selector {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
}
.language-selector .dropdown-menu {
    min-width: 100px;
}
.language-selector .dropdown-item {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.language-selector .dropdown-item img {
    width: 20px;
    margin-right: 8px;
}
.language-selector .btn {
    display: flex;
    align-items: center;
    gap: 5px;
}
.language-selector .current-lang img {
    width: 20px;
}
/* CSS mới cho input-group để đảm bảo viền đẹp hơn */
.input-group {
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.input-group .form-control {
    border-right: none;
    box-shadow: none;
}
.input-group .form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 0, 80, 0.25);
    z-index: 3;
}
.input-group .btn-container {
    display: flex;
    margin-left: -1px;
}
.input-group .btn-container .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}
.input-group .btn-container .btn-primary {
    border-left: 1px solid rgba(0,0,0,0.1);
}
.input-group .btn-container .btn-danger {
    border-left: 1px solid rgba(0,0,0,0.1);
}
/* Đảm bảo nút không bị tách ra khỏi input */
.input-group .btn-container .btn:hover {
    transform: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 2;
}
/* Điều chỉnh để các viền được hiển thị đúng khi focus */
.input-group:focus-within {
    box-shadow: 0 0 0 0.25rem rgba(255, 0, 80, 0.15);
}
/* Thêm hiệu ứng nhẹ khi hover */
.input-group:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}
/* Sticky Header */
.sticky-header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
}
.sticky-header .container {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 100%;
    display: flex;
    align-items: center;
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0;
}
.site-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fe2c55;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}
.site-logo {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    background-image: url('../img/tiktok-icon-2.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: block;
    flex-shrink: 0;
    position: relative;
}
.site-title a {
    color: #fe2c55;
    text-decoration: none;
    transition: color 0.3s ease;
}
/* Chỉnh sửa language selector trong header */
.sticky-header .language-selector {
    position: static;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    height: 100%;
}
.sticky-header .dropdown-toggle {
    padding: 5px 10px;
    font-size: 0.9rem;
    margin: 0;
    height: auto;
    display: flex;
    align-items: center;
}
/* Đảm bảo không gian cho nội dung chính */
.main-content {
    padding-top: 20px;
}
/* Responsive styling */
@media (max-width: 576px) {
    .site-title {
        font-size: 1.2rem;
    }
    .sticky-header .dropdown-toggle {
        padding: 3px 8px;
        font-size: 0.8rem;
    }
    .current-lang img {
        width: 20px;
    }
    .header-content {
        gap: 15px;
    }
}
/* CSS để xử lý hiệu ứng ẩn/hiện nội dung khi chuyển đổi ngôn ngữ */
html.i18n-loading .i18n-content {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease-in-out, visibility 0s 0.3s;
}

html:not(.i18n-loading) .i18n-content {
    opacity: 1 !important;
    visibility: visible !important;
    transition: opacity 0.3s ease-in-out;
}

/* Ẩn hoàn toàn nội dung khi đang tải */
html.i18n-loading body {
    visibility: hidden !important;
}

html.i18n-loading .sticky-header {
    visibility: visible !important;
}

html.i18n-loading .language-selector {
    visibility: visible !important;
}

html.i18n-loading .site-title {
    visibility: visible !important;
}

/* Đảm bảo các biểu tượng vẫn hiển thị đúng */
html.i18n-loading .i18n-content i.fas,
html.i18n-loading .i18n-content i.fab,
html.i18n-loading .i18n-content i.far,
[data-i18n] i.fas,
[data-i18n] i.fab,
[data-i18n] i.far {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

/* Đảm bảo các biểu tượng trong phần step6 luôn hiển thị */
[data-i18n="step6"] i.fas {
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Đảm bảo nút ngôn ngữ hiển thị ngay lập tức và không bị nháy */
.language-selector {
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
}

.language-selector * {
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
}

/* Đảm bảo header luôn hiển thị */
.sticky-header {
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
}

/* Đảm bảo nút ngôn ngữ hiển thị đúng trong quá trình tải */
.current-lang {
    display: flex !important;
    align-items: center !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.current-lang img {
    display: inline-block !important;
    margin-right: 5px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Đảm bảo dropdown button hiển thị đúng */
#languageDropdown {
    display: flex !important;
    align-items: center !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Đảm bảo chuyển đổi mượt mà khi trang đã tải xong */
body {
    transition: visibility 0s, opacity 0.3s ease-in-out;
}

/* CSS cho hiệu ứng loading toàn trang */
.page-loader-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 99999 !important;
    transition: opacity 0.5s ease-in-out, visibility 0.5s !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.page-loader-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.page-loader {
    width: 70px !important;
    height: 70px !important;
    border: 5px solid rgba(255, 0, 80, 0.1) !important;
    border-top: 5px solid #ff0050 !important;
    border-radius: 50% !important;
    animation: spin 1.2s linear infinite !important;
}

.page-loader-logo {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #ff0050;
    animation: pulse 1.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-loader-logo i {
    color: #25F4EE;
    margin-right: 5px;
}

.page-loader-text {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Ẩn nội dung khi đang tải */
body.loading {
    overflow: hidden;
}

body.loading .main-content,
body.loading .sticky-header {
    visibility: hidden;
}

/* Đảm bảo tất cả các biểu tượng được ẩn đi trong quá trình tải */
html.i18n-loading .i18n-content i,
html.i18n-loading .i18n-content .fab,
html.i18n-loading .i18n-content .fas,
html.i18n-loading .i18n-content .far,
html.i18n-loading .i18n-content .fa {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Chỉ cho phép các biểu tượng trong header hiển thị */
html.i18n-loading .sticky-header i,
html.i18n-loading .sticky-header .fab,
html.i18n-loading .sticky-header .fas,
html.i18n-loading .sticky-header .far,
html.i18n-loading .sticky-header .fa,
html.i18n-loading .page-loader-logo i {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Đảm bảo các biểu tượng trong page loader hiển thị đúng */
.page-loader-logo i {
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-block !important;
}

/* Cải thiện hiệu ứng loading */
body.loading {
    overflow: hidden !important;
}

/* Đảm bảo không có phần tử nào hiển thị trong quá trình tải ngoại trừ page loader */
body.loading .main-content,
body.loading .sticky-header,
body.loading footer {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Chỉ hiển thị page loader khi đang tải */
body.loading .page-loader-container {
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
}

/* Đảm bảo nội dung không hiển thị trong quá trình loading */
body.loading .main-content,
body.loading .sticky-header,
body.loading footer {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Đảm bảo các biểu tượng trong loader hiển thị đúng */
.page-loader-logo i,
.page-loader-logo .fab,
.page-loader-logo .fas {
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-block !important;
}

/* Đảm bảo hiệu ứng loading hiển thị rõ ràng */
.loader-wrapper {
    position: relative !important;
    width: 100px !important;
    height: 100px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.inner-loader {
    position: absolute !important;
    width: 40px !important;
    height: 40px !important;
    border: 4px solid rgba(37, 244, 238, 0.1) !important;
    border-bottom: 4px solid #25F4EE !important;
    border-radius: 50% !important;
    animation: spin-reverse 0.8s linear infinite !important;
}

.loading-dots {
    position: absolute !important;
    bottom: -30px !important;
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
}

.loading-dot {
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background-color: #ff0050 !important;
    animation: dot-pulse 1.5s ease-in-out infinite !important;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s !important;
    background-color: #ff3b5c !important;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s !important;
    background-color: #25F4EE !important;
}

/* Đảm bảo hiệu ứng animation luôn chạy */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin-reverse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes dot-pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

/* Đảm bảo không có transition khi trang đang tải */
body.loading * {
    transition: none !important;
}

/* Đảm bảo header hiển thị đúng trong quá trình tải */
body.loading .sticky-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    visibility: visible !important;
    display: flex !important;
    opacity: 1 !important;
    transition: none !important;
    background-color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Đảm bảo header không bị nhấp nháy khi trang tải xong */
.sticky-header {
    transition: none;
}

/* Đảm bảo nội dung hiển thị mượt mà */
.main-content {
    transition: opacity 0.3s ease-in-out;
}

/* Đảm bảo loader luôn hiển thị trên cùng */
.page-loader-container,
.temp-page-loader-container {
    z-index: 9999999 !important;
}

/* Add responsive styles for the logo */
@media (max-width: 768px) {
    .site-logo {
        width: 28px;
        height: 28px;
        margin-right: 8px;
        background-image: url('../img/tiktok-icon-2.svg');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }
}

@media (max-width: 480px) {
    .site-logo {
        width: 24px;
        height: 24px;
        margin-right: 6px;
        background-image: url('../img/tiktok-icon-2.svg');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }
}

/* Dark mode styles cho footer */
html.dark-mode .footer {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-top-color: #444;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.2);
}

html.dark-mode .footer-link {
    color: #aaa;
}

html.dark-mode .footer-link:hover {
    color: #ff0050;
}

/* Dark mode cho thông tin video */
html.dark-mode .stat-number {
    color: #e0e0e0;
}

html.dark-mode .stat-label {
    color: #aaa;
}

html.dark-mode .user-bio {
    color: #e0e0e0;
}

html.dark-mode .video-count {
    color: #aaa;
}

html.dark-mode .username-container h5 {
    color: #e0e0e0;
}

html.dark-mode .tiktok-stat-item {
    color: #aaa;
}

html.dark-mode .account-stats {
    color: #aaa;
}

html.dark-mode .account-bio {
    color: #aaa;
}

html.dark-mode .follow-stats {
    border-top-color: #444;
    border-bottom-color: #444;
    color: #e0e0e0;
}

html.dark-mode .author-info {
    color: #e0e0e0;
}

/* Dark mode cho thông tin video - cập nhật thêm */
html.dark-mode .text-muted {
    color: #aaa !important;
}

html.dark-mode .music-info {
    color: #e0e0e0;
}

html.dark-mode .music-title {
    color: #ff6b95;
}

html.dark-mode .music-label {
    color: #aaa;
}

html.dark-mode .video-stats .stat-item {
    color: #aaa;
}

html.dark-mode .video-stats .stat-item i.fa-heart {
    color: #ff3b5c !important;
}

html.dark-mode .video-stats .stat-item i.fa-comment {
    color: #25F4EE !important;
}

html.dark-mode .video-stats .stat-item i.fa-share {
    color: #4CAF50 !important;
}

html.dark-mode .video-stats .stat-item i.fa-play {
    color: #2196F3 !important;
}

html.dark-mode .video-count i {
    color: #25F4EE !important;
} 