/**
 * App API Bridge — Styles
 *
 * Minimal, responsive, and easily overridable.
 *
 * @package App_API_Bridge
 * @since   1.0.0
 */

/* Cache-safe auth visibility */
.app-auth-hide { display: none !important; }

/* =========================================================
   Auth Forms
   ========================================================= */

.app-auth-form {
    max-width: 400px;
    margin: 0 auto;
}

.app-form-group {
    margin-bottom: 14px;
}

.app-form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 13px;
}

.app-form-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.app-form-group input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.app-form-actions {
    margin-top: 18px;
}

/* =========================================================
   Buttons
   ========================================================= */

.app-btn {
    display: inline-block;
    padding: 9px 20px;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s;
}

.app-btn:hover {
    opacity: 0.85;
}

.app-btn-primary {
    background: #0073aa;
    color: #fff;
}

.app-btn.app-loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================================================
   Comment Form
   ========================================================= */

.app-login-prompt {
    color: #ccc;
    font-size: 14px;
    padding: 10px 0;
}

.app-login-prompt a {
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
}

.app-login-prompt a:hover {
    color: #4fc3f7;
}

#respond .logged-in-as {
    color: #ccc;
}

#respond .logged-in-as a {
    color: #fff;
}

#respond .app-guest-fields label {
    color: #ccc;
}

/* =========================================================
   Comment / reply form — iOS no-zoom on focus
   iOS Safari auto-zooms whenever it focuses an input/textarea
   whose computed font-size is smaller than 16px. Forcing 16px
   suppresses the zoom while keeping inputs unobtrusive on
   desktop (theme styles can override visually if desired).
   ========================================================= */

#respond input[type="text"],
#respond input[type="email"],
#respond input[type="url"],
#respond input[type="password"],
#respond input[type="search"],
#respond input[type="number"],
#respond input[type="tel"],
#respond textarea,
.app-comment-form input[type="text"],
.app-comment-form input[type="email"],
.app-comment-form input[type="url"],
.app-comment-form input[type="password"],
.app-comment-form input[type="search"],
.app-comment-form input[type="number"],
.app-comment-form input[type="tel"],
.app-comment-form textarea,
.app-reply-form input[type="text"],
.app-reply-form textarea {
    font-size: 16px;
    /* Prevent the iOS form bar from awkwardly resizing tap targets. */
    -webkit-text-size-adjust: 100%;
}

/* =========================================================
   Inline reply form — appended right under the parent comment
   so the user clearly sees which comment they're replying to.
   ========================================================= */

.app-reply-form {
    margin: 10px 0 14px 0;
    padding: 12px 14px;
    border-left: 3px solid #4fc3f7;
    background: rgba(79, 195, 247, 0.06);
    border-radius: 3px;
}

/* Reply form uses the theme's .section-header pattern (h4 + small a)
   so the title and "Hủy trả lời" link inherit theme styling. The
   tweaks below just shrink the title for the reply context. */
.app-reply-form .section-header {
    margin-bottom: 10px;
}

.app-reply-form .section-title {
    font-size: 14px;
    font-weight: 700;
}

.app-reply-form .section-title strong {
    color: #1a73e8;
}

.app-reply-form .section-title small {
    margin-left: 8px;
    font-weight: 400;
}

.app-reply-form .section-title small a,
.app-reply-form .section-title small a:hover {
    color: #c62828;
    text-decoration: underline;
    /* Reset the theme's `.section-title a:hover` sprite (an arrow icon
       added via background-image + padding-right) which would otherwise
       leak into our cancel link. */
    background: none;
    padding: 0;
}

.app-reply-form textarea {
    width: 100%;
    box-sizing: border-box;
}

.app-reply-form .app-guest-fields input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}

/* Cancel button reuses the theme's .form-submit .btn.btn-black styling
   (red background) so it visually matches the submit button. The only
   override is a slightly muted background to differentiate roles. */
.app-reply-form .form-submit .btn.btn-black + .btn.btn-black.app-cancel-reply {
    margin-left: 8px;
    background-color: #555;
}

.app-reply-form .form-submit .btn.btn-black.app-cancel-reply:hover {
    background-color: #444;
}

.app-reply-form .app-auth-message {
    margin-bottom: 10px;
}

/* =========================================================
   Messages
   ========================================================= */

.app-auth-message {
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.4;
}

.app-msg-success {
    background: #ecf7ed;
    color: #1a7a2e;
    border: 1px solid #c3e6cb;
}

.app-msg-error {
    background: #fdf0f0;
    color: #a02020;
    border: 1px solid #f5c6cb;
}

/* =========================================================
   User Bar
   ========================================================= */

.app-user-bar {
    font-size: 13px;
    line-height: 1.5;
}

.app-user-bar-logged-in,
.app-user-bar-logged-out {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.app-user-avatar {
    border-radius: 50%;
    vertical-align: middle;
}

.app-user-sep {
    color: #999;
    margin: 0 2px;
}

.app-logout-link,
.app-login-link,
.app-register-link {
    cursor: pointer;
    text-decoration: none;
}

.app-logout-link:hover,
.app-login-link:hover,
.app-register-link:hover {
    text-decoration: underline;
}

.app-logout-link.app-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* =========================================================
   Notification Bell & Dropdown
   ========================================================= */

.app-notification-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.app-notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 2px;
    color: inherit;
    text-decoration: none;
}

.app-notification-bell:hover {
    opacity: 0.8;
}

.app-notification-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #d63638;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.app-notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 9999;
}

.app-notification-header {
    padding: 12px 14px;
    border-bottom: 1px solid #333;
    font-size: 14px;
    color: #fff;
}

.app-notification-item {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid #2a2a2a;
    text-decoration: none;
    color: #ccc;
    transition: background 0.15s;
}

.app-notification-item:hover {
    background: #2a2a2a;
    color: #fff;
    text-decoration: none;
}

.app-notification-unread {
    background: rgba(0, 115, 170, 0.1);
    border-left: 3px solid #0073aa;
}

.app-notification-message {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 3px;
}

.app-notification-time {
    font-size: 11px;
    color: #888;
}

.app-notification-empty,
.app-notification-loading {
    padding: 24px 14px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

@media (max-width: 480px) {
    .app-notification-dropdown {
        width: 280px;
        right: -40px;
    }
}

/* =========================================================
   Comments (reply indicator — used by app-bridge JS)
   ========================================================= */

.app-reply-indicator {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: #f5f5f5;
    border-radius: 3px;
}

/* =========================================================
   Profile Modal Loading
   ========================================================= */

.app-profile-loading {
    position: relative;
    pointer-events: none;
}

.app-profile-loading .app-form {
    opacity: 0.3;
    transition: opacity 0.2s;
}

.app-profile-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: appSpinner 0.6s linear infinite;
    z-index: 10;
}

@keyframes appSpinner {
    to {
        transform: rotate(360deg);
    }
}

.app-password-toggle {
    margin: 14px 0 6px;
}

.app-password-toggle a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #93c5fd;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 14px;
    border: 1px solid rgba(147, 197, 253, 0.3);
    border-radius: 6px;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.app-password-toggle a:hover {
    background: rgba(147, 197, 253, 0.1);
    border-color: rgba(147, 197, 253, 0.5);
    text-decoration: none;
}

.app-password-toggle a svg {
    flex-shrink: 0;
}

.app-toggle-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
}

.app-password-toggle.active .app-toggle-arrow {
    transform: rotate(180deg);
}

.app-password-fields {
    border-left: 2px solid rgba(147, 197, 253, 0.3);
    margin-top: 10px;
    padding: 10px 0 0 14px;
}


/* =========================================================
   Theme Integration CSS (migrated from deTube custom.css)
   ========================================================= */

/* ---- Auth Modal Overlay (Cinematic Premium) ---- */
.app-modal-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Deep dark backdrop */
    z-index: 999999;
    display: flex !important;
    align-items: center;
    justify-content: center;
    /* Center the modal */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 0;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.app-modal-overlay[style*="none"] {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

.app-modal-box {
    background: #0f0f0f;
    /* OLED Dark */
    color: #f1f1f1;
    width: 400px;
    max-width: 90vw;
    border-radius: 16px;
    /* Soft rounding */
    padding: 40px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle premium edge */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 1), 0 0 20px rgba(183, 0, 0, 0.05);
    /* Deep shadow with subtle red glow */
    margin: auto;
    /* Vertically center when smaller, push to top when overflowing */
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.app-modal-overlay[style*="display: block"] .app-modal-box,
.app-modal-overlay[style*="display: flex"] .app-modal-box {
    transform: scale(1) translateY(0);
}

.app-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.app-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

.app-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 30px;
    color: #fff;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Form inside modal */
.app-modal-box .app-form p {
    margin: 0 0 20px;
}

.app-modal-box .app-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #a1a1aa;
    /* slate-400 */
}

.app-modal-box .app-form input[type="text"],
.app-modal-box .app-form input[type="password"],
.app-modal-box .app-form input[type="email"] {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    /* Soft input fill */
    color: #fff;
    font-size: 16px;
    line-height: 1.4;
    border-radius: 12px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.app-modal-box .app-form input:focus {
    border-color: #b70000;
    background: rgba(183, 0, 0, 0.05);
    /* Tone sur tone highlight */
    outline: none;
    box-shadow: 0 0 0 3px rgba(183, 0, 0, 0.15);
    /* Visible focus ring */
}

.app-modal-box .form-submit {
    margin-top: 30px;
}

.app-modal-box .form-submit .btn {
    width: 100%;
    text-align: center;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.app-modal-box .form-submit .btn-black,
.app-modal-box .form-submit .btn-green {
    /* Using brand red for both buttons to maintain tone-sur-tone */
    background: #b70000;
    color: #ffffff;
    box-shadow: 0 4px 14px 0 rgba(183, 0, 0, 0.39);
}

.app-modal-box .form-submit .btn-black:hover,
.app-modal-box .form-submit .btn-green:hover {
    background: #e50000;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(183, 0, 0, 0.45);
}

/* Auth messages inside modal */
.app-modal-box .app-auth-message {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
}

.app-modal-box .app-msg-success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.app-modal-box .app-msg-error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Switch link */
.app-modal-switch {
    text-align: center;
    font-size: 14px;
    color: #888;
    margin: 30px 0 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle divider */
}

.app-modal-switch a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    margin-left: 6px;
    transition: color 0.2s ease;
}

.app-modal-switch a:hover {
    color: #b70000;
}

/* App API comments — reply indicator */
.app-reply-indicator {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: #f5f5f5;
    border-radius: 3px;
}

.app-reply-indicator .app-cancel-reply {
    margin-left: 10px;
    color: #a02020;
    text-decoration: none;
    font-size: 12px;
}

.app-reply-indicator .app-cancel-reply:hover {
    text-decoration: underline;
}

/* App API comments — auth message in comment forms */
[data-app-form="comment"] .app-auth-message {
    padding: 8px 10px;
    margin-bottom: 10px;
    border-radius: 3px;
    font-size: 13px;
}

[data-app-form="comment"] .app-msg-success {
    background: #ecf7ed;
    color: #1a7a2e;
    border: 1px solid #c3e6cb;
}

[data-app-form="comment"] .app-msg-error {
    background: #fdf0f0;
    color: #a02020;
    border: 1px solid #f5c6cb;
}

/* App API comments — no comments message */
.app-no-comments {
    color: #999;
    font-size: 14px;
    font-style: italic;
    margin: 10px 0;
}

/* App API comments — pagination */
.app-comments-pagination {
    margin: 20px 0;
}

.app-comments-pagination a,
.app-comments-pagination .current {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 2px;
    text-decoration: none;
    font-size: 12px;
}

.app-comments-pagination .current {
    font-weight: bold;
}

/* App API comments — children (replies) */
.comment-list .children .app-comment .comment-inner {
    padding-left: 20px;
}

.comment-list .children .app-comment .comment-avatar img {
    width: 32px;
    height: 32px;
}

/* Community video grid — fits deTube content area */
.app-videos-grid {
    display: grid;
    gap: 20px;
}

.app-cols-1 {
    grid-template-columns: 1fr;
}

.app-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.app-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.app-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.app-video-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.app-video-card a:hover .app-video-title {
    color: #B70000;
}

.app-video-thumb {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: #000;
    border-radius: 3px;
}

.app-video-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
}

.app-video-card a:hover .app-video-thumb img {
    opacity: 0.85;
}

.app-video-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.app-video-info {
    padding: 6px 0;
}

.app-video-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.app-video-meta {
    font-size: 11px;
    color: #999;
}

.app-video-author {
    margin-right: 6px;
}

.app-no-videos {
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* Community video pagination */
.app-videos-pagination {
    margin: 20px 0;
    text-align: center;
}

.app-videos-pagination a,
.app-videos-pagination .current {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 2px;
    text-decoration: none;
    font-size: 12px;
}

.app-videos-pagination .current {
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {

    .app-cols-3,
    .app-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {

    .app-cols-2,
    .app-cols-3,
    .app-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* ---- Header Actions Layout ---- */
#header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    float: right;
}

/* ---- Header Auth Buttons (Liquid Glass Premium) ---- */
#header-actions .btn-login,
#header-actions .btn-signup,
#header-actions .btn-guest-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    height: 32px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    margin-left: 0;
}

#header-actions .btn-login {
    background: rgba(255, 255, 255, 0.05);
    color: #e5e5e5;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#header-actions .btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#header-actions .btn-signup {
    background: rgba(255, 255, 255, 0.08);
    color: #e5e5e5;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#header-actions .btn-signup:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

#header-actions .btn-guest-upload {
    background: #b70000;
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(183, 0, 0, 0.3);
}

#header-actions .btn-guest-upload:hover {
    background: #e50000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(183, 0, 0, 0.5);
}

/* ---- Profile Button (Liquid Glass Pill) ---- */
#account-nav {
    display: inline-flex;
    align-items: center;
    margin-left: 15px;
    height: 100%;
}

#account-nav .dropdown-handle {
    display: inline-flex;
    align-items: center;
    padding: 2px 12px 2px 4px;
    height: 38px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #e5e5e5;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    cursor: pointer;
}

#account-nav .dropdown-handle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #fff;
}

#account-nav .dropdown-handle .avatar {
    border-radius: 50%;
    margin-right: 8px;
    width: 30px;
    height: 30px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#account-nav .dropdown-handle .display-name {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    background: none !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    color: inherit;
}

#account-nav .dropdown-handle .mini-arrow-down {
    margin-left: 5px;
    opacity: 0.6;
}

/* Notification bell in header */
#header-actions > .app-notification-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
    margin-left: 12px;
    vertical-align: middle;
}

#header-actions .app-notification-bell {
    color: #d4d4d8;
    display: inline-flex;
    align-items: center;
    padding: 7px;
    border-radius: 50%;
    transition: all 0.2s ease;
    text-decoration: none;
}

#header-actions .app-notification-bell:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

#header-actions .app-notification-badge {
    position: absolute;
    top: 50%;
    right: 0;
    margin-top: -16px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

#header-actions .app-notification-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: #1a1a1a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.9) !important;
    padding: 8px;
    z-index: 99999;
}

#header-actions .app-notification-header {
    padding: 10px 14px;
    color: #d4d4d8;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#header-actions .app-notification-close {
    background: none;
    border: none;
    color: #71717a;
    font-size: 20px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

#header-actions .app-notification-close:hover {
    color: #fff;
}

#header-actions .app-notification-item {
    display: block;
    padding: 10px 14px;
    color: #d4d4d8;
    font-size: 13px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

#header-actions .app-notification-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

#header-actions .app-notification-unread {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid #3b82f6;
    padding-left: 11px;
}

#header-actions .app-notification-unread:hover {
    background: rgba(59, 130, 246, 0.15);
}

#header-actions .app-notification-message {
    line-height: 1.4;
    margin-bottom: 3px;
}

#header-actions .app-notification-time {
    font-size: 11px;
    color: #71717a;
}

#header-actions .app-notification-empty,
#header-actions .app-notification-loading {
    padding: 20px 14px;
    text-align: center;
    color: #71717a;
    font-size: 13px;
}

/* Dropdown Menu cinematic style */
#account-nav {
    position: relative;
    display: inline-block;
}

/* Invisible bridge to prevent hover gap */
#account-nav::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 6px;
}

#account-nav .dropdown-content {
    background: #1a1a1a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.9) !important;
    padding: 8px !important;
    min-width: 180px;
    margin-top: 4px;
    right: 0;
    left: auto;
    position: absolute;
    top: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#account-nav:hover .dropdown-content,
#account-nav:focus-within .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#account-nav .dropdown-content-inner {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#account-nav .dropdown-content-inner li {
    list-style: none !important;
    border-top: none !important;
    border-bottom: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#account-nav .dropdown-content-inner a {
    display: block;
    padding: 10px 14px;
    color: #d4d4d8;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

#account-nav .dropdown-content-inner a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

#account-nav .dropdown-content-inner .divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 6px 0;
}

#account-nav .dropdown-content-inner .logout-link {
    color: #ef4444;
}

#account-nav .dropdown-content-inner .logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* Modal Inputs fixes for new components */
.app-modal-box .app-form input.custom-file-input {
    height: 48px;
    padding: 11px 16px;
    line-height: 24px;
    color: #a1a1aa;
    cursor: pointer;
}

.app-modal-box .app-form input.custom-file-input::file-selector-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    color: #fff;
    margin-right: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.app-modal-box .app-form input.custom-file-input::file-selector-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Unified Profile Modal ── */
.app-profile-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 18px;
}

.app-profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.15);
    transition: border-color 0.2s;
}

.app-profile-avatar:hover {
    border-color: #10b981;
}

.app-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-profile-avatar svg#app-avatar-default {
    width: 50px;
    height: 50px;
    color: rgba(255, 255, 255, 0.35);
}

.app-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 50%;
}

.app-avatar-overlay svg {
    color: #fff;
}

.app-profile-avatar:hover .app-avatar-overlay {
    opacity: 1;
}

.app-avatar-hint {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}

/* ── Video Upload Modal ── */
.app-video-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.app-video-dropzone:hover,
.app-video-dropzone.dragover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.06);
}

.app-dropzone-content svg {
    color: rgba(255, 255, 255, 0.25);
    margin-bottom: 10px;
}

.app-dropzone-label {
    color: #d4d4d8;
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px;
}

.app-dropzone-hint {
    color: rgba(255, 255, 255, 0.35);
    font-size: 12px;
    margin: 0;
}

.app-dropzone-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.app-dropzone-preview video {
    width: 80px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #000;
}

.app-file-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

#app-file-name {
    color: #d4d4d8;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#app-file-size {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}

.app-remove-file {
    background: rgba(239, 68, 68, 0.15);
    border: none;
    color: #ef4444;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.app-remove-file:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Textarea */
.app-modal-box .app-form textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.app-modal-box .app-form textarea:focus {
    outline: none;
    border-color: #10b981;
    background: rgba(255, 255, 255, 0.08);
}

.app-modal-box .app-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* ── Upload Progress Bar ── */
.app-upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.app-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.app-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.app-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.app-progress-text {
    color: #10b981;
    font-size: 12px;
    font-weight: 600;
    min-width: 32px;
    text-align: right;
}

/* Submit button disabled state */
#app-upload-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Multi-Video Items ── */
.app-video-list {
    margin-bottom: 16px;
}

.app-video-list>label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.app-video-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.app-video-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-mini-dropzone {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 44px;
}

.app-mini-dropzone:hover,
.app-mini-dropzone.dragover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.app-vi-ph {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.app-vi-ph svg {
    opacity: 0.5;
}

.app-vi-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.app-vi-name {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.app-vi-size {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    flex-shrink: 0;
}

.app-vi-rm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.app-vi-rm:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ── Image Grid (multi-select + drag reorder) ── */
.app-image-list {
    margin-bottom: 14px;
}

.app-image-list > label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.app-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.app-img-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    cursor: grab;
    transition: border-color 0.2s, opacity 0.2s, transform 0.2s;
}

.app-img-thumb:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.app-img-thumb.app-img-uploaded {
    border-color: rgba(16, 185, 129, 0.3);
}

.app-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-img-drag-handle {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.app-img-thumb:hover .app-img-drag-handle {
    opacity: 1;
}

.app-img-rm {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 2;
}

.app-img-thumb:hover .app-img-rm {
    opacity: 1;
}

.app-img-rm:hover {
    background: rgba(239, 68, 68, 0.8);
}

.app-img-thumb.app-img-dragging {
    opacity: 0.3;
    transform: scale(0.95);
}

.app-img-thumb.app-img-dragover {
    border-color: #10b981;
    transform: scale(1.05);
}

.app-add-image-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.app-add-image-btn:hover {
    color: #10b981;
    border-color: #10b981;
}

.app-image-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
}

.app-add-video-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.app-add-video-btn:hover {
    color: #10b981;
    border-color: #10b981;
}

.app-add-video-btn:disabled {
    display: none;
}

/* ── Tag Pills ── */
.app-tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    cursor: text;
    min-height: 40px;
    align-items: center;
}

.app-tag-input-wrap:focus-within {
    border-color: #10b981;
}

.app-tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.app-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 10px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 12px;
    color: #10b981;
    font-size: 12px;
    white-space: nowrap;
}

.app-tag-pill span {
    line-height: 1.4;
}

.app-tag-x {
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.app-tag-x:hover {
    color: #ef4444;
}

.app-tag-input {
    border: none !important;
    background: transparent !important;
    outline: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    flex: 1;
    min-width: 100px;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

/* ── Upload Video Modal: Compact Layout ── */
#app-modal-upload-video .app-modal-box {
    padding: 24px;
    width: 440px;
}

#app-modal-upload-video .app-modal-title {
    margin-bottom: 16px;
    font-size: 20px;
}

#app-modal-upload-video .app-modal-close {
    top: 12px;
    right: 12px;
}

#app-modal-upload-video .app-form p {
    margin-bottom: 12px;
}

#app-modal-upload-video .app-form label {
    margin-bottom: 4px;
    font-size: 12px;
}

#app-modal-upload-video .app-form input[type="text"] {
    height: 38px;
    padding: 0 12px;
    font-size: 16px;
    border-radius: 8px;
}

#app-modal-upload-video .app-form textarea {
    padding: 8px 12px;
    font-size: 16px;
    min-height: 60px;
}

#app-modal-upload-video .app-video-list {
    margin-bottom: 12px;
}

#app-modal-upload-video .app-mini-dropzone {
    padding: 8px 12px;
    min-height: 38px;
}

#app-modal-upload-video .app-image-list {
    margin-bottom: 10px;
}

#app-modal-upload-video .app-image-grid {
    gap: 6px;
    margin-bottom: 6px;
}

#app-modal-upload-video .app-tag-input-wrap {
    min-height: 36px;
    padding: 6px 10px;
}

#app-modal-upload-video .form-submit {
    margin-top: 16px;
}

#app-modal-upload-video .form-submit .btn {
    padding: 11px;
    font-size: 14px;
    border-radius: 10px;
}

/* ── Community Videos: Author above title ── */
.app-cv-author {
    font-size: 11px;
    color: #888;
    margin: 0;
    padding: 6px 8px 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-cv-author a {
    color: #aaa;
    text-decoration: none;
}

.app-cv-author a:hover {
    color: #fff;
}

/* ── Community Videos Section on Homepage ── */
.app-cv-section {
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 1px solid #272727;
}

.app-cv-title {
    font-size: 15px;
    font-weight: bold;
    color: #e5e5e5;
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #333;
    line-height: 24px;
}

.app-cv-section .section-content {
    margin-bottom: 0;
    padding-bottom: 0;
}

.app-cv-more {
    margin-top: 0;
    padding-top: 10px;
}

/* ── Mobile Topbar (WP Admin Bar style) ── */
#app-mobile-topbar {
    display: none;
}

@media (max-width: 768px) {
    #app-mobile-topbar {
        display: block;
        height: 46px;
        background: #1a1a1a;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        position: sticky;
        top: 0;
        z-index: 999;
    }

    .app-mtb-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 100%;
        padding: 0 12px;
    }

    .app-mtb-profile {
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        color: #e5e5e5;
        min-width: 0;
        flex: 1;
    }

    .app-mtb-profile img {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        object-fit: cover;
        border: 1px solid rgba(255, 255, 255, 0.15);
        flex-shrink: 0;
    }

    .app-mtb-avatar-placeholder {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        flex-shrink: 0;
    }

    .app-mtb-name {
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-mtb-actions {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }

    .app-mtb-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        color: #a1a1aa;
        text-decoration: none;
        transition: background 0.2s, color 0.2s;
    }

    .app-mtb-btn:hover,
    .app-mtb-btn:active {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

    .app-mtb-upload {
        width: auto !important;
        padding: 0 10px;
        gap: 4px;
        background: #dc2626;
        color: #fff !important;
        font-size: 12px;
        font-weight: 600;
        border-radius: 6px;
        height: 32px;
    }

    .app-mtb-upload:hover,
    .app-mtb-upload:active {
        background: #ef4444 !important;
        color: #fff !important;
    }

    /* Mobile notification bell */
    .app-mtb-actions .app-notification-wrap {
        position: relative;
        display: inline-flex;
        align-items: center;
    }

    .app-mtb-actions .app-notification-badge {
        position: absolute;
        top: 2px;
        right: 2px;
        background: #ef4444;
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        min-width: 14px;
        height: 14px;
        border-radius: 7px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
        line-height: 1;
    }

    .app-mtb-actions .app-notification-dropdown {
        position: fixed;
        top: 46px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 46px);
        overflow-y: auto;
        background: #1a1a1a;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
        z-index: 99999;
        padding: 0;
    }

    .app-mtb-actions .app-notification-header {
        padding: 12px 16px;
        color: #d4d4d8;
        font-size: 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .app-mtb-actions .app-notification-close {
        background: none;
        border: none;
        color: #71717a;
        font-size: 22px;
        cursor: pointer;
        padding: 4px 8px;
        line-height: 1;
    }

    .app-mtb-actions .app-notification-close:hover,
    .app-mtb-actions .app-notification-close:active {
        color: #fff;
    }

    .app-mtb-actions .app-notification-item {
        display: block;
        padding: 12px 16px;
        color: #d4d4d8;
        font-size: 13px;
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .app-mtb-actions .app-notification-item:hover {
        background: rgba(255, 255, 255, 0.05);
        color: #fff;
        text-decoration: none;
    }

    .app-mtb-actions .app-notification-unread {
        background: rgba(59, 130, 246, 0.08);
        border-left: 3px solid #3b82f6;
    }

    .app-mtb-actions .app-notification-time {
        font-size: 11px;
        color: #71717a;
        margin-top: 3px;
    }

    .app-mtb-actions .app-notification-empty,
    .app-mtb-actions .app-notification-loading {
        padding: 24px 16px;
        text-align: center;
        color: #71717a;
        font-size: 13px;
    }

    .app-mtb-logout {
        color: #ef4444;
    }

    .app-mtb-logout:hover,
    .app-mtb-logout:active {
        background: rgba(239, 68, 68, 0.12);
        color: #f87171;
    }

    /* Hide the desktop account dropdown + bell on mobile since topbar replaces it */
    #account-nav,
    #header-actions > .app-notification-wrap {
        display: none !important;
    }

    /* Center auth buttons on mobile */
    #header-actions {
        float: none;
        justify-content: center;
        width: 100%;
    }
}

/* ── Mobile: Upload Popup Optimization ── */
@media (max-width: 600px) {
    .app-modal-overlay {
        padding: 16px 0;
    }

    .app-modal-box {
        padding: 20px 16px;
        border-radius: 12px;
        max-width: 95vw;
    }

    .app-modal-title {
        font-size: 18px;
        margin: 0 0 16px;
    }

    .app-modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 20px;
        z-index: 10;
    }

    .app-modal-box .app-form p {
        margin: 0 0 12px;
    }

    .app-modal-box .app-form label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .app-modal-box .app-form input[type="text"],
    .app-modal-box .app-form input[type="password"],
    .app-modal-box .app-form input[type="email"] {
        height: 40px;
        padding: 0 12px;
        font-size: 16px;
        border-radius: 8px;
    }

    .app-modal-box .app-form textarea {
        padding: 8px 12px;
        font-size: 16px;
        min-height: 60px;
    }

    .app-modal-box .form-submit {
        margin-top: 16px;
    }

    .app-modal-box .form-submit .btn {
        padding: 12px;
        font-size: 14px;
        border-radius: 10px;
    }

    .app-modal-switch {
        margin: 16px 0 0;
        padding-top: 12px;
        font-size: 13px;
    }

    .app-video-dropzone {
        padding: 16px 12px;
        margin-bottom: 12px;
    }

    .app-mini-dropzone {
        padding: 8px 10px;
        min-height: 38px;
    }

    .app-video-list {
        margin-bottom: 12px;
    }

    .app-image-list {
        margin-bottom: 10px;
    }

    .app-image-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .app-img-thumb .app-img-drag-handle,
    .app-img-thumb .app-img-rm {
        opacity: 1;
    }

    .app-img-rm {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }

    .app-img-drag-handle {
        width: 18px;
        height: 18px;
    }

    .app-upload-progress {
        margin-bottom: 10px;
    }

    .app-tag-input-wrap {
        padding: 6px 8px;
        min-height: 36px;
    }

    .app-modal-box .app-auth-message {
        padding: 8px 12px;
        margin-bottom: 12px;
        font-size: 12px;
    }
}

/* =========================================================
   Menu New Badge
   ========================================================= */

#main-nav .menu li a{position:relative;overflow:visible;}
.menu-new-badge{position:absolute;top:-8px;right:-6px;padding:1px 5px;font-size:9px;font-weight:700;line-height:1.3;color:#fff;background:#e53935;border-radius:3px;text-transform:uppercase;box-shadow:0 1px 2px rgba(0,0,0,.3);transform:rotate(8deg);pointer-events:none;white-space:nowrap;}
.menu-new-badge:before{content:"";position:absolute;left:8px;bottom:-3px;width:0;height:0;border-left:3px solid transparent;border-right:3px solid transparent;border-top:3px solid #e53935;}

/* =========================================================
   Mobile Thumbnail Fix (aspect-ratio 16/9)
   ========================================================= */

@media only screen and (max-width:639px) {
    .grid-small .thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .grid-small .thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
}

/* =========================================================
   Entry Tags (wrap spacing)
   ========================================================= */

.entry-tags {
    line-height: 2;
}

.entry-tags > a {
    display: inline-block;
    padding: 0 5px!important;
}

.post-app-video .video-actions-container {
    display: flex;
    justify-content: flex-end;
}

.post-app-video .video-actions-container .video-actions {
    margin: 0;
}

/* =========================================================
   Author Card (single video page)
   ========================================================= */

.app-author-card {
    display: flex;
    align-items: center;
    margin: 16px 0;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: background 0.2s;
}

.app-author-card:hover {
    background: rgba(255, 255, 255, 0.07);
}

.app-author-card-link,
.app-author-card-link:hover,
.app-author-card-link:focus {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    background: none;
    padding: 0;
}

.app-author-card-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.app-author-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-author-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 18px;
}

.app-author-card-info {
    min-width: 0;
}

.app-author-card-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #e5e5e5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-author-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 3px;
}

.app-author-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.app-author-stat svg {
    opacity: 0.6;
    flex-shrink: 0;
}

/* =========================================================
   Upload Success Screen
   ========================================================= */

.app-upload-success-inner {
    text-align: center;
    padding: 40px 20px;
}

.app-upload-success-icon {
    color: #4caf50;
    margin-bottom: 16px;
}

.app-upload-success-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #fff;
}

.app-upload-success-message {
    font-size: 14px;
    line-height: 1.6;
    color: #a1a1aa;
    margin: 0 0 24px;
    word-break: break-word;
}

.app-modal-box .app-upload-success-btn.btn {
    min-width: 160px;
    background: #b70000 !important;
    color: #ffffff !important;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(183, 0, 0, 0.39);
    transition: all 0.2s ease;
}

.app-modal-box .app-upload-success-btn.btn:hover {
    background: #e50000 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(183, 0, 0, 0.45);
}
