/* HCP Gate - Frontend Styles
   Version: 1.0.0
   Lightweight: ~3KB minified
*/

/* ============================================================
   OVERLAY & MODAL
   ============================================================ */
#hcp-gate-overlay {
    display: none;  /* JS sets display:flex when showing */
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#hcp-gate-overlay.hcp-gate-visible {
    display: flex;
    animation: hcpFadeIn 0.25s ease;
}

#hcp-gate-modal {
    background: #ffffff;
    border-radius: 10px;
    padding: 40px 36px 32px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
    animation: hcpSlideUp 0.3s ease;
}

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

#hcp-gate-logo-area {
    margin-bottom: 20px;
    min-height: 0;
}

#hcp-gate-logo {
    max-height: 60px;
    max-width: 180px;
    width: auto;
    height: auto;
}

#hcp-gate-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 14px;
    line-height: 1.3;
}

#hcp-gate-body {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
    margin: 0 0 28px;
}

#hcp-gate-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hcp-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.1s ease;
    line-height: 1.3;
    text-align: center;
	outline: none;
	text-transform: none !important;
}

.hcp-btn:hover {
    transform: translateY(-1px);
}

.hcp-btn:active {
    transform: translateY(0);
}

.hcp-btn-yes {
    background: #224493;
    color: #ffffff;
}

.hcp-btn-yes:hover, .hcp-btn-yes:focus {
    background: #3167cd;
}

.hcp-btn-no {
    background: #224493;
    color: #ffffff;
}

.hcp-btn-no:hover, .hcp-btn-no:focus {
    background: #3167cd;
}

#hcp-gate-pdpa {
    font-size: 0.78rem;
    color: #888;
    margin: 16px 0 0;
    line-height: 1.5;
}

/* ============================================================
   HCP-ONLY ELEMENT VISIBILITY
   ============================================================ */

/* When status is known: HCP = show everything */
body.hcp-status-hcp .hcp-only {
    display: revert !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* When status is known: Public = hide HCP content */
body.hcp-status-public .hcp-only {
    display: none !important;
}

/* Public-only content */
body.hcp-status-hcp .hcp-public-only {
    display: none !important;
}

body.hcp-status-public .hcp-public-only {
    display: revert !important;
    visibility: visible !important;
}

/* Pending state: hide hcp-only to prevent flash (set by early CSS in <head>) */
body.hcp-gate-pending .hcp-only {
    visibility: hidden !important;
}

/* Status message spans */
body.hcp-status-hcp    .hcp-status-hcp-msg    { display: inline !important; }
body.hcp-status-public .hcp-status-public-msg  { display: inline !important; }

/* ============================================================
   ADMIN PREVIEW MODE INDICATOR
   ============================================================ */
body.hcp-admin-preview::after {
    content: attr(data-hcp-preview-label);
    position: fixed;
    bottom: 12px;
    left: 12px;
    background: #d63638;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 999998;
    pointer-events: none;
    letter-spacing: 0.04em;
}

/* ============================================================
   RESET BUTTON
   ============================================================ */
.hcp-reset-btn {
    display: inline-block;
    padding: 8px 18px;
    background: #f5f5f5;
    border: 1px solid #aaa;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    color: #555;
    transition: all 0.15s ease;
	text-transform: none !important;
}

.hcp-reset-btn:hover {
    background: #ffffff;
    border-color: #888;
    color: #222;
}

.hcp-reset-link {
    text-decoration: underline;
    cursor: pointer;
    margin-left: 8px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    #hcp-gate-modal {
        padding: 28px 20px 24px;
    }

    #hcp-gate-title {
        font-size: 1.1rem;
    }

    .hcp-btn {
        font-size: 0.88rem;
        padding: 12px 16px;
    }
}

/* ============================================================
   MEGA-MENU SUBMENU CASCADE
   When a parent <li> has hcp-only, hide its sub-menu <ul> too.
   Covers GeneratePress, most theme mega-menu structures.
   ============================================================ */

/* Direct sibling sub-menu (most themes) */
body.hcp-status-public li.hcp-only,
body.hcp-status-public li.hcp-only + ul,
body.hcp-status-public li.hcp-only > ul,
body.hcp-status-public li.hcp-only ~ ul {
    display: none !important;
}

/* GeneratePress / GeneratePress Premium mega menu wrappers */
body.hcp-status-public li.hcp-only .main-nav,
body.hcp-status-public li.hcp-only .sub-menu,
body.hcp-status-public li.hcp-only .mega-menu,
body.hcp-status-public li.hcp-only .mega-menu-inner,
body.hcp-status-public li.hcp-only [class*="mega"],
body.hcp-status-public li.hcp-only [class*="sub-menu"] {
    display: none !important;
}

/* Also cascade via JS body class for pending/undecided state */
body.hcp-gate-pending li.hcp-only > ul,
body.hcp-gate-pending li.hcp-only ~ ul,
body.hcp-gate-pending li.hcp-only .sub-menu,
body.hcp-gate-pending li.hcp-only .mega-menu,
body.hcp-gate-pending li.hcp-only [class*="mega"] {
    visibility: hidden !important;
}
