/* SaveBite – Authentication, Profile & Admin Styles */

/* ─── Google OAuth button ────────────────────────────────────── */
.btn-google-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.btn-google-oauth:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
}
.btn-google-oauth svg {
    flex-shrink: 0;
}

/* ─── Input types not covered by modals.css ──────────────── */
input[type="email"],
input[type="password"],
input[type="url"] {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text-main);
    outline: none;
    font-size: 0.92rem;
    transition: var(--transition);
    box-sizing: border-box;
}
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.08);
}

/* ─── Auth Modal ─────────────────────────────────────────── */
.auth-modal-content {
    max-width: 430px;
}

.auth-modal-body {
    padding: 2rem 2rem 1.5rem;
    position: relative;
}

.auth-modal-body > .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Logo inside auth modal */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    justify-content: center;
    margin-bottom: 1.75rem;
}
.auth-logo .logo-icon {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.auth-logo .logo-icon svg { width: 20px; height: 20px; }
.auth-logo .logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}
.auth-logo .logo-text span { color: var(--primary); }

/* Tab switcher */
.auth-tabs {
    display: flex;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 1.5rem;
    gap: 2px;
}
.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.55rem 1rem;
    border-radius: calc(var(--radius-sm) - 2px);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    font-family: inherit;
}
.auth-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(16,185,129,0.35);
}

/* Google Sign-In container */
.google-signin-container {
    margin-bottom: 0.5rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.google-not-configured {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-muted);
    box-sizing: border-box;
}
.google-not-configured code {
    color: var(--accent);
    background: rgba(59,130,246,0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.78rem;
}

/* OR divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.85rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* Auth forms */
#auth-login-section .form-group,
#auth-register-section .form-group {
    margin-bottom: 0.9rem;
}
#auth-login-section label,
#auth-register-section label {
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

.auth-submit-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Error message */
.auth-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    font-size: 0.83rem;
    color: #ef4444;
    margin-bottom: 0.75rem;
}

/* Switch link */
.auth-switch-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
    margin-bottom: 0;
}
.auth-switch-text button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0;
    font-family: inherit;
}
.auth-switch-text button:hover { text-decoration: underline; }

/* Highlight khi login lỗi – gợi ý đăng ký */
.auth-switch-text.hint-highlight {
    color: var(--primary);
    font-weight: 500;
    animation: hint-slide-in 0.35s ease;
}
.auth-switch-text.hint-highlight button {
    animation: hint-pulse-btn 0.8s ease 0.2s 2;
}
@keyframes hint-slide-in {
    from { opacity: 0.3; transform: translateY(4px); }
    to   { opacity: 1;   transform: translateY(0); }
}
@keyframes hint-pulse-btn {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* ─── Header auth section ─────────────────────────────────── */
.auth-header-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.btn-auth-outline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(14,14,16,.12);
    border-radius: 100px;
    background: white;
    color: #0E0E10;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    transition: box-shadow .2s, transform .2s;
    white-space: nowrap;
}
.btn-auth-outline:hover,
.btn-auth-outline.active {
    box-shadow: 0 4px 12px rgba(14,14,16,.1);
    transform: translateY(-1px);
}
.btn-auth-outline svg { width: 15px; height: 15px; }

/* ─── Profile menu wrapper & dropdown ────────────────────── */
.profile-menu-wrapper {
    position: relative;
}

#profile-avatar-trigger {
    cursor: pointer;
    position: relative;
    display: block;
}

.avatar-role-dot {
    position: absolute;
    bottom: -2px; right: -2px;
    width: 11px; height: 11px;
    border-radius: 50%;
    border: 2px solid #FAF9F6;
    background: var(--text-muted);
}
.avatar-role-dot.admin    { background: var(--secondary); }
.avatar-role-dot.business { background: #3b82f6; }
.avatar-role-dot.user     { background: var(--primary); }

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    background: #FAF9F6;
    border: 1px solid rgba(14,14,16,.1);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(14,14,16,.12);
    width: 250px;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    overflow: hidden;
}
.profile-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-user-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
}
.dropdown-avatar-img {
    width: 46px; height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    flex-shrink: 0;
    background: var(--surface-alt);
}
.dropdown-user-details { min-width: 0; }
.dropdown-user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #0E0E10;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-user-email {
    font-size: 0.76rem;
    color: #6B6B72;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

/* Role badge – used in dropdown and admin panel */
.user-role-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.user-role-badge.user  {
    background: rgba(16,185,129,0.15);
    color: var(--primary);
}
.user-role-badge.admin {
    background: rgba(249,115,22,0.15);
    color: var(--secondary);
}
.user-role-badge.business {
    background: rgba(59,130,246,0.15);
    color: #3b82f6;
}
.user-role-badge.guest {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: rgba(14,14,16,.08);
    margin: 0.25rem 0;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.87rem;
    color: #0E0E10;
    text-align: left;
    transition: background 0.15s;
    font-family: inherit;
}
.dropdown-item:hover { background: rgba(14,14,16,.05); }
.dropdown-item.danger { color: #ef4444; }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.06); }

/* ─── Profile Settings Modal ─────────────────────────────── */
.settings-section {
    padding: 1.25rem;
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}
.settings-section:last-child { margin-bottom: 0; }
.settings-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.profile-avatar-edit {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}
.settings-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    background: var(--surface);
}
.settings-avatar-wrap {
    position: relative;
    width: 72px; height: 72px;
    flex-shrink: 0;
    cursor: pointer;
}
.settings-avatar-overlay {
    position: absolute;
    bottom: -2px; right: -2px;
    width: 26px; height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--surface);
    color: #fff;
    transition: background 0.15s;
}
.settings-avatar-overlay i { width: 14px; height: 14px; }
.settings-avatar-wrap:hover .settings-avatar-overlay { background: var(--primary-hover); }
.settings-avatar-reset {
    background: none;
    border: none;
    padding: 0;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
}
.settings-avatar-reset:hover { color: var(--text-main); }

.settings-section .btn-primary {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ─── Admin: User Management Panel ──────────────────────── */
.admin-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}
.admin-user-card:hover { background: rgba(255,255,255,0.04); }
.admin-user-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-alt);
    border: 1px solid var(--border-color);
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.admin-user-email {
    font-size: 0.77rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-user-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}
.admin-user-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* Warning button for demote action */
.dash-btn-small.warning:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

/* Admin-only tab styling */
.dash-tab-btn.admin-tab {
    color: var(--secondary);
}
.dash-tab-btn.admin-tab.active {
    background: var(--secondary);
    color: white;
    box-shadow: 0 2px 8px rgba(249,115,22,0.3);
}

/* Business + Admin tab styling */
.dash-tab-btn.biz-tab {
    color: #f59e0b;
}
.dash-tab-btn.biz-tab.active {
    background: #f59e0b;
    color: white;
    box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}

/* Admin section header */
.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}
.admin-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-user-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

/* ─── Business Apply Status ──────────────────────────────── */
.ba-status {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.ba-status.pending {
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.3);
    color: #fbbf24;
}
.ba-status.rejected {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.25);
    color: #ef4444;
}

/* ─── MoMo e-Wallet: Payment Method Section ─────────────── */
.payment-method-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.payment-method-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #a50064;
}
.payment-method-info {
    flex: 1;
    min-width: 0;
}
.payment-method-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}
.payment-method-status {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}
.payment-method-status.linked {
    color: #10b981;
}
.btn-momo-link {
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #a50064;
    background: rgba(165,0,100,0.12);
    color: #d4007e;
    transition: background 0.15s;
    flex-shrink: 0;
}
.btn-momo-link:hover {
    background: rgba(165,0,100,0.22);
}
.btn-momo-link.unlink {
    border-color: rgba(239,68,68,0.4);
    background: rgba(239,68,68,0.08);
    color: #ef4444;
}
.btn-momo-link.unlink:hover {
    background: rgba(239,68,68,0.16);
}
.momo-link-form {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(165,0,100,0.06);
    border: 1px solid rgba(165,0,100,0.2);
    border-radius: var(--radius-sm);
}
.momo-link-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.btn-momo-save {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: #a50064;
    color: #fff;
    transition: background 0.15s;
}
.btn-momo-save:hover { background: #870050; }
.btn-momo-cancel {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    transition: background 0.15s;
}
.btn-momo-cancel:hover { background: rgba(255,255,255,0.05); }

/* ─── MoMo Payment Modal ─────────────────────────────────── */
.momo-payment-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem 0 1.25rem;
    gap: 0.5rem;
}
.momo-payment-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #a50064;
    display: flex;
    align-items: center;
    justify-content: center;
}
.momo-payment-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}
.momo-payment-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.momo-payment-info-box {
    background: rgba(165,0,100,0.07);
    border: 1px solid rgba(165,0,100,0.2);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.momo-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.875rem;
}
.momo-info-row:not(:last-child) {
    border-bottom: 1px solid rgba(165,0,100,0.12);
}
.momo-info-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.momo-info-value {
    font-weight: 600;
    color: var(--text-main);
}
.momo-info-value.amount {
    color: #a50064;
    font-size: 1.05rem;
}
.btn-momo-open-app {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: #a50064;
    color: #fff;
    text-decoration: none;
    transition: background 0.15s;
    margin-bottom: 0.75rem;
}
.btn-momo-open-app:hover { background: #870050; }
.momo-divider {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0.75rem;
    position: relative;
}
.momo-divider::before, .momo-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: var(--border-color);
}
.momo-divider::before { left: 0; }
.momo-divider::after  { right: 0; }
.btn-momo-confirmed {
    width: 100%;
    padding: 0.7rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid #a50064;
    background: rgba(165,0,100,0.1);
    color: #a50064;
    transition: all 0.15s;
    margin-bottom: 0.5rem;
}
.btn-momo-confirmed:hover {
    background: rgba(165,0,100,0.18);
}
.btn-momo-cancel-req {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.4rem;
    text-decoration: underline;
    transition: color 0.15s;
}
.btn-momo-cancel-req:hover { color: #ef4444; }

/* ─── MoMo Status Badges (dashboard) ────────────────────── */
.momo-deposit-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    margin-top: 0.25rem;
}
.momo-deposit-badge.pending {
    background: rgba(251,191,36,0.12);
    color: #f59e0b;
    border: 1px solid rgba(251,191,36,0.3);
}
.momo-deposit-badge.paid {
    background: rgba(16,185,129,0.1);
    color: #10b981;
    border: 1px solid rgba(16,185,129,0.25);
}
.momo-deposit-badge.refunded {
    background: rgba(59,130,246,0.1);
    color: #3b82f6;
    border: 1px solid rgba(59,130,246,0.25);
}
.momo-deposit-badge.forfeited {
    background: rgba(239,68,68,0.08);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.25);
}
.momo-deposit-badge.none {
    background: rgba(251,191,36,0.12);
    color: #f59e0b;
    border: 1px solid rgba(251,191,36,0.3);
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .auth-modal-content { max-width: 95%; }
    .auth-modal-body { padding: 1.5rem 1.25rem 1.25rem; }
    .profile-dropdown { width: 220px; }
    .btn-auth-outline span { display: none; }
    .btn-auth-outline { padding: 0.45rem 0.65rem; }
}

/* ── Dark Mode Auth Overrides ── */
[data-theme="dark"] .avatar-role-dot { border-color: var(--bg-dark); }
[data-theme="dark"] .profile-dropdown {
    background: #1a2540;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
[data-theme="dark"] .dropdown-user-name { color: #f8fafc; }
[data-theme="dark"] .dropdown-user-email { color: #94a3b8; }
[data-theme="dark"] .dropdown-item { color: #f8fafc; }
[data-theme="dark"] .dropdown-item:hover { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .dropdown-divider { background: rgba(255,255,255,0.08); }
