/**
 * TVK Button and Icon Fixes
 * 
 * This file fixes button visibility and icon display issues
 * 
 * @package TVK_Manager
 * @version 3.4.0
 * @since 3.4.0
 */

/* ========================================================================
   CHANNEL NAVIGATION BUTTON FIXES
   ======================================================================== */

/* Prevent channel navigation from wrapping */
.channel-nav-menu,
#channel-nav .channel-nav-menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
    gap: 2px !important;
    justify-content: center !important;
}

.channel-nav-menu li,
#channel-nav .channel-nav-menu li {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

/* Fix channel navigation buttons (ch1, ch2, etc.) */
.channel-nav-menu li a,
#channel-nav .channel-nav-menu li a,
.tvk-channel-nav a {
    display: inline-block !important;
    padding: 2px 4px !important;
    background: #34495e !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 2px !important;
    font-weight: 500 !important;
    font-size: 10px !important;
    border: 1px solid #2c3e50 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
    min-width: 24px !important;
    text-align: center !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.channel-nav-menu li a:hover,
#channel-nav .channel-nav-menu li a:hover,
.tvk-channel-nav a:hover {
    background: #3498db !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
    border-color: #2980b9 !important;
}

.channel-nav-menu li a:active,
#channel-nav .channel-nav-menu li a:active,
.tvk-channel-nav a:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Selected/Active state */
.channel-nav-menu li a.active,
#channel-nav .channel-nav-menu li a.active,
.tvk-channel-nav a.active {
    background: #e74c3c !important;
    color: #ffffff !important;
    border-color: #c0392b !important;
    box-shadow: 0 3px 6px rgba(231, 76, 60, 0.3) !important;
}

/* ========================================================================
   ICON FIXES
   ======================================================================== */

/* Ensure Dashicons are visible */
.dashicons,
.tvk-icon {
    font-family: 'dashicons' !important;
    font-style: normal !important;
    font-weight: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    display: inline-block !important;
    vertical-align: middle !important;
    font-size: 16px !important;
    color: inherit !important;
}

/* Fix icon visibility in buttons */
.tvk-channel-btn .dashicons,
.tvk-channel-btn .tvk-icon,
.channel-nav-menu li a .dashicons,
.channel-nav-menu li a .tvk-icon {
    font-size: 16px !important;
    margin-right: 6px !important;
    color: inherit !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* ========================================================================
   FILTER BUTTON FIXES
   ======================================================================== */

/* Fix filter buttons in channel users section */
.tvk-header-right button,
.tvk-filter-buttons button,
.tvk-sort-buttons button {
    display: inline-block !important;
    padding: 8px 16px !important;
    background: #667eea !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3) !important;
    margin: 0 4px !important;
}

.tvk-header-right button:hover,
.tvk-filter-buttons button:hover,
.tvk-sort-buttons button:hover {
    background: #5a67d8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4) !important;
}

/* ========================================================================
   DROPDOWN STYLING FIXES
   ======================================================================== */

/* Fix genre dropdown styling */
.tvk-genre-selector,
.tvk-sort-selector {
    padding: 8px 12px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #2d3748 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    min-width: 150px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.tvk-genre-selector:focus,
.tvk-sort-selector:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
    outline: none !important;
}

/* ========================================================================
   RESPONSIVE FIXES
   ======================================================================== */

@media (max-width: 768px) {
    .channel-nav-menu {
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    .channel-nav-menu li a {
        width: 100% !important;
        max-width: 200px !important;
        text-align: center !important;
    }
    
    .tvk-header-right {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: center !important;
    }
}

/* ========================================================================
   VISIBILITY FIXES
   ======================================================================== */

/* Ensure all buttons are visible */
button, .button, .btn, a.btn {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

/* Fix transparent buttons */
.tvk-header-right button[style*="opacity: 0"],
.tvk-filter-buttons button[style*="opacity: 0"] {
    opacity: 1 !important;
    background: #667eea !important;
    color: #ffffff !important;
}

/* Fix missing content in buttons */
.tvk-header-right button:empty::after,
.tvk-filter-buttons button:empty::after {
    content: "Filter" !important;
    display: inline-block !important;
}

/* ========================================================================
   ICON FALLBACKS
   ======================================================================== */

/* Text fallbacks for missing icons */
.tvk-no-dashicons-support .dashicons::before,
.tvk-no-dashicons-support .tvk-icon::before {
    content: "●" !important;
    font-family: Arial, sans-serif !important;
    font-size: 14px !important;
    color: #667eea !important;
}

/* Specific icon fallbacks */
.tvk-no-dashicons-support .dashicons-filter::before {
    content: "🔍" !important;
}

.tvk-no-dashicons-support .dashicons-sort::before {
    content: "↕" !important;
}

.tvk-no-dashicons-support .dashicons-admin-generic::before {
    content: "⚙" !important;
}
