/**
 * Header Icons & Login Button Styles
 *
 * Compact button styling optimized for dark backgrounds (e.g., #036133)
 *
 * @since 2.1.0
 */

/* ==========================================================================
   Header Icons Wrapper
   ========================================================================== */

.oe-header-icons {
    display: inline-flex;
    align-items: stretch;
    gap: 0.375rem;
    max-width: 100%;
    flex-wrap: wrap;
    /* Override Elementor accent variable — these are on a dark bg, need white */
    --e-global-color-accent: var(--oe-color-white);
    color: var(--oe-color-white);
}

/* Legacy wrapper (backwards compat) */
.oe-login-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* ==========================================================================
   Panel Trigger Icons - Icon + label buttons for slide panels
   ========================================================================== */

.oe-header-icons__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--oe-color-white);
    font-family: inherit;
    font-size: 0;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.oe-header-icons__trigger:hover,
.oe-header-icons__trigger:focus,
.oe-header-icons__trigger:active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--oe-color-white);
}

.oe-header-icons__trigger:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 1px;
}

.oe-header-icons__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.oe-header-icons__icon svg {
    width: 20px;
    height: 20px;
}

.oe-header-icons__label {
    /* Hidden by default - icons are self-explanatory in header context */
    display: none;
}

/* ==========================================================================
   Notification Badge (promotions count)
   ========================================================================== */

.oe-header-icons__trigger--promo {
    position: relative;
}

.oe-header-icons__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--oe-color-error);
    color: var(--oe-color-white);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border-radius: 8px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* ==========================================================================
   Login Button Notification Badge (unread count)
   ========================================================================== */

.oe-login-button--logged-in {
    position: relative;
}

.oe-login-button__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--oe-color-error);
    color: var(--oe-color-white);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border-radius: 8px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.oe-login-button__badge--hidden {
    display: none;
}

/* ==========================================================================
   Notification Dropdown (hover on profile icon)
   ========================================================================== */

.oe-notif-wrap {
    position: relative;
    display: inline-flex;
}

.oe-notif-dropdown {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 8px;
    width: 300px;
    z-index: 10000;
    transition: opacity 0.15s ease, visibility 0s linear 0.3s;
    pointer-events: none;
}

.oe-notif-dropdown__inner {
    background: var(--oe-color-white);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.oe-notif-wrap:hover .oe-notif-dropdown {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.15s ease, visibility 0s linear 0s;
}

.oe-notif-dropdown__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--oe-color-text-dark, #1a1a1a) !important;
    text-decoration: none !important;
    border-bottom: 1px solid var(--oe-color-border-light);
}

.oe-notif-dropdown__header:hover,
.oe-notif-dropdown__header:visited {
    color: var(--oe-color-primary, #036133) !important;
    text-decoration: none !important;
    background: var(--oe-color-bg-alt);
}

.oe-notif-dropdown__header-icon {
    display: flex;
    width: 16px;
    height: 16px;
    color: inherit;
}

.oe-notif-dropdown__header-icon svg {
    width: 16px;
    height: 16px;
}

/* Unsettled tips warning banner */
.oe-notif-dropdown__unsettled {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fef3c7;
    border-bottom: 1px solid #fde68a;
    color: #92400e !important;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none !important;
    transition: background 0.15s;
}

.oe-notif-dropdown__unsettled:hover,
.oe-notif-dropdown__unsettled:visited {
    background: #fde68a;
    color: #92400e !important;
    text-decoration: none !important;
}

.oe-notif-dropdown__unsettled-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: #d97706;
}

.oe-notif-dropdown__unsettled-text {
    flex: 1;
    min-width: 0;
}

.oe-notif-dropdown__unsettled-text strong {
    text-decoration: underline;
}

.oe-notif-dropdown__empty {
    padding: 20px 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.oe-notif-dropdown__list {
    max-height: 320px;
    overflow-y: auto;
}

.oe-notif-dropdown__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--oe-color-text, #333);
    border-bottom: 1px solid var(--oe-color-border-light);
    transition: background 0.15s;
}

.oe-notif-dropdown__item:last-child {
    border-bottom: none;
}

.oe-notif-dropdown__item:hover {
    background: var(--oe-color-bg-alt);
    text-decoration: none;
    color: var(--oe-color-text, #333);
}

.oe-notif-dropdown__item--unread {
    background: rgba(3, 97, 51, 0.04);
}

.oe-notif-dropdown__item--unread:hover {
    background: rgba(3, 97, 51, 0.08);
}

.oe-notif-dropdown__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--oe-color-bg-alt);
    border-radius: 50%;
    color: #666;
    margin-top: 1px;
}

.oe-notif-dropdown__item--unread .oe-notif-dropdown__icon {
    background: rgba(3, 97, 51, 0.1);
    color: var(--oe-color-primary, #036133);
}

.oe-notif-dropdown__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.oe-notif-dropdown__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--oe-color-text-dark, #1a1a1a);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.oe-notif-dropdown__body {
    font-size: 12px;
    color: #888;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oe-notif-dropdown__actions {
    display: flex;
    border-top: 1px solid var(--oe-color-border-light);
    background: var(--oe-color-bg-alt);
}

.oe-notif-dropdown__footer {
    flex: 1;
    display: block;
    padding: 10px 14px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--oe-color-primary, #036133) !important;
    text-decoration: none !important;
    background: transparent;
    border: none;
    cursor: pointer;
}

.oe-notif-dropdown__footer:hover,
.oe-notif-dropdown__footer:focus,
.oe-notif-dropdown__footer:visited {
    background: var(--oe-color-bg-alt);
    text-decoration: none !important;
    color: var(--oe-color-primary, #036133) !important;
}

.oe-notif-dropdown__clear {
    flex: 1;
    display: block;
    padding: 10px 14px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #999 !important;
    text-decoration: none !important;
    background: transparent;
    border: none;
    border-left: 1px solid var(--oe-color-border-light);
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
}

.oe-notif-dropdown__clear:hover {
    color: var(--oe-color-primary, #036133) !important;
    background: var(--oe-color-bg-alt);
}

.oe-notif-dropdown__clear:disabled {
    opacity: 0.4;
    cursor: default;
}

.oe-notif-dropdown__clear:disabled:hover {
    color: #999 !important;
    background: transparent;
}

/* Mobile: narrower dropdown */
@media (max-width: 768px) {
    .oe-notif-dropdown {
        width: 280px;
        right: -8px;
    }
}

/* ==========================================================================
   Login Button - Compact style for dark backgrounds
   ========================================================================== */

.oe-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--oe-color-white);
    font-family: inherit;
    font-size: 0;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.oe-login-button:hover,
.oe-login-button:focus,
.oe-login-button:active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--oe-color-white);
    text-decoration: none;
}

.oe-login-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 1px;
}

.oe-login-button__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.oe-login-button__label {
    display: none;
}

/* ==========================================================================
   Create Tip Button - Compact emerald style
   ========================================================================== */

.oe-create-tip-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0.75rem;
    border: 1px solid var(--oe-color-primary-lighter);
    border-radius: 8px;
    background: var(--oe-color-primary-lighter);
    color: var(--oe-color-white);
    font-family: inherit;
    font-size: 0;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.oe-create-tip-button:hover,
.oe-create-tip-button:focus,
.oe-create-tip-button:active {
    background: var(--oe-color-primary-lighter);
    border-color: var(--oe-color-primary-lighter);
    color: var(--oe-color-white);
}

.oe-create-tip-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 1px;
}

.oe-create-tip-button:active {
    background: var(--oe-color-primary-light);
    color: var(--oe-color-white);
}

.oe-create-tip-button__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.oe-create-tip-button__label {
    display: none;
}

/* ==========================================================================
   Elementor Specificity Overrides
   Elementor widget selectors (.elementor-widget button:hover etc.) have
   specificity (0,1,1,1) which beats our component classes (0,1,1,0).
   Using .oe-header-icons parent bumps us to (0,2,x,x) to win reliably.
   ========================================================================== */

.oe-header-icons .oe-header-icons__trigger,
.oe-header-icons .oe-login-button,
.oe-header-icons .oe-create-tip-button {
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    color: var(--oe-color-white);
}

.oe-header-icons .oe-header-icons__trigger:hover,
.oe-header-icons .oe-header-icons__trigger:focus,
.oe-header-icons .oe-header-icons__trigger:active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--oe-color-white);
}

.oe-header-icons .oe-login-button:hover,
.oe-header-icons .oe-login-button:focus,
.oe-header-icons .oe-login-button:active,
.oe-header-icons .oe-login-button:visited {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--oe-color-white);
    text-decoration: none;
}

.oe-header-icons .oe-create-tip-button:hover,
.oe-header-icons .oe-create-tip-button:focus,
.oe-header-icons .oe-create-tip-button:active {
    background: var(--oe-color-primary-lighter);
    border-color: var(--oe-color-primary-lighter);
    color: var(--oe-color-white);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .oe-header-icons {
        gap: 4px;
    }

    .oe-header-icons .oe-header-icons__trigger,
    .oe-header-icons .oe-login-button,
    .oe-header-icons .oe-create-tip-button {
        min-width: 30px;
        min-height: 30px;
        padding: 7px;
        border-radius: 6px;
    }

    .oe-header-icons .oe-header-icons__icon svg,
    .oe-header-icons .oe-login-button__icon,
    .oe-header-icons .oe-create-tip-button__icon {
        width: 16px;
        height: 16px;
    }

    .oe-header-icons__badge,
    .oe-login-button__badge {
        min-width: 14px;
        height: 14px;
        font-size: 9px;
        top: -3px;
        right: -3px;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .oe-header-icons__trigger,
    .oe-login-button,
    .oe-create-tip-button {
        transition: none;
    }
}

/* ==========================================================================
   Print - Hide all header icons
   ========================================================================== */

@media print {
    .oe-header-icons,
    .oe-login-buttons,
    .oe-login-button,
    .oe-create-tip-button {
        display: none !important;
    }
}
