/* ═══════════════════════════════════════════
   IPTV Manager Pro - Custom Header Styles
   Shared across all public-facing plugin pages
   ═══════════════════════════════════════════ */

/* ─── CANVAS MODE: THEME OVERRIDES ─── */
/* This ensures a clean, standalone look by hiding theme elements 
   while preserving the footer as requested. */

body.iptv-canvas-mode {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

/* Hide Theme Header, Nav, and Containers */
.iptv-canvas-mode header:not(.iptv-custom-header),
.iptv-canvas-mode .site-header,
.iptv-canvas-mode .main-header,
.iptv-canvas-mode .masthead,
.iptv-canvas-mode #masthead,
.iptv-canvas-mode .site-navigation,
.iptv-canvas-mode .main-navigation,
.iptv-canvas-mode nav.primary-menu,
.iptv-canvas-mode .elementor-location-header,
.iptv-canvas-mode .ast-header-break-point,
.iptv-canvas-mode #ast-desktop-header,
.iptv-canvas-mode #ast-mobile-header,
.iptv-canvas-mode .site-branding,
.iptv-canvas-mode .wp-site-blocks > header,
.iptv-canvas-mode .entry-header,
.iptv-canvas-mode .page-header {
    display: none !important;
}

/* Force Canvas Container to be Full Width */
.iptv-canvas-mode .site-content,
.iptv-canvas-mode .content-area,
.iptv-canvas-mode .main-content,
.iptv-canvas-mode #content,
.iptv-canvas-mode #primary,
.iptv-canvas-mode main,
.iptv-canvas-mode .entry-content,
.iptv-canvas-mode .page-content,
.iptv-canvas-mode .post-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Ensure body has no top margin/padding from theme */
.iptv-canvas-mode {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.iptv-canvas-mode #page {
    margin-top: 0 !important;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Push footer to bottom */
.iptv-canvas-mode .site-footer,
.iptv-canvas-mode footer:not(.iptv-custom-header),
.iptv-canvas-mode #colophon,
.iptv-canvas-mode .elementor-location-footer {
    margin-top: auto !important;
}

/* Custom Header */
.iptv-custom-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.iptv-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Back Button */
.iptv-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.iptv-back-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.iptv-back-btn:active {
    transform: scale(0.95);
}

/* Logo */
.iptv-header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    color: #0f172a !important;
    font-weight: 600;
    font-size: 16px;
    flex: 1;
    line-height: 1;
}

.iptv-header-logo:hover {
    color: #6366f1 !important;
    text-decoration: none !important;
}

.iptv-header-logo svg,
.iptv-header-logo-img {
    flex-shrink: 0;
}

.iptv-header-logo-img {
    height: 28px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

/* Right Actions */
.iptv-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.iptv-header-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}

.iptv-header-action:hover {
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none !important;
}

.iptv-header-action svg {
    flex-shrink: 0;
}

/* Currency & Language Badges */
.iptv-header-badge {
    border: 1px solid #e5e7eb !important;
    font-weight: 600;
    min-width: 48px;
    justify-content: center;
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* Dividers between actions */
.iptv-header-actions .iptv-header-badge + .iptv-header-badge {
    margin-left: 0;
}

/* ═══════════════════════════════════════════
   Help Modal
   ═══════════════════════════════════════════ */
.iptv-help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.iptv-help-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.iptv-help-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
}

.iptv-help-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.iptv-help-modal-head h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.iptv-help-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.iptv-help-modal-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.iptv-help-modal-body {
    padding: 24px;
    color: #475569;
    line-height: 1.7;
    font-size: 15px;
}

.iptv-help-modal-body p {
    margin: 0 0 16px;
}

.iptv-help-contact-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    margin-top: 8px;
}

.iptv-help-contact-box svg {
    flex-shrink: 0;
}

.iptv-help-contact-label {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.iptv-help-contact-box a {
    color: #6366f1;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

.iptv-help-contact-box a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    .iptv-header-container {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .iptv-back-btn {
        width: 36px;
        height: 36px;
    }
    
    .iptv-header-logo span {
        display: none;
    }
    
    .iptv-header-logo-img {
        height: 24px;
    }
    
    .iptv-header-action span {
        display: none;
    }
    
    .iptv-header-action {
        padding: 8px 10px;
        min-width: 38px;
        justify-content: center;
    }
    
    .iptv-header-badge {
        min-width: 42px;
        font-size: 12px;
    }
    
    .iptv-header-actions {
        gap: 6px;
    }
    
    .iptv-help-modal-content {
        width: 94%;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .iptv-header-container {
        padding: 10px 12px;
    }
}

/* ═══════════════════════════════════════════
   Print Styles
   ═══════════════════════════════════════════ */
@media print {
    .iptv-custom-header,
    .iptv-help-modal {
        display: none !important;
    }
}
