/**
 * © 2026 Ömer Berat Keser
 */

.user-profile-dropdown {
    position: relative;
    z-index: 1000;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 8px 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

/* Animated gradient border */
.user-profile-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #22d3ee, #6366f1);
    background-size: 300% 100%;
    border-radius: 50px;
    z-index: -2;
    animation: borderGlow 3s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-profile-btn::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 50px;
    z-index: -1;
}

@keyframes borderGlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

.user-profile-btn:hover::before {
    opacity: 1;
}

.user-profile-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 10px 40px rgba(99, 102, 241, 0.4),
        0 0 20px rgba(139, 92, 246, 0.3);
}

/* Avatar with pulse animation */
.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #22d3ee 100%);
    background-size: 200% 200%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    animation: avatarGradient 4s ease infinite;
    position: relative;
}

@keyframes avatarGradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.user-avatar::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #22d3ee) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    animation: avatarRing 2s ease-in-out infinite;
}

@keyframes avatarRing {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: linear-gradient(90deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-profile-btn .dropdown-arrow {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #22d3ee;
}

.user-profile-dropdown:has(.user-dropdown-menu.show) .dropdown-arrow {
    transform: rotate(180deg);
}

/* ============ DROPDOWN MENU - GLASSMORPHISM ============ */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 300px;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 0;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(99, 102, 241, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Animated top border */
.user-dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #22d3ee);
    background-size: 200% 100%;
    animation: gradientSlide 2s linear infinite;
}

@keyframes gradientSlide {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

/* Header */
.dropdown-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    position: relative;
    overflow: hidden;
}

/* Animated particles in header */
.dropdown-header::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    top: -50px;
    right: -30px;
    animation: headerGlow 3s ease-in-out infinite;
}

@keyframes headerGlow {

    0%,
    100% {
        transform: scale(1) translate(0, 0);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2) translate(-10px, 10px);
        opacity: 0.8;
    }
}

.header-avatar {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #22d3ee 100%);
    background-size: 200% 200%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    animation: avatarGradient 4s ease infinite;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    position: relative;
}

.header-avatar::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.5);
    animation: avatarPulse 2s ease-in-out infinite;
}

@keyframes avatarPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0;
    }
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    z-index: 1;
}

.header-name {
    font-weight: 700;
    font-size: 17px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-email {
    font-size: 12px;
    color: #8892a6;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
    margin-top: 5px;
}

.header-badge.admin {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    animation: badgeGlow 2s ease-in-out infinite;
}

@keyframes badgeGlow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(239, 68, 68, 0.7);
    }
}

.header-badge.user {
    background: rgba(34, 211, 238, 0.2);
    color: #22d3ee;
    border: 1px solid rgba(34, 211, 238, 0.4);
}

/* Divider with gradient */
.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    margin: 0;
}

/* Menu Items with hover effects */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    color: #a0aec0;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, #6366f1, #22d3ee);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.dropdown-item:hover::before {
    transform: scaleY(1);
}

.dropdown-item:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
    color: #fff;
    padding-left: 28px;
}

.dropdown-item i {
    width: 22px;
    text-align: center;
    font-size: 16px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.dropdown-item:hover i {
    transform: scale(1.2);
    color: #22d3ee;
}

.dropdown-item.admin-item {
    color: #fca5a5;
}

.dropdown-item.admin-item:hover {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, transparent 100%);
    color: #ef4444;
}

.dropdown-item.admin-item:hover i {
    color: #ef4444;
}

.dropdown-item.logout-item {
    color: #f87171;
}

.dropdown-item.logout-item:hover {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, transparent 100%);
    color: #ef4444;
}

.dropdown-item.logout-item:hover i {
    color: #ef4444;
    animation: shake 0.5s ease-in-out;
}

/* Danger item - Hesabımı Sil */
.dropdown-item.danger-item {
    color: #fca5a5;
}

.dropdown-item.danger-item:hover {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.2) 0%, transparent 100%);
    color: #dc2626;
}

.dropdown-item.danger-item:hover i {
    color: #dc2626;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .user-name {
        display: none;
    }

    .user-profile-btn {
        padding: 10px;
    }

    .user-dropdown-menu {
        width: 280px;
        right: -10px;
    }
}
