/* Dark mode styles */
:root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --card-bg: #2d2d2d;
    --border-color: #404040;
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.app-container {
    padding: 20px 0;
    background-color: var(--bg-color);
}

.app-container .app-header,
.app-container .app-header .app-header__form {
    display: flex;
    align-items: center;
}

.app-container .app-header .app-header__wrapper {
    flex: 1;
}

.app-container .app-header .app-header__form {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

.app-container .app-header .app-header__form .app-header__form-item {
    margin: 0;
    display: flex;
    align-items: center;
}

.app-container .app-header .app-header__form .app-header__form-item input {
    min-width: 180px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin: 0;
}

.app-container .app-header .app-header__form .app-header__form-item button {
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin: 0;
}

.app-error-msg {
    text-align: right;
    margin-top: -15px;
    margin-bottom: 10px;
    color:red;
}

#msg-area {
    height: 15px;
}

.app-wrap-desc {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 250px;
    white-space: pre-wrap;
    white-space: -moz-pre-wrap;
    white-space: -pre-wrap;
    white-space: -o-pre-wrap;
    word-wrap: break-word;
    color: var(--text-color);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}
.app-title {
    margin-bottom: 5px;
    font-weight: 600;
}

.app-header {
    width: 100%;
    margin: auto;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.app-header h1 {
    color: var(--text-color);
}

.form-control {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

.form-control:focus {
    background-color: var(--card-bg);
    color: var(--text-color);
}

.btn-light {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-light:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    background-color: var(--card-bg);
    border-radius: 15px 15px 0 0;
}

.modal-header .modal-title {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.3rem;
}

.modal-body {
    padding: 15px 20px;
}

.modal-body .form-label {
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: 10px;
}

.modal-body .form-control {
    padding: 12px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.modal-body .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.modal-body .btn-share {
    background-color: #FF0000;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 15px;
}

.modal-body .btn-share:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
}

.modal-body .btn-share:active {
    transform: translateY(0);
}

.modal-body .btn-share .spinner-border {
    margin-right: 8px;
}

.btn-close {
    color: var(--text-color);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* Prevent scrollbar shift */
html {
    scrollbar-gutter: stable;
}

/* Modal styles */
.modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    outline: 0;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 0.5;
}

.modal.fade .modal-dialog {
    transform: scale(0.8);
    transition: transform 0.3s ease-in-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Remove Bootstrap's default padding-right */
body.modal-open {
    padding-right: 0 !important;
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background-color: var(--border-color);
}

.theme-toggle i {
    color: var(--text-color);
    font-size: 1.2rem;
}

/* Like and Dislike buttons styling */
.vote-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
}

.vote-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.vote-button:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

.vote-button i {
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.vote-button:hover i {
    transform: scale(1.1);
}

.vote-count {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Delete button styling */
.delete-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    background-color: var(--card-bg);
    border: 1px solid #dc3545;
    color: #dc3545;
    transition: all 0.2s ease;
    cursor: pointer;
}

.delete-button:hover {
    background-color: #dc3545;
    color: white;
    transform: translateY(-2px);
}

.delete-button i {
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.delete-button:hover i {
    transform: scale(1.1);
}

/* Update the template styles */
.vote-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 10px 0;
}

/* Responsive styles */
@media (max-width: 768px) {
    .app-container {
        padding: 0;
    }

    .app-header {
        flex-direction: column;
        gap: 15px;
    }

    .app-header__wrapper {
        width: 100%;
    }

    .app-header__form {
        flex-direction: column;
        width: 100%;
        gap: 10px;
        margin-bottom: 20px;
    }

    .app-header__form .app-header__form-item {
        width: 100%;
        margin: 0;
    }

    .app-header__form .app-header__form-item input,
    .app-header__form .app-header__form-item button {
        width: 100%;
        margin: 0;
    }

    .app-header h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    /* Video list responsive */
    .row {
        margin: 0;
    }

    .col-6 {
        width: 100%;
        padding: 0;
    }

    /* Make video container full width */
    .video-item {
        padding: 0;
        margin: 0;
        border-radius: 0;
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        background-color: var(--bg-color);
    }

    .ratio-16x9 {
        position: relative;
        width: 100%;
        padding-top: 150%; /* 9:16 Aspect Ratio for Reel */
        background-color: #000;
        border-radius: 12px 12px 0 0;
        overflow: hidden;
    }

    .ratio-16x9 iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: none;
        background-color: #000;
        object-fit: scale-down;
    }

    .ratio-16x9 img {
        object-fit: scale-down;
    }

    .ratio-16x9 iframe[src*="drive.google.com"] {
        transform: scale(1);
        transform-origin: center center;
    }

    /* Prevent preview image scaling */
    .ratio-16x9 iframe[src*="drive.google.com"]:not([src*="preview"]) {
        transform: none;
    }

    /* Adjust content after video */
    .video-item > .col-6:last-child {
        padding: 15px;
        max-width: 100%;
    }

    /* Remove padding from container */
    .app-container {
        padding: 0;
    }

    /* Add margin between video items */
    .video-item + .video-item {
        margin-top: 15px;
    }

    /* Adjust vote buttons for mobile */
    .vote-container {
        justify-content: center;
        margin: 15px 0;
    }

    .vote-button {
        padding: 8px 15px;
    }

    /* Adjust description for mobile */
    .app-wrap-desc {
        max-height: 150px;
        font-size: 0.9rem;
    }

    /* Adjust modal for mobile */
    .modal-dialog {
        margin: 10px;
    }

    .modal-body {
        padding: 15px;
    }

    /* Adjust theme toggle button for mobile */
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }

    /* Adjust form controls for mobile */
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Make buttons more touch-friendly */
    .btn {
        padding: 10px 15px;
        font-size: 1rem;
    }

    /* Adjust spacing for mobile */
    .app-title {
        margin-top: 15px;
    }

    /* Make shared by text more readable on mobile */
    .app-header__form-item div {
        font-size: 0.9rem;
    }

    #messageInfo {
        min-width: unset;
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
        font-size: 1.1rem;
    }

    #loginBtn, #shareBtn {
        min-width: unset;
        width: 100%;
    }

    .app-header__form-item input {
        min-width: unset;
        width: 100%;
    }
}

/* Additional styles for very small screens */
@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.3rem;
    }

    .vote-button {
        padding: 6px 12px;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-body {
        padding: 12px;
    }

    .app-header__form-item input {
        font-size: 16px;
    }

    .app-header__form-item button {
        font-size: 1rem;
        padding: 10px;
    }

    #messageInfo {
        font-size: 1rem;
    }
}

/* Fix for landscape orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-dialog {
        margin: 5px auto;
    }

    .app-wrap-desc {
        max-height: 100px;
    }
}

/* Tab styling */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 12px 20px;
    transition: all 0.3s ease;
    position: relative;
    margin-right: 5px;
}

.nav-tabs .nav-link:hover {
    color: #007bff;
    border: none;
    background-color: rgba(0, 123, 255, 0.05);
}

.nav-tabs .nav-link.active {
    color: #007bff;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid #007bff;
}

.nav-tabs .nav-link.active:hover {
    border-bottom: 3px solid #007bff;
}

/* Tab content styling */
.tab-content {
    padding: 20px 0;
}

.tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark theme support */
[data-theme="dark"] .nav-tabs {
    border-bottom-color: #495057;
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: #adb5bd;
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    color: #4dabf7;
    background-color: rgba(77, 171, 247, 0.1);
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    color: #4dabf7;
    border-bottom-color: #4dabf7;
}

/* Video item styling */
.video-item {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.video-item .col-6 {
    padding-left: 0;
    padding-right: 0;
}

.desc-video {
    padding-left: 5px!important;
}

.video-item:hover {
    transform: translateY(-2px);
}

.video-title {
    color: var(--text-color);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.4;
}

.video-meta {
    margin-bottom: 15px;
}

.video-shared-by {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-label {
    color: var(--text-color);
    opacity: 0.7;
    font-weight: 500;
}

.meta-value {
    color: var(--text-color);
    font-weight: 600;
}

.video-actions {
    margin-bottom: 20px;
}

/* Video Description Container */
.video-description-container {
    background-color: var(--bg-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-top: 8px;
}

.description-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 4px;
    border-bottom: 1px solid var(--border-color);
}

.description-label {
    color: var(--text-color);
    font-weight: 600;
    margin: 0;
    font-size: 0.85rem;
}

.description-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 3px;
    transition: transform 0.3s ease;
}

.description-toggle.active {
    transform: rotate(180deg);
}

.video-description {
    padding: 8px 10px;
}

.description-content {
    color: var(--text-color);
    line-height: 1.3;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 80px;
    overflow-y: auto;
    padding-right: 6px;
    font-size: 0.8rem;
}

/* Mobile styles */
@media (max-width: 768px) {
    .video-description {
        display: none;
        padding: 6px 10px;
    }

    .video-description.show {
        display: block;
    }

    .description-content {
        max-height: 70px;
        font-size: 0.75rem;
    }

    .desc-video {
        padding-left: 15px;
    }
}

#messageInfo {
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.9;
    margin-right: 8px;
    min-width: 200px;
}
#loginBtn, #shareBtn {
    min-width: 140px;
}
/* #logoutBtn {
    min-width: 180px;
} */

/* Profile Modal Styles */
.profile-section {
    padding: 15px 0;
}

.section-title {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.mfa-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.status-label {
    color: var(--text-color);
    opacity: 0.8;
}

.status-value {
    color: var(--text-color);
    font-weight: 500;
}

.status-value.enabled {
    color: #28a745;
}

.mfa-setup-section {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mfa-setup-section.active {
    display: block;
}

.qr-code-container {
    text-align: center;
    margin-bottom: 20px;
}

.qr-code {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qr-instructions {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9rem;
    margin: 0;
}

.verification-form {
    max-width: 300px;
    margin: 0 auto;
    text-align: center;
}

.verification-form .form-group {
    margin-bottom: 15px;
}

.verification-form label {
    color: var(--text-color);
    margin-bottom: 8px;
    display: block;
}

.verification-form input {
    text-align: center;
    letter-spacing: 4px;
    font-size: 1.2rem;
    font-weight: 500;
}

#setupMfaBtn {
    width: 100%;
    padding: 10px;
    font-weight: 500;
    color: #FF0000;
    border-color: #FF0000;
}

#setupMfaBtn:hover {
    background-color: #FF0000;
    color: white;
}

#verifyMfaBtn {
    width: 100%;
    padding: 10px;
    font-weight: 500;
    background-color: #FF0000;
    border-color: #FF0000;
}

#verifyMfaBtn:hover {
    background-color: #cc0000;
    border-color: #cc0000;
}

#verifyLoginMfaBtn {
    background-color: #FF0000;
    border-color: #FF0000;
    width: 100%;
    padding: 10px;
    font-weight: 500;
    margin-top: 15px;
}

#verifyLoginMfaBtn:hover {
    background-color: #cc0000;
    border-color: #cc0000;
    transform: translateY(-1px);
}

#verifyLoginMfaBtn .spinner-border {
    margin-right: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .qr-code {
        width: 180px;
        height: 180px;
    }

    .verification-form {
        max-width: 100%;
    }
}

.mfa-disable-section {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mfa-disable-section.active {
    display: block;
}

#disableMfaBtn {
    width: 100%;
    padding: 10px;
    font-weight: 500;
    background-color: #dc3545;
    border-color: #dc3545;
}

#disableMfaBtn:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mfa-disable-section {
        padding: 15px;
    }
}

/* Profile button container */
.profile-button-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logout-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #dc3545;
    border: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logout-button i {
    color: white;
    font-size: 1.2rem;
    line-height: 1;
}

.logout-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .logout-button {
    background-color: #dc3545;
}

[data-theme="dark"] .logout-button i {
    color: white;
}

/* Responsive adjustments for profile and logout buttons */
@media (max-width: 768px) {
    .profile-button-container {
        top: 55px;
        right: 15px;
        gap: 8px;
    }

    .profile-button,
    .logout-button {
        width: 35px;
        height: 35px;
        min-width: 35px;
        min-height: 35px;
    }

    .profile-button i,
    .logout-button i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .profile-button-container {
        top: 50px;
        right: 10px;
        gap: 6px;
    }

    .profile-button,
    .logout-button {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }

    .profile-button i,
    .logout-button i {
        font-size: 1rem;
    }
}

/* User Details Section */
.user-details-section {
    margin-bottom: 25px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.user-info {
    margin-top: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.info-label {
    min-width: 120px;
    color: var(--text-color);
    opacity: 0.7;
    font-weight: 500;
}

.info-value {
    color: var(--text-color);
    font-weight: 600;
    flex: 1;
}

.section-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 25px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .user-details-section {
        padding: 15px;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .info-label {
        min-width: unset;
    }
}

/* Modal header actions */
.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header-actions .logout-button {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #dc3545;
    border: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.modal-header-actions .logout-button i {
    color: white;
    font-size: 0.8rem;
    line-height: 1;
}

.modal-header-actions .logout-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .modal-header-actions .logout-button {
    background-color: #dc3545;
}

[data-theme="dark"] .modal-header-actions .logout-button i {
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-header-actions .logout-button {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
    }

    .modal-header-actions .logout-button i {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .modal-header-actions {
        gap: 8px;
    }
    
    .modal-header-actions .logout-button {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
    }

    .modal-header-actions .logout-button i {
        font-size: 0.7rem;
    }
}

#shareBtn {
    background-color: #FF0000 !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease;
}

#shareBtn:hover {
    background-color: #cc0000 !important;
    transform: translateY(-1px);
}

#loginBtn {
    background-color: #FF0000 !important;
    color: white !important;
    border: none !important;
    min-width: 190px;
    transition: all 0.3s ease;
}

#loginBtn:hover {
    background-color: #cc0000 !important;
    transform: translateY(-1px);
}

#loginBtn .spinner-border {
    color: white;
}

.profile-button i {
    font-size: 1.2rem;
    color: #FF0000;
}

.profile-button:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.profile-button:hover i {
    color: #FF0000;
}

/* Profile Modal Tabs */
.profile-section .nav-tabs {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.profile-section .nav-tabs .nav-item {
    margin-bottom: -2px;
}

.profile-section .nav-tabs .nav-link {
    border: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 12px 20px;
    transition: all 0.3s ease;
    position: relative;
    margin-right: 5px;
}

.profile-section .nav-tabs .nav-link:hover {
    color: #FF0000;
    border: none;
    background-color: rgba(255, 0, 0, 0.05);
}

.profile-section .nav-tabs .nav-link.active {
    color: #FF0000;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid #FF0000;
}

.profile-section .nav-tabs .nav-link.active:hover {
    border-bottom: 3px solid #FF0000;
}

.profile-section .tab-content {
    padding: 20px 0;
}

.profile-section .tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User Info Tab */
.user-details-section {
    margin-bottom: 0;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* MFA Setup Tab */
.mfa-status {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mfa-setup-section,
.mfa-disable-section {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Profile Message */
.profile-message {
    margin: 0 0 8px 0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    text-align: center;
    font-weight: 500;
}

.profile-message.success {
    background-color: rgba(40, 167, 69, 0.1);
    border: 1px solid #28a745;
    color: #28a745;
}

.profile-message.error {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    color: #dc3545;
}

[data-theme="dark"] .profile-message.success {
    background-color: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
    color: #28a745;
}

[data-theme="dark"] .profile-message.error {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
    color: #dc3545;
}

/* Add margin to tabs when message is shown */
.profile-message:not(:empty) + .nav-tabs {
    margin-top: 8px;
}

.app-container hr {
    margin: 2px;
    border-color: var(--border-color);
}

.error-msg {
    color: red;
}
.success-msg {
    color: green;
}

.shorts-container {
    height: 100vh; /* full screen */
    display: flex;
    justify-content: center;
    align-items: center;
    background: black;
    overflow: hidden;
}

.shorts-video {
    width: 100%;
    max-width: 400px; /* limit width */
    aspect-ratio: 9 / 16;
    position: relative;
}

.shorts-video iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
}

.video-swipe-container {
    position: relative;
    width: 100%;
    height: 90vh;
    overflow: hidden;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-swipe-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    transition: transform 0.3s ease;
}

.video-swipe-item {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 9 / 16;
    position: relative;
    margin: 0 auto;
    max-height: 100%;
    height: auto;
    box-sizing: border-box;
}

.video-main {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.video-swipe-item video {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    background: black;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 1;
}

.video-swipe-item video.active {
    opacity: 1;
    z-index: 2;
}

.video-swipe-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 5;
}

.swipe-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.swipe-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Ensure video controls are always on top */
.video-swipe-item video {
    z-index: 1;
}

.video-swipe-item video::-webkit-media-controls {
    z-index: 1000 !important;
}

/* Mobile styles */
@media (max-width: 768px) {
    .video-swipe-container {
        height: calc(100vh - 60px);
    }

    .video-swipe-controls {
        bottom: 10px;
        background: rgba(0, 0, 0, 0.3);
        padding: 8px 16px;
        border-radius: 25px;
        backdrop-filter: blur(10px);
    }

    .swipe-button {
        padding: 8px 16px;
        font-size: 0.9rem;
        background: rgba(255, 255, 255, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .swipe-button:active {
        transform: scale(0.95);
        background: rgba(255, 255, 255, 0.4);
    }
}

/* Desktop styles - show swipe controls on desktop */
@media (min-width: 769px) {
    .video-swipe-controls {
        bottom: 20px;
        background: rgba(0, 0, 0, 0.4);
        padding: 8px 12px;
        border-radius: 25px;
        backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        gap: 8px;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .video-swipe-container:hover .video-swipe-controls {
        opacity: 1;
        visibility: visible;
    }
    
    .swipe-button {
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        padding: 8px;
        font-size: 0.9rem;
        transition: all 0.3s ease;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .swipe-button:hover {
        background: rgba(255, 255, 255, 0.4);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .desktop-nav-hint {
        background-color: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 8px 12px;
        margin: 10px 0;
        text-align: center;
        color: var(--text-color);
        opacity: 0.8;
        font-size: 0.9rem;
        transition: opacity 0.3s ease;
    }
    
    .desktop-nav-hint:hover {
        opacity: 1;
    }
    
    /* Add focus indicator for keyboard navigation */
    .video-swipe-item:focus-within {
        outline: none !important;
        outline-offset: 0 !important;
    }
}

.video-actions-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    z-index: 10;
}

.vote-action-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.video-actions-vertical .vote-button,
.video-actions-vertical .delete-button {
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin: 0;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.vote-count {
    display: block;
    text-align: center;
    font-size: 1rem;
    color: #fff;
    margin-top: 2px;
    font-weight: 500;
}

.video-actions-vertical .vote-button.up {
    color: #4caf50;
}
.video-actions-vertical .vote-button.down {
    color: #f44336;
}

.video-actions-vertical .vote-button:hover,
.video-actions-vertical .delete-button:hover {
    background: #fff;
    color: #FF0000;
}

/* Overlay on mobile, outside on desktop */
@media (max-width: 768px) {
    .video-actions-vertical {
        position: absolute;
        top: 50%;
        right: 2px;
        transform: translateY(-50%);
        gap: 12px;
    }
    .video-actions-vertical .vote-button,
    .video-actions-vertical .delete-button {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }
    .vote-count {
        font-size: 0.8rem;
    }
}
@media (min-width: 769px) {
    .video-swipe-item {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        position: relative;
    }
    .video-main {
        flex: 1 1 0;
        min-width: 0;
        position: relative;
        z-index: 1;
        height: 100%;
    }
    .video-actions-vertical {
        position: static;
        transform: none;
        margin-left: 18px;
        height: 100%;
        justify-content: center;
        z-index: 2;
    }
}

.action-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.action-count {
    display: block;
    text-align: center;
    font-size: 1rem;
    color: #fff;
    margin-top: 2px;
    font-weight: 500;
}

.video-actions-vertical .action-button {
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin: 0;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.video-actions-vertical .action-button.comment {
    color: #2196f3;
}

.video-actions-vertical .action-button.share {
    color: #ff9800;
}

.video-actions-vertical .action-button:hover {
    background: #fff;
    color: #FF0000;
}

@media (max-width: 768px) {
    .action-count {
        font-size: 0.8rem;
    }
    .video-actions-vertical .action-button {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }
}

/* Navigation feedback animation */
@keyframes navFeedback {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) scale(1);
    }
}

/* Custom video controls */
.video-overlay-controls {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 3;
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-swipe-item:hover .video-overlay-controls {
    opacity: 1;
}

.overlay-button {
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.2s ease;
}

.overlay-button:hover {
    background: rgba(0, 0, 0, 0.6);
}

.overlay-button:focus {
    outline: none !important;
    box-shadow: none !important;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white;
    font-size: 1.8rem;
    pointer-events: none; /* Make it non-interactive */
    /* animation: fadeIn 0.2s;*/
}

.video-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4; /* Higher than play icon */
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

@media (max-width: 768px) {
    .video-overlay-controls {
        opacity: 1; /* Always visible on mobile */
        top: 15px;
    }
}

/* Video Progress Bar */
.video-progress-container {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 15px;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 4;
}

.video-swipe-item:hover .video-progress-container {
    opacity: 1;
}

.video-progress-bar {
    width: 0%;
    height: 3px;
    background-color: #ff0000;
    pointer-events: none;
    transition: height 0.2s ease;
}

.video-progress-container:hover .video-progress-bar {
    height: 5px;
}

@media (max-width: 768px) {
    .video-progress-container {
        opacity: 1;
        height: 10px;
        bottom: 0;
    }
    .video-progress-bar {
        height: 2px;
    }
}

/* Video Info Overlay */
.video-info-overlay {
    position: absolute;
    top: 65px; /* just below the controls (40px button + 15px top + 10px gap) */
    left: 15px;
    right: 15px;
    z-index: 5;
    color: white;
    padding: 10px 10px 6px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
    pointer-events: all; /* Allow clicks on see more */
    border-radius: 0 0 5px 5px;
    margin-top: 5px;
}

.video-title-overlay {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 5px 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.video-description-overlay {
    font-size: 0.9rem;
    line-height: 1.4;
}

.video-description-text {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    white-space: pre-line; /* Hiển thị xuống dòng */
}

.video-description-overlay.expanded .video-description-text {
    -webkit-line-clamp: unset;
    max-height: 120px; /* Adjust as needed */
    overflow-y: auto;
    padding-right: 5px; /* For scrollbar */
}

.see-more-btn {
    background: none;
    border: none;
    color: #a0cff0;
    padding: 2px 0;
    margin-top: 4px;
    cursor: pointer;
    font-weight: 600;
}

.see-more-btn:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .video-info-overlay {
        top: 65px;
        left: 10px;
        right: 80px; /* Avoid vertical actions */
        padding: 8px 8px 4px 8px;
    }

    .video-title-overlay {
        font-size: 1rem;
    }
}

/* Mobile-only elements - hidden by default, shown on mobile */
.mobile-only {
    display: none;
}

/* Comment Panel Modal (YouTube Shorts style) */
.comment-panel-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: rgba(30, 30, 30, 0.9); /* desktop 0.9 */
    box-shadow: -2px 0 16px rgba(0,0,0,0.25);
    z-index: 2000;
    display: none;
    flex-direction: column;
    animation: slideInRight 0.3s;
}
.comment-panel-modal.active {
    display: flex;
}
@keyframes slideInRight {
    from { right: -420px; opacity: 0; }
    to { right: 0; opacity: 1; }
}
.comment-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}
.comment-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px 20px;
    border-bottom: 1px solid #444;
}
.comment-panel-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}
.comment-panel-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.comment-panel-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 20px;
    background: transparent;
}
.comment-item {
    margin-bottom: 18px;
}
.comment-author {
    font-weight: 600;
    color: #4dabf7;
    font-size: 0.97rem;
    margin-bottom: 2px;
}
.comment-text {
    color: #fff;
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
}
.comment-panel-input {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid #444;
    background: #232323;
}
.comment-panel-input input[type="text"] {
    flex: 1 1 auto;
    border: none;
    border-radius: 18px;
    padding: 10px 14px;
    font-size: 1rem;
    margin-right: 10px;
    background: #333;
    color: #fff;
    outline: none;
}
.comment-panel-input button {
    background: #FF0000;
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.comment-panel-input button:hover {
    background: #cc0000;
}
@media (max-width: 600px) {
    .comment-panel-modal {
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
        background: rgba(30,30,30,0.65); /* mobile 0.65 */
    }
    .comment-panel-content {
        padding: 0;
    }
    .comment-panel-header, .comment-panel-input, .comment-panel-list {
        padding-left: 10px;
        padding-right: 10px;
    }
}
  