/**
 * ============================================================================
 * ULTIMATE SIDEBAR - Orange/Red Theme
 * Die beste Sidebar für eingeloggte User mit allen wichtigen Informationen
 * ============================================================================
 */

/* ===========================
   OFFCANVAS SIDEBAR CONTAINER
   =========================== */
.offcanvas-menu-wrap {
    position: fixed !important;
    top: 0 !important;
    right: -450px !important; /* Hidden by default */
    width: 450px !important;
    height: 100vh !important;
    z-index: 99999 !important;
    background: linear-gradient(165deg,
        rgba(255, 102, 0, 0.98) 0%,
        rgba(255, 51, 0, 0.98) 40%,
        rgba(220, 20, 60, 0.98) 70%,
        rgba(139, 0, 0, 0.98) 100%) !important;
    backdrop-filter: blur(60px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(60px) saturate(180%) !important;
    box-shadow:
        -15px 0 50px rgba(0, 0, 0, 0.5),
        -5px 0 25px rgba(255, 102, 0, 0.3),
        inset 1px 0 1px rgba(255, 255, 255, 0.1) !important;
    transition: right 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border-left: 2px solid rgba(255, 215, 0, 0.3) !important;
}

/* Animated background pattern */
.offcanvas-menu-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 102, 0, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 51, 0, 0.1) 0%, transparent 70%);
    opacity: 0.6;
    animation: backgroundPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Offcanvas Open State */
.offcanvas-menu-wrap.show {
    right: 0 !important;
}

/* Scrollbar Styling */
.offcanvas-menu-wrap::-webkit-scrollbar {
    width: 8px;
}

.offcanvas-menu-wrap::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.offcanvas-menu-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.offcanvas-menu-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ===========================
   CLOSE BUTTON
   =========================== */
.offcanvas-icon {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    z-index: 10 !important;
}

.offcanvas-icon:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: rotate(90deg) scale(1.1) !important;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3) !important;
}

.offcanvas-icon svg {
    width: 24px !important;
    height: 24px !important;
}

/* ===========================
   OFFCANVAS BODY
   =========================== */
.offcanvas-body {
    padding: 80px 24px 24px !important;
}

/* ===========================
   USER INFO SECTION (Logged In)
   =========================== */
.sidebar-user-info {
    position: relative;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 24px;
    padding: 36px 28px;
    margin-bottom: 28px;
    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 215, 0, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
    animation: slideInFromRight 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

/* Glowing effect on hover */
.sidebar-user-info:hover {
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Animated corner accent */
.sidebar-user-info::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 50%, rgba(255, 215, 0, 0.3) 50%);
    border-radius: 0 24px 0 100px;
    pointer-events: none;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* User Avatar Container */
.user-avatar-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 24px;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

.user-avatar-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255, 215, 0, 0.8);
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.8),
        0 10px 40px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(255, 215, 0, 0.3);
    animation: avatarPulse 3s ease-in-out infinite;
    transform-style: preserve-3d;
    z-index: 2;
    /* Fix for graphic glitches */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.user-avatar-wrapper:hover {
    transform: scale(1.08) rotateZ(5deg);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes avatarPulse {
    0%, 100% {
        box-shadow:
            0 0 30px rgba(255, 215, 0, 0.8),
            0 10px 40px rgba(0, 0, 0, 0.6),
            inset 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow:
            0 0 50px rgba(255, 215, 0, 1),
            0 10px 50px rgba(0, 0, 0, 0.7),
            inset 0 0 30px rgba(255, 215, 0, 0.5);
    }
}

.user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    /* Fallback for broken images */
    background: linear-gradient(135deg, #FF6600, #FF0000);
}

/* Discord Avatar specific styling */
.user-avatar[src*="cdn.discordapp.com"] {
    /* Discord avatars are already optimized */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Avatar loading state */
.user-avatar-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #FF6600, #FF0000);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-avatar-wrapper.loading::after {
    opacity: 1;
}

/* Error handling for broken images */
.user-avatar:not([src]),
.user-avatar[src=""],
.user-avatar[src*="gravatar.com/avatar/00000000"] {
    /* Show placeholder for missing avatars */
    background: linear-gradient(135deg, #FF6600 0%, #FF0000 100%);
}

.user-avatar:not([src])::before,
.user-avatar[src=""]::before {
    content: '👤';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    opacity: 0.5;
}

/* Avatar Border Animation - FIXED */
.avatar-border-animation {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6600, #FF0000, #FFD700, #FF6600);
    background-size: 400% 400%;
    animation: gradientRotate 4s ease infinite;
    z-index: 0;
    /* Fix for graphic glitches */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

@keyframes gradientRotate {
    0% {
        background-position: 0% 50%;
        transform: translateZ(0) rotate(0deg);
    }
    50% {
        background-position: 100% 50%;
        transform: translateZ(0) rotate(180deg);
    }
    100% {
        background-position: 0% 50%;
        transform: translateZ(0) rotate(360deg);
    }
}

/* Level Badge */
.user-level-badge {
    position: absolute;
    bottom: -12px;
    right: -12px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF6600 100%);
    border: 4px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 6px 20px rgba(255, 102, 0, 0.8),
        0 0 30px rgba(255, 215, 0, 0.6),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    animation: levelBounce 2.5s ease-in-out infinite;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-level-badge:hover {
    transform: scale(1.15) rotate(15deg) !important;
    box-shadow:
        0 10px 30px rgba(255, 102, 0, 1),
        0 0 50px rgba(255, 215, 0, 0.9),
        inset 0 2px 5px rgba(255, 255, 255, 0.5);
}

.user-level-badge::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #FFD700, #FF6600, #FFD700);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotateBorder 3s linear infinite;
}

@keyframes rotateBorder {
    to { transform: rotate(360deg); }
}

@keyframes levelBounce {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.12) rotate(8deg);
    }
    50% {
        transform: scale(1) rotate(0deg);
    }
    75% {
        transform: scale(1.08) rotate(-8deg);
    }
}

.level-number {
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    text-shadow:
        0 3px 10px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 215, 0, 0.8);
    position: relative;
    z-index: 1;
}

/* User Details */
.user-details {
    text-align: center;
    margin-bottom: 24px;
}

.user-greeting {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-display-name {
    font-size: 24px;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.user-discord {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
    margin: 0 auto 12px;
    width: fit-content;
}

.user-discord i {
    color: #5865F2;
    font-size: 16px;
}

/* Rank Badge */
.user-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #FFD700;
    padding: 8px 20px;
    border-radius: 24px;
    margin-top: 8px;
}

.rank-icon {
    font-size: 20px;
    animation: rankShine 2s ease-in-out infinite;
}

@keyframes rankShine {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.5);
    }
}

.rank-text {
    font-size: 16px;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ===========================
   XP PROGRESS BAR
   =========================== */
.user-xp-container {
    margin-bottom: 24px;
}

.xp-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.xp-numbers {
    color: #FFD700;
    font-weight: 700;
}

.xp-bar-container {
    position: relative;
    margin-bottom: 8px;
}

.xp-bar-bg {
    height: 32px;
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.5) 100%);
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow:
        inset 0 3px 12px rgba(0, 0, 0, 0.6),
        0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

.xp-bar-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 215, 0, 0.1) 50%,
        transparent 100%);
    animation: xpBarShine 3s ease-in-out infinite;
}

@keyframes xpBarShine {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg,
        #FFD700 0%,
        #FF8C00 25%,
        #FF6600 50%,
        #FF4500 75%,
        #FF0000 100%);
    border-radius: 16px;
    position: relative;
    transition: width 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow:
        0 0 20px rgba(255, 102, 0, 0.8),
        inset 0 2px 5px rgba(255, 255, 255, 0.4),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3);
    animation: xpPulse 2s ease-in-out infinite;
    overflow: hidden;
}

.xp-bar-fill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.3) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.2) 100%);
    border-radius: 16px;
}

@keyframes xpPulse {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(255, 102, 0, 0.8),
            inset 0 2px 5px rgba(255, 255, 255, 0.4),
            inset 0 -2px 5px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow:
            0 0 35px rgba(255, 102, 0, 1),
            inset 0 2px 8px rgba(255, 255, 255, 0.6),
            inset 0 -2px 8px rgba(0, 0, 0, 0.4);
    }
}

.xp-bar-glow {
    position: absolute;
    top: 0;
    left: -100%;
    right: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%);
    animation: xpGlowSlide 2.5s ease-in-out infinite;
}

@keyframes xpGlowSlide {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(200%);
    }
}

/* ===========================
   USER STATS GRID
   =========================== */
.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-item {
    position: relative;
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.1) 0%,
        rgba(255, 102, 0, 0.1) 100%);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 20px 12px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    animation: statFadeIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) backwards;
    overflow: hidden;
    box-shadow:
        0 5px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-item:nth-child(1) {
    animation-delay: 0.1s;
    border-color: rgba(100, 200, 255, 0.4);
}

.stat-item:nth-child(2) {
    animation-delay: 0.2s;
    border-color: rgba(255, 215, 0, 0.4);
}

.stat-item:nth-child(3) {
    animation-delay: 0.3s;
    border-color: rgba(255, 100, 50, 0.4);
}

@keyframes statFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-item:hover {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.2) 0%,
        rgba(255, 102, 0, 0.2) 100%);
    transform: translateY(-8px) scale(1.08) rotateZ(2deg);
    box-shadow:
        0 15px 40px rgba(255, 102, 0, 0.6),
        0 0 30px rgba(255, 215, 0, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 215, 0, 0.8);
}

.stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
    animation: statIconBounce 2s ease-in-out infinite;
}

@keyframes statIconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.stat-value {
    font-size: 24px;
    font-weight: 900;
    color: #FFD700;
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ===========================
   QUICK ACTIONS
   =========================== */
.user-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 28px;
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.15) 0%,
        rgba(255, 102, 0, 0.15) 100%);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 14px;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-align: center;
    overflow: hidden;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.quick-action-btn:hover::before {
    width: 300px;
    height: 300px;
}

.quick-action-btn:hover {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.3) 0%,
        rgba(255, 102, 0, 0.3) 100%);
    transform: translateX(-6px) scale(1.03);
    box-shadow:
        0 8px 30px rgba(255, 102, 0, 0.5),
        0 0 25px rgba(255, 215, 0, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 215, 0, 0.8);
}

.quick-action-btn i {
    font-size: 20px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.quick-action-btn:hover i {
    transform: scale(1.2) rotate(5deg);
}

.quick-action-btn span {
    position: relative;
    z-index: 1;
}

.logout-btn {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.2) 0%,
        rgba(185, 28, 28, 0.2) 100%) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

.logout-btn:hover {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.4) 0%,
        rgba(185, 28, 28, 0.4) 100%) !important;
    border-color: rgba(239, 68, 68, 0.8) !important;
    box-shadow:
        0 8px 30px rgba(239, 68, 68, 0.6),
        0 0 25px rgba(239, 68, 68, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.3) !important;
}

/* ===========================
   LOGIN SECTION (Not Logged In)
   =========================== */
.sidebar-login-menu {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 32px 24px;
    margin-bottom: 24px;
    animation: slideInFromRight 0.6s ease-out;
}

.sidebar-login-menu h4 {
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 24px;
}

.sidebar-wp-login-form .form-group {
    margin-bottom: 16px;
}

.sidebar-wp-login-form .form-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.sidebar-wp-login-form .form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sidebar-wp-login-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-wp-login-form .form-control:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: #FFD700;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.3);
}

.sidebar-wp-login-form .form-check-input {
    margin-right: 8px;
}

.sidebar-wp-login-form .form-check-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.forgot-password-link {
    color: #FFD700 !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: #ffffff !important;
}

.btn-main {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #FF6600 0%, #FF0000 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 102, 0, 0.4);
}

.btn-main:hover {
    background: linear-gradient(135deg, #FF0000 0%, #FF6600 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 102, 0, 0.6);
}

/* Login Divider */
.login-divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.login-divider::before {
    left: 0;
}

.login-divider::after {
    right: 0;
}

.login-divider span {
    background: transparent;
    padding: 0 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Social Login Buttons */
.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-discord,
.btn-social-login {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 12px 20px !important;
    background: #5865F2 !important;
    border: none !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.btn-discord:hover,
.btn-social-login:hover {
    background: #4752C4 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.4);
}

/* ===========================
   NAVIGATION MENU
   =========================== */
.offcanvas-menu {
    margin-top: 24px;
}

.offcanvas-nav-list {
    list-style: none;
    padding: 0 !important;
    margin: 0;
}

.offcanvas-nav-list .menu-item {
    margin-bottom: 8px;
}

.offcanvas-nav-list .menu-item a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.offcanvas-nav-list .menu-item a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-4px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 215, 0, 0.6);
}

/* ===========================
   TOGGLE BUTTON (3 Lines)
   =========================== */
.header-menu-toggle {
    position: fixed !important;
    top: 32px !important; /* Below admin bar */
    right: 20px !important;
    width: 64px !important;
    height: 64px !important;
    background: linear-gradient(135deg, #FFD700 0%, #FF6600 50%, #FF0000 100%) !important;
    border: 3px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 2147483647 !important; /* Maximum z-index value */
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    box-shadow:
        0 6px 25px rgba(255, 102, 0, 0.7),
        0 0 30px rgba(255, 215, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.3) !important;
    pointer-events: auto !important;
    animation: toggleButtonPulse 3s ease-in-out infinite;
}

@keyframes toggleButtonPulse {
    0%, 100% {
        box-shadow:
            0 6px 25px rgba(255, 102, 0, 0.7),
            0 0 30px rgba(255, 215, 0, 0.4),
            inset 0 2px 5px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow:
            0 8px 35px rgba(255, 102, 0, 0.9),
            0 0 45px rgba(255, 215, 0, 0.6),
            inset 0 2px 8px rgba(255, 255, 255, 0.5);
    }
}

.header-menu-toggle::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 22px;
    padding: 2px;
    background: linear-gradient(135deg, #FFD700, #FF6600, #FFD700);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.header-menu-toggle:hover::before {
    opacity: 1;
    animation: rotateBorder 2s linear infinite;
}

.header-menu-toggle:hover {
    background: linear-gradient(135deg, #FF0000 0%, #FF6600 50%, #FFD700 100%) !important;
    transform: scale(1.15) rotate(90deg) !important;
    box-shadow:
        0 10px 40px rgba(255, 102, 0, 1),
        0 0 50px rgba(255, 215, 0, 0.8),
        inset 0 2px 8px rgba(255, 255, 255, 0.5) !important;
}

.header-menu-toggle:active {
    transform: scale(1.05) rotate(90deg) !important;
}

.header-menu-toggle svg {
    width: 24px !important;
    height: 24px !important;
    fill: #ffffff !important;
    pointer-events: none !important; /* SVG should not capture clicks */
}

.header-menu-toggle svg * {
    pointer-events: none !important; /* All SVG children should not capture clicks */
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

/* Large Desktop (1920px+) */
@media screen and (min-width: 1920px) {
    .offcanvas-menu-wrap {
        width: 480px !important;
        right: -480px !important;
    }

    .header-menu-toggle {
        width: 70px !important;
        height: 70px !important;
    }
}

/* Desktop (1200px - 1919px) */
@media screen and (min-width: 1200px) and (max-width: 1919px) {
    .offcanvas-menu-wrap {
        width: 450px !important;
        right: -450px !important;
    }
}

/* Tablet Landscape (992px - 1199px) */
@media screen and (min-width: 992px) and (max-width: 1199px) {
    .offcanvas-menu-wrap {
        width: 400px !important;
        right: -400px !important;
    }

    .user-avatar-container {
        width: 120px !important;
        height: 120px !important;
    }

    .user-avatar-wrapper {
        width: 120px !important;
        height: 120px !important;
    }

    .user-level-badge {
        width: 50px !important;
        height: 50px !important;
    }
}

/* Tablet Portrait (768px - 991px) */
@media screen and (min-width: 768px) and (max-width: 991px) {
    .offcanvas-menu-wrap {
        width: 380px !important;
        right: -380px !important;
    }

    .header-menu-toggle {
        width: 60px !important;
        height: 60px !important;
        top: 20px !important;
        right: 15px !important;
    }

    .user-avatar-container {
        width: 110px !important;
        height: 110px !important;
    }

    .user-avatar-wrapper {
        width: 110px !important;
        height: 110px !important;
    }

    .user-level-badge {
        width: 45px !important;
        height: 45px !important;
    }

    .level-number {
        font-size: 18px !important;
    }

    .user-name {
        font-size: 20px !important;
    }
}

/* Mobile Landscape & Small Tablets (576px - 767px) */
@media screen and (min-width: 576px) and (max-width: 767px) {
    .offcanvas-menu-wrap {
        width: 90vw !important;
        max-width: 360px !important;
        right: -90vw !important;
    }

    .header-menu-toggle {
        width: 56px !important;
        height: 56px !important;
        top: 15px !important;
        right: 12px !important;
    }

    .user-avatar-container {
        width: 100px !important;
        height: 100px !important;
    }

    .user-avatar-wrapper {
        width: 100px !important;
        height: 100px !important;
    }

    .user-level-badge {
        width: 40px !important;
        height: 40px !important;
    }

    .level-number {
        font-size: 16px !important;
    }

    .user-name {
        font-size: 19px !important;
    }

    .stat-item {
        padding: 16px 10px !important;
    }

    .stat-icon {
        font-size: 24px !important;
    }

    .stat-value {
        font-size: 20px !important;
    }

    .quick-action-btn {
        padding: 14px 20px !important;
        font-size: 15px !important;
    }
}

/* Mobile Portrait (320px - 575px) */
@media screen and (max-width: 575px) {
    .offcanvas-menu-wrap {
        width: 100vw !important;
        right: -100vw !important;
        padding: 0 !important;
    }

    .offcanvas-body {
        padding: 70px 16px 16px !important;
    }

    .header-menu-toggle {
        width: 52px !important;
        height: 52px !important;
        top: 12px !important;
        right: 10px !important;
        border-radius: 16px !important;
    }

    .header-menu-toggle svg {
        width: 20px !important;
        height: 20px !important;
    }

    .offcanvas-icon {
        width: 40px !important;
        height: 40px !important;
        top: 15px !important;
        right: 15px !important;
    }

    .sidebar-user-info {
        padding: 24px 16px !important;
        border-radius: 16px !important;
        margin-bottom: 16px !important;
    }

    .user-avatar-container {
        width: 90px !important;
        height: 90px !important;
        margin-bottom: 16px !important;
    }

    .user-avatar-wrapper {
        width: 90px !important;
        height: 90px !important;
    }

    .user-level-badge {
        width: 36px !important;
        height: 36px !important;
        bottom: -8px !important;
        right: -8px !important;
    }

    .level-number {
        font-size: 14px !important;
    }

    .user-name {
        font-size: 18px !important;
        margin-bottom: 4px !important;
    }

    .rank-text {
        font-size: 12px !important;
        letter-spacing: 1px !important;
    }

    .xp-label {
        font-size: 11px !important;
    }

    .xp-numbers {
        font-size: 12px !important;
    }

    .user-stats-grid {
        gap: 8px !important;
        margin-bottom: 16px !important;
    }

    .stat-item {
        padding: 14px 8px !important;
        border-radius: 14px !important;
    }

    .stat-icon {
        font-size: 22px !important;
        margin-bottom: 6px !important;
    }

    .stat-value {
        font-size: 18px !important;
    }

    .stat-label {
        font-size: 11px !important;
    }

    .user-quick-actions {
        gap: 10px !important;
    }

    .quick-action-btn {
        padding: 12px 16px !important;
        font-size: 14px !important;
        border-radius: 12px !important;
    }

    .quick-action-btn i {
        font-size: 18px !important;
    }
}

/* Extra Small Mobile (320px - 374px) */
@media screen and (max-width: 374px) {
    .user-avatar-container {
        width: 80px !important;
        height: 80px !important;
    }

    .user-avatar-wrapper {
        width: 80px !important;
        height: 80px !important;
    }

    .user-level-badge {
        width: 32px !important;
        height: 32px !important;
    }

    .level-number {
        font-size: 12px !important;
    }

    .user-name {
        font-size: 16px !important;
    }

    .stat-value {
        font-size: 16px !important;
    }

    .quick-action-btn {
        padding: 10px 14px !important;
        font-size: 13px !important;
    }
}

/* WordPress Admin Bar Adjustments */
@media screen and (max-width: 782px) {
    .admin-bar .header-menu-toggle {
        top: 46px !important; /* Below mobile admin bar */
    }
}

@media screen and (min-width: 783px) {
    .admin-bar .header-menu-toggle {
        top: 32px !important; /* Below desktop admin bar */
    }
}

/* High DPI Displays (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .user-avatar {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===========================
   BACKDROP/OVERLAY
   =========================== */
.offcanvas-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 99998 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
}

.offcanvas-backdrop.show {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ===========================
   ADDITIONAL FEATURES
   =========================== */

/* Loading Spinner for Stats */
.stat-item.loading .stat-value {
    animation: statPulse 1s ease-in-out infinite;
}

@keyframes statPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Notification Badge (für zukünftige Features) */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    animation: notificationPulse 2s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* ===========================
   ENHANCED MICRO-INTERACTIONS
   =========================== */

/* Username and Rank Enhancement */
.user-name {
    color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    text-align: center !important;
    margin-bottom: 6px !important;
    text-shadow:
        0 2px 10px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.3) !important;
    background: linear-gradient(135deg, #ffffff 0%, #FFD700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: userNameGlow 3s ease-in-out infinite;
}

@keyframes userNameGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
    }
}

.user-rank {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin-bottom: 20px !important;
}

.user-rank-discord .fab.fa-discord {
    color: #5865F2 !important;
    font-size: 16px !important;
    animation: discordPulse 2s ease-in-out infinite;
}

@keyframes discordPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px rgba(88, 101, 242, 0.5));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 10px rgba(88, 101, 242, 0.8));
    }
}

.rank-text {
    color: #FFD700 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

/* Level Number Enhancement */
.level-number {
    font-size: 20px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(255, 215, 0, 0.5) !important;
}

/* XP Text Enhancement */
.xp-numbers {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #FFD700 !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
    letter-spacing: 0.5px !important;
}

.xp-label {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 8px !important;
}

/* ===========================
   GLASSMORPHISM ENHANCEMENT
   =========================== */

/* Add subtle grain texture for premium feel */
.offcanvas-menu-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.03"/></svg>');
    pointer-events: none;
    opacity: 0.5;
    z-index: 1;
}

.offcanvas-body {
    position: relative;
    z-index: 2;
}

/* ===========================
   SMOOTH SCROLL ENHANCEMENT
   =========================== */

.offcanvas-menu-wrap {
    scroll-behavior: smooth;
}

/* ===========================
   HOVER GLOW EFFECTS
   =========================== */

/* Add glow to interactive elements on hover */
.quick-action-btn:active {
    transform: translateX(-8px) scale(0.98) !important;
    transition: transform 0.1s ease !important;
}

.stat-item:active {
    transform: translateY(-6px) scale(1.05) !important;
    transition: transform 0.1s ease !important;
}

/* ===========================
   ENHANCED ANIMATIONS
   =========================== */

/* Stagger animation for stats */
.stat-item:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-item:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-item:nth-child(3) {
    animation-delay: 0.3s;
}

/* Quick actions stagger */
.quick-action-btn:nth-child(1) {
    animation: slideInLeft 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s backwards;
}

.quick-action-btn:nth-child(2) {
    animation: slideInLeft 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s backwards;
}

.quick-action-btn:nth-child(3) {
    animation: slideInLeft 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.4s backwards;
}

.quick-action-btn:nth-child(4) {
    animation: slideInLeft 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.5s backwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===========================
   PREMIUM SHINE EFFECT
   =========================== */

/* Add occasional shine sweep across sidebar */
@keyframes premiumShine {
    0% {
        left: -100%;
    }
    20%, 100% {
        left: 200%;
    }
}

.sidebar-user-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: premiumShine 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
}

/* ===========================
   FOCUS STATES FOR ACCESSIBILITY
   =========================== */

.header-menu-toggle:focus,
.offcanvas-icon:focus,
.quick-action-btn:focus,
.stat-item:focus {
    outline: 3px solid rgba(255, 215, 0, 0.8) !important;
    outline-offset: 3px !important;
}

.sidebar-wp-login-form .form-control:focus {
    outline: 2px solid rgba(255, 215, 0, 0.6) !important;
    outline-offset: 2px !important;
}

/* ===========================
   PERFORMANCE OPTIMIZATIONS
   =========================== */

/* Use GPU acceleration for smoother animations */
.header-menu-toggle,
.offcanvas-menu-wrap,
.offcanvas-backdrop,
.stat-item,
.quick-action-btn,
.user-avatar-wrapper,
.user-level-badge {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===========================
   DARK MODE SUPPORT (Optional)
   =========================== */

@media (prefers-color-scheme: dark) {
    .offcanvas-menu-wrap {
        /* Already optimized for dark backgrounds */
    }
}

/* ===========================
   REDUCED MOTION SUPPORT
   =========================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================
   PRINT STYLES
   =========================== */

@media print {
    .header-menu-toggle,
    .offcanvas-menu-wrap,
    .offcanvas-backdrop {
        display: none !important;
    }
}

/* ===========================
   END OF ULTIMATE SIDEBAR STYLES
   =========================== */
