/**
 * Mobile Bottom Navigation Bar Styles
 * Only visible on mobile devices (max-width: 768px)
 *
 * @package Polanger_VideoHub
 * @since   1.0.0
 */

/* ========================================
   Mobile Bottom Navigation Bar
   Only visible on mobile devices
======================================== */
.pvh-mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--pvh-bg-elevated, #fff);
    border-top: 1px solid var(--pvh-border, #e5e5e5);
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    transition: transform 0.3s ease;
}

/* Toggle Button */
.pvh-mobile-bar-toggle {
    position: absolute;
    top: -32px;
    right: 16px;
    width: 44px;
    height: 32px;
    background: var(--pvh-bg-elevated, #fff);
    border: 1px solid var(--pvh-border, #e5e5e5);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pvh-text-secondary, #666);
    transition: color 0.2s, background 0.2s;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.08);
    padding: 0;
}

.pvh-mobile-bar-toggle:hover {
    color: var(--pvh-primary, #065fd4);
    background: var(--pvh-bg-hover, #f5f5f5);
}

.pvh-mobile-bar-toggle .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    transition: transform 0.3s ease;
}

/* Collapsed state - the html class is applied before first paint. */
.pvh-mobile-bottom-bar.collapsed,
html.pvh-mobile-bar-collapsed .pvh-mobile-bottom-bar {
    transform: translateY(100%);
}

.pvh-mobile-bottom-bar.collapsed .pvh-mobile-bar-toggle,
html.pvh-mobile-bar-collapsed .pvh-mobile-bar-toggle {
    top: -32px;
}

.pvh-mobile-bottom-bar.collapsed .pvh-mobile-bar-toggle .dashicons,
html.pvh-mobile-bar-collapsed .pvh-mobile-bar-toggle .dashicons {
    transform: rotate(180deg);
}

/* Content wrapper */
.pvh-mobile-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

/* Only show on mobile */
@media screen and (max-width: 768px) {
    .pvh-mobile-bottom-bar {
        display: flex;
    }
    
    body.pvh-has-mobile-bar {
        padding-bottom: 70px;
    }
}

.pvh-mobile-bar-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pvh-mobile-bar-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--pvh-text, #333);
    transition: background 0.2s, color 0.2s;
    padding: 0;
    overflow: visible;
}

a.pvh-mobile-bar-btn {
    text-decoration: none;
}

.pvh-mobile-bar-btn:hover,
.pvh-mobile-bar-btn:focus {
    background: var(--pvh-bg-hover, #f0f0f0);
    color: var(--pvh-primary, #065fd4);
}

.pvh-mobile-bar-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    line-height: 24px;
}

.pvh-mobile-bar-btn .pvh-mobile-avatar {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e5e5e5;
    display: block !important;
    flex-shrink: 0;
}

.pvh-mobile-home {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--pvh-text, #333);
    text-decoration: none;
    padding: 8px 24px;
    border-radius: var(--pvh-radius, 8px);
    transition: background 0.2s, color 0.2s;
}

.pvh-mobile-home:hover {
    background: var(--pvh-bg-hover, #f0f0f0);
    color: var(--pvh-primary, #065fd4);
}

.pvh-mobile-home span {
    font-size: 11px;
    font-weight: 500;
}

.pvh-mobile-home .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    line-height: 24px;
}

.pvh-mobile-cart {
    color: var(--pvh-text, #333);
}

.pvh-mobile-cart:hover,
.pvh-mobile-cart:focus {
    background: var(--pvh-bg-hover, #f0f0f0);
    color: var(--pvh-primary, #065fd4);
}

.pvh-mobile-cart-badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef233c;
    color: #fff;
    border: 2px solid var(--pvh-bg-elevated, #fff);
    font-size: 10px;
    font-weight: 800;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 6px 14px rgba(239, 35, 60, 0.28);
}

/* ========================================
   Mobile Popup Menus
======================================== */
.pvh-mobile-popup {
    display: none;
    position: fixed;
    bottom: 70px;
    left: 16px;
    right: 16px;
    background: var(--pvh-bg-elevated, #fff);
    border-radius: var(--pvh-radius-lg, 12px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--pvh-border, #e5e5e5);
    z-index: 10000;
    max-height: 70vh;
    overflow-y: auto;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

@media screen and (max-width: 768px) {
    .pvh-mobile-popup {
        display: block;
    }
}

.pvh-mobile-popup.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.pvh-mobile-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

@media screen and (max-width: 768px) {
    .pvh-mobile-popup-overlay {
        display: block;
    }
}

.pvh-mobile-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pvh-mobile-popup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--pvh-border, #e5e5e5);
}

.pvh-mobile-popup-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--pvh-text, #333);
}

.pvh-popup-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.pvh-popup-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pvh-popup-user-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--pvh-text, #333);
}

.pvh-popup-user-email {
    font-size: 13px;
    color: var(--pvh-text-muted, #666);
}

.pvh-mobile-popup-menu {
    padding: 8px 0;
}

.pvh-popup-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--pvh-text, #333);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.pvh-popup-menu-item:hover {
    background: var(--pvh-bg-hover, #f5f5f5);
    color: var(--pvh-primary, #065fd4);
}

.pvh-popup-menu-item svg,
.pvh-popup-menu-item .dashicons {
    color: var(--pvh-text-secondary, #666);
    flex-shrink: 0;
}

.pvh-popup-menu-item:hover .dashicons {
    color: var(--pvh-primary, #065fd4);
}

.pvh-popup-menu-item .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

.pvh-mobile-popup-menu .pvh-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--pvh-text, #333);
    text-decoration: none !important;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.pvh-mobile-popup-menu .pvh-user-dropdown-item:hover,
.pvh-mobile-popup-menu .pvh-user-dropdown-item:focus {
    background: var(--pvh-bg-hover, #f5f5f5);
    color: var(--pvh-primary, #065fd4);
    outline: none;
}

.pvh-mobile-popup-menu .pvh-user-dropdown-item svg,
.pvh-mobile-popup-menu .pvh-user-dropdown-item .dashicons {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: var(--pvh-text-secondary, #666);
}

.pvh-mobile-popup-menu .pvh-user-dropdown-item:hover svg,
.pvh-mobile-popup-menu .pvh-user-dropdown-item:focus svg,
.pvh-mobile-popup-menu .pvh-user-dropdown-item:hover .dashicons,
.pvh-mobile-popup-menu .pvh-user-dropdown-item:focus .dashicons {
    color: var(--pvh-primary, #065fd4);
}

.pvh-mobile-popup-menu .pvh-community-menu-item__label {
    min-width: 0;
    flex: 1;
}

.pvh-mobile-popup-menu .pvh-community-menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef233c;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(239, 35, 60, 0.24);
}

.pvh-popup-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--pvh-text-muted, #666);
    background: var(--pvh-bg-secondary, #f0f0f0);
    padding: 2px 8px;
    border-radius: 10px;
}

.pvh-popup-menu-divider {
    height: 1px;
    background: var(--pvh-border, #e5e5e5);
    margin: 8px 0;
}

.pvh-popup-logout {
    color: var(--pvh-danger, #ff4444) !important;
}

.pvh-popup-logout svg,
.pvh-popup-logout .dashicons {
    color: var(--pvh-danger, #ff4444) !important;
}

.pvh-popup-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--pvh-text-muted, #666);
    margin: 0;
}

/* ========================================
   Auth Popup (Login/Register)
======================================== */
.pvh-mobile-popup-auth {
    padding: 24px 16px;
    text-align: center;
}

.pvh-mobile-popup-auth h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: var(--pvh-text, #333);
}

.pvh-mobile-popup-auth p {
    margin: 0 0 20px;
    color: var(--pvh-text-secondary, #666);
    font-size: 14px;
}

.pvh-popup-auth-buttons {
    display: flex;
    gap: 12px;
}

.pvh-popup-btn {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid var(--pvh-border, #e5e5e5);
    border-radius: var(--pvh-radius, 8px);
    background: transparent;
    color: var(--pvh-text, #333);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.pvh-popup-btn:hover {
    background: var(--pvh-bg-hover, #f5f5f5);
}

.pvh-popup-btn-primary {
    background: var(--pvh-primary, #065fd4);
    border-color: var(--pvh-primary, #065fd4);
    color: #fff;
}

.pvh-popup-btn-primary:hover {
    background: var(--pvh-primary-hover, #0550b8);
    border-color: var(--pvh-primary-hover, #0550b8);
}
