/* ============================================================================
 * MNI User Accounts — Stylesheet
 * ============================================================================ */

/* ----------- Buttons (shared) ----------- */
.mni-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, transform 0.1s ease;
    font-family: inherit;
}

.mni-btn:hover { transform: translateY(-1px); }
.mni-btn:active { transform: translateY(0); }

.mni-btn-primary {
    background: #00629B;
    color: #fff !important;
}
.mni-btn-primary:hover { background: #00629B; }

.mni-btn-secondary {
    background: #fff;
    color: #00629B !important;
    border: 2px solid #00629B;
}
.mni-btn-secondary:hover { background: #f0f6ff; }

.mni-btn-small { padding: 6px 12px; font-size: 0.85rem; }


/* ----------- Login / Register Form ----------- */
.mni-login-wrapper {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.mni-login-logged-in {
    text-align: center;
}

.mni-login-logged-in h2 {
    color: #00629B;
    margin: 0 0 0.5rem 0;
}

.mni-login-logged-in p {
    margin: 1rem 0;
}

/* Tabs */
.mni-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.mni-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
}

.mni-tab-btn:hover {
    color: #00629B;
}

.mni-tab-btn.active {
    color: #00629B;
    border-bottom-color: #00629B;
}

/* Form fields */
.mni-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mni-field {
    display: flex;
    flex-direction: column;
}

.mni-field label {
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #333;
    font-size: 0.9rem;
}

.mni-field input[type="text"],
.mni-field input[type="email"],
.mni-field input[type="password"] {
    padding: 11px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
    background: #fff;
}

.mni-field input:focus {
    outline: none;
    border-color: #00629B;
    box-shadow: 0 0 0 3px rgba(44, 111, 187, 0.1);
}

.mni-field small {
    margin-top: 0.3rem;
    color: #666;
    font-size: 0.8rem;
}

.mni-field-checkbox {
    flex-direction: row;
    align-items: center;
}

.mni-field-checkbox label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.mni-form button[type="submit"] {
    margin-top: 0.5rem;
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

.mni-form-footer {
    text-align: center;
    margin: 1rem 0 0 0;
    color: #666;
    font-size: 0.85rem;
}

.mni-form-footer a {
    color: #00629B;
    text-decoration: none;
}

.mni-form-footer a:hover { text-decoration: underline; }

/* Messages */
.mni-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.mni-message-error {
    background: #fdecea;
    color: #F68D2E;
    border-left: 4px solid #F68D2E;
}

.mni-message-success {
    background: #e8f5e9;
    color: #00629B;
    border-left: 4px solid #00629B;
}


/* ----------- Dashboard ----------- */
.mni-dashboard {
    max-width: 900px;
    margin: 2rem auto;
}

.mni-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.mni-dashboard-header h2 {
    margin: 0;
    color: #00629B;
    font-size: 1.6rem;
}

.mni-dashboard-section {
    margin-bottom: 2.5rem;
}

.mni-dashboard-section h3 {
    color: #00629B;
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
}

.mni-count {
    color: #999;
    font-weight: normal;
    font-size: 0.9rem;
}

/* Continue reading card */
.mni-continue-card {
    background: linear-gradient(135deg, #f0f6ff, #fff);
    border: 1px solid #d0e0f5;
    border-radius: 10px;
    padding: 1.5rem 2rem;
}

.mni-continue-card h4 {
    margin: 0.5rem 0;
    color: #1a2b3c;
    font-size: 1.15rem;
}

.mni-continue-progress {
    margin-bottom: 1rem;
}

.mni-progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.mni-progress-fill {
    height: 100%;
    background: #00629B;
    transition: width 0.3s ease;
}

.mni-continue-date {
    color: #888;
    margin: 0 0 1rem 0;
}

/* Bookmarks list */
.mni-bookmarks-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mni-bookmark-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mni-bookmark-item:hover {
    border-color: #00629B;
    box-shadow: 0 2px 6px rgba(44, 111, 187, 0.1);
}

.mni-bookmark-link {
    flex: 1;
    color: #00629B;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
}

.mni-bookmark-link:hover { text-decoration: underline; }

.mni-remove-bookmark {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
    margin-left: 12px;
}

.mni-remove-bookmark:hover {
    background: #fdecea;
    color: #c0392b;
}

/* Empty state */
.mni-empty-state {
    background: #f7f9fc;
    border: 1px dashed #d0d0d0;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #666;
    margin: 0;
}


/* ----------- Bookmark button (on section pages) ----------- */
.mni-bookmark-button-wrapper {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 1.5rem 0;
}

.mni-bookmark-btn {
	margin-top: 10px;
    background: #fff;
    border: 2px solid #d0d0d0;
    color: #555;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.mni-bookmark-btn:hover {
    background: #fff;
    border-color: #F68D2E;
    color: #F68D2E;
}

.mni-bookmark-btn .mni-star {
    font-size: 1.1rem;
    color: #ccc;
    transition: color 0.2s ease;
}

.mni-bookmark-btn:hover .mni-star {
    color: #F68D2E;
}

.mni-bookmark-btn.is-bookmarked {
    background: #fff5e6;
    border-color: #F68D2E;
    color: #c67a00;
}

.mni-bookmark-btn.is-bookmarked .mni-star {
    color: #F68D2E;
}


/* ----------- Header account link ----------- */
.mni-header-account-link {
    display: inline-block;
    padding: 6px 12px;
    color: #00629B !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.mni-header-account-link:hover {
    background: #f0f6ff;
}


/* ----------- Resume reading indicator ----------- */
.mni-resume-indicator {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #00629B;
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mni-resume-indicator.show {
    opacity: 1;
}


/* ----------- Responsive ----------- */
@media (max-width: 600px) {
    .mni-login-wrapper {
        margin: 1rem;
        padding: 1.5rem;
    }
    .mni-dashboard {
        margin: 1rem;
    }
    .mni-dashboard-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    .mni-bookmark-button-wrapper {
        justify-content: flex-start;
    }
}


/* ----------- Print: hide interactive UI ----------- */
@media print {
    .mni-bookmark-button-wrapper,
    .mni-header-account-link,
    .mni-resume-indicator {
        display: none !important;
    }
}


/* ==========================================================================
   Global User Menu — fixed top-right, visible on all screen sizes
   ========================================================================== */

/*
 * HOW VERTICAL POSITIONING WORKS:
 *
 * The search bar is sticky at the top of the viewport.
 * Its inner padding is 10px, input height ~36px → total bar height ~56px.
 *
 * We want the user menu button centred inside the bar:
 *   centre = bar_top + 10px (padding) + (36px / 2) − (button_height / 2 ~14px) ≈ bar_top + 14px
 *
 * Without admin bar:  bar starts at 0  → button top = 14px
 * Admin bar desktop:  bar starts at 32px → button top = 46px
 * Admin bar mobile:   bar starts at 46px → button top = 60px
 *
 * z-index 1000 = above content, below WP admin bar (99999)
 */

#mni-user-menu {
    position: fixed;
    top: 14px;          /* No admin bar: centred in 56px search bar */
    right: 20px;
    z-index: 1000;
    display: block;     /* Always visible — never hidden on mobile */
}

/* Desktop admin bar (32px tall) */
.admin-bar #mni-user-menu {
    top: 35px;
}

/* Mobile admin bar (46px tall, kicks in ≤ 782px) */
@media screen and (max-width: 782px) {
    .admin-bar #mni-user-menu {
        top: 60px;
    }
}

/* ----------- Logged-out: simple "Log in" button ----------- */

.mni-um-login-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1F75A7;
    color: #fff !important;
    text-decoration: none !important;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: background 0.15s ease, transform 0.1s ease;
	margin-bottom: 5px;
}

.mni-um-login-btn:hover {
    background: #F68D2E;
    transform: translateY(-1px);
}

.mni-um-icon {
    font-size: 1rem;
}


.mni-um-icon img.emoji {
    filter: brightness(0) invert(1);
}

/* ----------- Logged-in: trigger button ----------- */

.mni-um-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.25) !important;
    color: #fff;
    border: none;
    padding: 7px 7px 7px 7px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: background 0.15s ease, transform 0.1s ease;
    white-space: nowrap;  /* Never wrap text inside the button */
}

.mni-um-trigger:hover {
    background: #F68D2E;
    transform: translateY(-1px);
}

/* Round avatar with initial */
.mni-um-avatar {
    width: 28px;
    height: 28px;
    background: #54585A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
    padding-top: 1px;
}

.mni-um-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mni-um-caret {
    font-size: 0.7rem;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.mni-user-menu-in[data-open="true"] .mni-um-caret {
    transform: rotate(180deg);
}

/* ----------- Dropdown panel ----------- */

.mni-um-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.07);
    overflow: hidden;

    transform-origin: top right;
    transform: scaleY(0.8) translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mni-user-menu-in[data-open="true"] .mni-um-dropdown {
    transform: scaleY(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Dropdown header: name + email */
.mni-um-header {
    padding: 14px 16px;
    background: #f7f9fc;
    border-bottom: 1px solid #ebebeb;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mni-um-header strong {
    font-size: 0.95rem;
    color: #1a2b3c;
}

.mni-um-header small {
    font-size: 0.8rem;
    color: #888;
}

/* Dropdown items */
.mni-um-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none !important;
    color: #333 !important;
    transition: background 0.12s ease;
    border-bottom: 1px solid #f4f4f4;
}

.mni-um-item:last-child {
    border-bottom: none;
}

.mni-um-item:hover {
    background: #f0f6ff;
}

.mni-um-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.mni-um-item-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.mni-um-item-text strong {
    font-size: 0.9rem;
    color: #1a2b3c;
    font-weight: 600;
}

.mni-um-item-text small {
    font-size: 0.78rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Divider before logout */
.mni-um-divider {
    height: 1px;
    background: #ebebeb;
    margin: 4px 0;
}

/* Logout — slightly red tint */
.mni-um-logout:hover {
    background: #fdecea !important;
}

.mni-um-logout .mni-um-item-text strong {
    color: #c0392b;
}

/* ----------- Tablet (≤ 900px): hide username, show avatar only ----------- */
@media (max-width: 900px) {
    .mni-um-name {
        display: none;
    }
    .mni-um-trigger {
        padding: 7px 10px;   /* Slightly narrower without text */
    }
    .mni-um-login-btn {
        padding: 8px 12px;
    }
    .mni-um-label {
        display: none;       /* Hide "Log in" text — keep just 👤 icon */
    }
}

/* ----------- Mobile (≤ 480px): tighten right margin ----------- */
@media (max-width: 480px) {
    #mni-user-menu {
        right: 12px;
    }
    .mni-um-dropdown {
        min-width: 220px;
        /* Keep dropdown left-constrained on narrow screens */
        right: 0;
        max-width: calc(100vw - 24px);
    }
}


/* ----------- Honeypot anti-bot field (hidden from real users) -----------
   Bots happily fill any field named "website"; real users never see this one.
   On submit, the server rejects the registration if this field is non-empty. */
.mni-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
