/* ════════════════════════════════════════════════════════════════
   EMERALD ELITE — ULTRA PREMIUM PROFILE DROPDOWN
   Marina Bet Sitev3 — Next-Level Design System
   ════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Urbanist:wght@700;800;900&display=swap');

/* ─── CSS Variables ─── */
:root {
    --emerald: #1C87B7;
    --emerald-dark: #006ea0;
    --emerald-glow: rgba(16, 158, 202, 0.35);
    --emerald-soft: rgba(16, 158, 202, 0.12);
    --panel-bg: rgba(8, 14, 20, 0.96);
    --panel-border: rgba(16, 158, 202, 0.15);
    --panel-surface: rgba(255, 255, 255, 0.035);
    --text-primary: #f0f6f8;
    --text-secondary: rgba(240, 246, 248, 0.5);
    --text-muted: rgba(240, 246, 248, 0.28);
    --danger: #ff4d6d;
    --danger-soft: rgba(255, 77, 109, 0.12);
}

/* ════════════════════════════════════════════════
   TRIGGER BUTTON
════════════════════════════════════════════════ */
.user-profile-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 5px 5px 14px;
    background: rgba(16, 158, 202, 0.05);
    border: 1px solid rgba(16, 158, 202, 0.2);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
    position: relative;
    overflow: hidden;
}

.profile-trigger::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 158, 202,0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.25s;
    border-radius: inherit;
}

.profile-trigger:hover::before {
    opacity: 1;
}

.profile-trigger:hover {
    background: rgba(16, 158, 202, 0.1);
    border-color: rgba(16, 158, 202, 0.4);
    box-shadow: 0 0 0 3px rgba(16, 158, 202, 0.08), 0 4px 20px rgba(16, 158, 202, 0.12);
    transform: translateY(-1px);
}

.profile-trigger:active {
    transform: translateY(0) scale(0.98);
}

/* ─── Avatar (trigger) ─── */
.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1C87B7 0%, #005b84 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 15px;
    color: #020e14;
    flex-shrink: 0;
    box-shadow:
        0 0 0 2px rgba(16, 158, 202, 0.3),
        0 0 20px rgba(16, 158, 202, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    font-family: 'Urbanist', sans-serif;
    letter-spacing: -0.5px;
    transition: box-shadow 0.25s;
}

.profile-trigger:hover .profile-avatar {
    box-shadow:
        0 0 0 2px rgba(16, 158, 202, 0.5),
        0 0 28px rgba(16, 158, 202, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ─── Info text ─── */
.profile-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-username {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    font-family: 'Urbanist', sans-serif;
    line-height: 1;
}

.profile-balance {
    color: var(--emerald);
    font-weight: 700;
    font-size: 11.5px;
    font-family: 'Inter', sans-serif;
    line-height: 1;
    letter-spacing: 0.2px;
}

/* ─── Chevron arrow ─── */
.profile-arrow {
    color: rgba(16, 158, 202, 0.5);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
    flex-shrink: 0;
    margin-left: 2px;
}

.user-profile-dropdown.open .profile-arrow {
    transform: rotate(180deg);
    color: var(--emerald);
}

/* ════════════════════════════════════════════════
   DROPDOWN PANEL — GLASSMORPHISM CARD
════════════════════════════════════════════════ */
.profile-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 310px;
    background: linear-gradient(160deg, rgba(10, 18, 26, 0.98) 0%, rgba(5, 12, 18, 0.99) 100%);
    border: 1px solid rgba(16, 158, 202, 0.18);
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(16, 158, 202, 0.08),
        0 4px 6px rgba(0, 0, 0, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.75),
        0 0 80px rgba(16, 158, 202, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1), visibility 0.25s;
    z-index: 10000;
    overflow: hidden;
    overflow-y: auto;
    max-height: min(700px, 90vh);
    pointer-events: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 158, 202, 0.3) transparent;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Webkit scrollbar */
.profile-menu::-webkit-scrollbar { width: 4px; }
.profile-menu::-webkit-scrollbar-track { background: transparent; margin: 8px 0; }
.profile-menu::-webkit-scrollbar-thumb { background: rgba(16, 158, 202, 0.25); border-radius: 99px; }
.profile-menu::-webkit-scrollbar-thumb:hover { background: rgba(16, 158, 202, 0.45); }

.profile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Top glow line */
.profile-menu::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, rgba(16, 158, 202,0.6) 40%, rgba(16, 158, 202,0.8) 50%, rgba(16, 158, 202,0.6) 60%, transparent 95%);
    z-index: 1;
}

/* Subtle ambient glow inside */
.profile-menu::after {
    content: '';
    position: absolute;
    top: -60px;
    right: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(16, 158, 202,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ════════════════════════════════════════════════
   HEADER — USER INFO
════════════════════════════════════════════════ */
.profile-menu-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 18px 16px;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, rgba(16, 158, 202,0.06) 0%, transparent 65%);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.profile-menu-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #009be0 0%, #006ea0 50%, #004666 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 22px;
    color: #000;
    flex-shrink: 0;
    box-shadow:
        0 0 0 2.5px rgba(16, 158, 202,0.35),
        0 0 24px rgba(16, 158, 202,0.3),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 0 rgba(0,0,0,0.2);
    font-family: 'Urbanist', sans-serif;
    letter-spacing: -0.5px;
    position: relative;
}

/* Online dot */
.profile-menu-avatar::after {
    content: '';
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background: #1C87B7;
    border-radius: 50%;
    border: 2px solid rgba(8, 14, 20, 0.98);
    box-shadow: 0 0 6px rgba(0, 155, 224, 0.8);
    animation: pulseOnline 2s ease-in-out infinite;
}

@keyframes pulseOnline {
    0%, 100% { box-shadow: 0 0 6px rgba(0, 155, 224, 0.8); }
    50% { box-shadow: 0 0 12px rgba(0, 155, 224, 1), 0 0 20px rgba(0, 155, 224, 0.4); }
}

.profile-menu-info {
    flex: 1;
    min-width: 0;
}

.profile-menu-name {
    color: var(--text-primary);
    font-weight: 800;
    font-size: 15px;
    font-family: 'Urbanist', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.profile-menu-email {
    color: var(--text-secondary);
    font-size: 11.5px;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* ════════════════════════════════════════════════
   BALANCE CARD — PREMIUM
════════════════════════════════════════════════ */
.profile-menu-balance {
    margin: 14px 14px 0;
    padding: 16px 18px;
    background:
        linear-gradient(135deg, rgba(16, 158, 202,0.1) 0%, rgba(0, 69, 100, 0.05) 100%);
    border: 1px solid rgba(16, 158, 202,0.22);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

/* Shimmering background line on balance card */
.profile-menu-balance::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px; right: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(16, 158, 202,0.6), transparent);
}

.profile-menu-balance::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(16, 158, 202,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.bal-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 1;
}

.balance-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-family: 'Inter', sans-serif;
}

.balance-amount {
    font-family: 'Urbanist', sans-serif;
    color: var(--emerald);
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1;
    text-shadow: 0 0 24px rgba(16, 158, 202,0.5);
    transition: text-shadow 0.3s;
    background: linear-gradient(135deg, #00a0e8 0%, #1C87B7 50%, #006ea0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-menu-balance:hover .balance-amount {
    text-shadow: 0 0 30px rgba(16, 158, 202,0.7);
}

.bal-deposit-btn {
    background: linear-gradient(135deg, #009be0 0%, #1C87B7 45%, #006390 100%);
    border: none;
    border-radius: 11px;
    padding: 11px 18px;
    color: #00121a;
    font-size: 12.5px;
    font-weight: 900;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    z-index: 1;
    box-shadow:
        0 4px 20px rgba(16, 158, 202,0.45),
        0 1px 0 rgba(255,255,255,0.25) inset,
        0 -1px 0 rgba(0,0,0,0.15) inset;
    letter-spacing: 0.3px;
    overflow: hidden;
}

.bal-deposit-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: rgba(255,255,255,0.2);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.bal-deposit-btn:hover::after {
    left: 130%;
}

.bal-deposit-btn:hover {
    background: linear-gradient(135deg, #00b0ff 0%, #009be0 45%, #0079b0 100%);
    box-shadow:
        0 8px 28px rgba(16, 158, 202,0.65),
        0 1px 0 rgba(255,255,255,0.3) inset;
    transform: translateY(-2px) scale(1.04);
    color: #000;
}

.bal-deposit-btn:active {
    transform: translateY(0) scale(0.98);
}

/* ════════════════════════════════════════════════
   QUICK ACTION BUTTONS
════════════════════════════════════════════════ */
.profile-quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 14px 0;
}

.pql-item {
    background: var(--panel-surface);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.pql-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 158, 202,0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: inherit;
}

.pql-item:hover::before { opacity: 1; }

.pql-item:hover {
    background: rgba(16, 158, 202,0.07);
    border-color: rgba(16, 158, 202,0.25);
    color: var(--emerald);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3), 0 0 0 1px rgba(16, 158, 202,0.1);
}

.pql-item:active { transform: translateY(0); }

.pql-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.4);
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.06);
}

.pql-item:hover .pql-icon {
    background: rgba(16, 158, 202,0.15);
    border-color: rgba(16, 158, 202,0.25);
    color: var(--emerald);
    box-shadow: 0 0 10px rgba(16, 158, 202,0.2);
}

/* ════════════════════════════════════════════════
   DIVIDER
════════════════════════════════════════════════ */
.profile-menu-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06) 30%, rgba(255,255,255,0.06) 70%, transparent);
    margin: 12px 14px;
}

/* ════════════════════════════════════════════════
   MENU ITEMS
════════════════════════════════════════════════ */
.profile-menu-items {
    padding: 0 8px;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    overflow: hidden;
}

.profile-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 2.5px;
    background: linear-gradient(180deg, var(--emerald), var(--emerald-dark));
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transform: scaleY(0.5);
    transition: opacity 0.18s, transform 0.18s;
}

.profile-menu-item:hover {
    background: rgba(16, 158, 202,0.06);
    color: var(--text-primary);
    padding-left: 16px;
}

.profile-menu-item:hover::before {
    opacity: 1;
    transform: scaleY(1);
}

.pmi-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    transition: all 0.18s;
    color: rgba(255,255,255,0.4);
}

.profile-menu-item:hover .pmi-icon {
    background: rgba(16, 158, 202,0.12);
    border-color: rgba(16, 158, 202,0.22);
    color: var(--emerald);
    box-shadow: 0 0 10px rgba(16, 158, 202,0.15);
}

/* ─── Accordion chevron ─── */
.profile-menu-item svg[id*="chevron"] {
    transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* ════════════════════════════════════════════════
   LOGOUT BUTTON — PREMIUM DANGER
════════════════════════════════════════════════ */
.profile-menu-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 16px);
    margin: 4px 8px 14px;
    padding: 11px 14px;
    background: rgba(255,77,109,0.05);
    border: 1px solid rgba(255,77,109,0.15);
    border-radius: 10px;
    color: rgba(255,100,130,0.75);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: left;
    letter-spacing: 0.2px;
    position: relative;
    overflow: hidden;
}

.profile-menu-logout::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,77,109,0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: inherit;
}

.profile-menu-logout:hover::before { opacity: 1; }

.profile-menu-logout:hover {
    background: rgba(255,77,109,0.1);
    border-color: rgba(255,77,109,0.35);
    color: #ff6b88;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,77,109,0.15);
}

.profile-menu-logout:active {
    transform: translateY(0);
}

.profile-menu-logout svg {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.profile-menu-logout span {
    position: relative;
    z-index: 1;
}

/* ════════════════════════════════════════════════
   RESPONSIVE — MOBILE
════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .profile-info {
        display: none;
    }

    .profile-trigger {
        padding: 4px 4px 4px 4px;
        gap: 0;
    }

    body > .profile-menu,
    .profile-menu {
        width: 295px;
        position: fixed !important;
        top: 62px !important;
        right: 10px !important;
        left: auto !important;
        z-index: 99999 !important;
    }

    .mob-profile-btn {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
}

/* ════════════════════════════════════════════════
   KİŞİSEL DETAYLAR PANELİ — ACCORDION
════════════════════════════════════════════════ */
.personal-details-panel {
    margin: 6px 8px 10px 8px;
    background: linear-gradient(135deg, rgba(16, 158, 202,0.05) 0%, rgba(0,0,0,0.2) 100%);
    border: 1px solid rgba(16, 158, 202,0.14);
    border-radius: 14px;
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
    animation: pdSlideIn 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.personal-details-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(16, 158, 202,0.4), transparent);
}

@keyframes pdSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pd-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.pd-row:last-of-type { border-bottom: none; }

.pd-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    flex-shrink: 0;
    white-space: nowrap;
}

.pd-label svg { opacity: 0.5; flex-shrink: 0; }

.pd-value {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
    word-break: break-all;
    max-width: 160px;
    line-height: 1.3;
}

/* ─── Action buttons inside accordion ─── */
.pd-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

.pd-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    letter-spacing: 0.2px;
    font-family: 'Inter', sans-serif;
}

.pd-action-deposit {
    background: linear-gradient(135deg, rgba(16, 158, 202,0.18), rgba(0, 83, 120, 0.1));
    border: 1px solid rgba(16, 158, 202,0.3);
    color: var(--emerald);
}

.pd-action-deposit:hover {
    background: linear-gradient(135deg, rgba(16, 158, 202,0.3), rgba(0, 110, 160, 0.2));
    border-color: rgba(16, 158, 202,0.55);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 158, 202,0.2);
    color: var(--emerald);
}

.pd-action-withdraw {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
}

.pd-action-withdraw:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ─── Accordion trigger highlight ─── */
#personal-accordion,
#history-accordion {
    transition: background 0.2s, padding-left 0.2s;
}