/**
 * FileName: assets/css/header-widget.css
 * Version:  1.0.0
 * Written based on the version: 0.3.1 (components.css)
 * Purpose: Global header widget (smart login/profile button) styles
 *
 * Decision Log:
 *   - 1.0.0 NEW: Extracted from components.css to allow lightweight global 
 *                 loading across all page types (404, archives, CPTs) without 
 *                 forcing the heavy components/forms/alerts CSS to load globally.
 *   - 1.0.0 FIX: Replaced legacy hardcoded colors with semantic tokens for dark mode safety.
 *
 * Dependencies: tokens.css
 * Impact Map: Site header across all pages
 * Used By: core.php (enqueued globally), shortcodes.php (header widget output)
 * Namespace-location: CSS classes
 * Owner: A-SUN Studio
 */

/* ═══════════════════════════════════════════════════════════════ 
   HEADER WIDGET (v0.7.2) — Guest button full width + taller      
   ═══════════════════════════════════════════════════════════════ */
.asun-header-widget {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin: 0 8px;
}

/* Guest / login button: full width inside its Elementor column */
.asun-header-widget.is-guest {
    display: block;
    width: 100%;
    margin: 0;
}

.asun-header-widget.is-guest .asun-btn {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 10px 20px;
    /* 1px taller vertically */
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 0 7px 0 7px;
    text-decoration: none;
    transition: all 0.2s ease;
    
    /* Inherit tokens since components.css isn't loaded globally */
    background: var(--color-primary);
    color: var(--text-on-primary);
    border: 2px solid var(--color-primary);
}

.asun-header-widget.is-guest .asun-btn:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--text-on-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(164, 100, 151, 0.3);
}

/* Logged-in state remains compact */
.asun-header-widget.is-logged-in {
    margin: 0;
}

.asun-header-widget.is-logged-in .asun-header-widget-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 0 7px 0 7px;
    padding: 6px 14px 6px 6px;
    transition: all 0.2s ease;
    background: transparent;
}

[dir="ltr"] .asun-header-widget.is-logged-in .asun-header-widget-link {
    padding: 6px 6px 6px 14px;
}

.asun-header-widget.is-logged-in .asun-header-widget-link:hover {
    background-color: var(--surface-primary-soft);
    transform: translateY(-1px);
}

.asun-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-muted);
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.asun-header-widget.is-logged-in .asun-header-widget-link:hover .asun-header-avatar {
    border-color: var(--color-primary);
}

.asun-header-avatar img,
.asun-header-avatar svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.asun-header-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .asun-header-name {
        max-width: 80px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .asun-header-name {
        display: none;
    }
    .asun-header-widget.is-logged-in .asun-header-widget-link {
        padding: 6px;
    }
    [dir="ltr"] .asun-header-widget.is-logged-in .asun-header-widget-link {
        padding: 6px;
    }
    .asun-header-avatar {
        width: 32px;
        height: 32px;
    }
}