/* 📄 C:\vindxit\frontend\styles\googlebutton.css
   🎨 Google Sign-In wrapper + signed-in avatar
*/

/* ─────────────────────────
   Design tokens
   ───────────────────────── */
:root {
    --gx-gap: 10px;
    --gx-radius: 12px;
    --gx-shadow: 0 6px 18px rgba(0,0,0,.08);
    --gx-border: 1px solid #e6e6e6;
    --gx-bg: #fff;
    --gx-text: #222;
    --gx-muted: #777;

    /* Avatar size control */
    --avatar-size: 64px;
    --avatar-right-offset: 80px;
}

/* Wrap the Google button iframe in a soft card (signed OUT state) */
#g_id_signin {
    display: inline-block;
    padding: 8px;
    border-radius: var(--gx-radius);
    background: var(--gx-bg);
    border: var(--gx-border);
    box-shadow: var(--gx-shadow);
    margin-right: var(--avatar-right-offset);
}

/* Signed-IN badge */
#user-badge {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 2000;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}

/* Avatar image */
#user-badge img {
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
}

/* Dropdown menu items */
#user-badge .dropdown-item {
    color: #000; /* High-contrast black for light mode */
}
#user-badge .dropdown-item:hover {
    color: #000; /* Maintain contrast on hover */
}

/* If you ever show a label next to the avatar (not used now) */
#user-badge span {
    font-weight: 600;
    line-height: 1;
}

/* Legacy sign-out button styling (kept for safety; not used) */
#user-badge button {
    margin-left: 6px;
    padding: 6px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    font: inherit;
}
#user-badge button:hover { background: #f0f0f0; }
#user-badge button:active { transform: translateY(1px); }

/* Mobile: mount badge inside header, hide sign-in button */
@media (max-width: 749px) {
    :root { 
        --avatar-size: 58px; 
    }
    header {
        position: relative;
        min-height: calc(var(--avatar-size) + 20px);
        z-index: 2000;
    }
    #g_id_signin { 
        display: none !important;
    }
    #user-badge {
        position: absolute !important;
        top: 30px !important;
        right: 30px !important;
        left: auto !important;
        margin: 0 !important;
        z-index: 3000 !important;
    }
}

/* Mobile: sign-in button in hamburger menu */
.mobile-nav .signin-slot {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    text-align: center;
}

.mobile-nav .signin-slot > div {
    display: inline-block;
    max-width: 100%;
}

/* Dark mode polish */
@media (prefers-color-scheme: dark) {
    :root {
        --gx-bg: #121212;
        --gx-text: #f3f3f3;
        --gx-muted: #aaa;
        --gx-border: 1px solid #2a2a2a;
        --gx-shadow: 0 6px 18px rgba(0,0,0,.5);
    }
    #user-badge button {
        background: #1a1a1a;
        border-color: #333;
    }
    #user-badge button:hover { background: #222; }
    #user-badge .dropdown-item {
        color: var(--gx-text); /* Near-white for dark mode */
    }
    #user-badge .dropdown-item:hover {
        color: var(--gx-text);
    }
}

@media (min-width: 750px) {
	header { position: relative; }                        /* ensure positioned ancestor */
	#g_id_signin {
		position: absolute;                                /* anchor to header box */
		top: 30px;
		right: calc(30px + var(--avatar-right-offset));
		margin: 0;
	}
}
