/**
 * Offcanvas Sidebar with Toggle Button
 * Professional implementation for Team Exciting
 */

/* ============================================
   SIDEBAR TOGGLE BUTTON (Hamburger)
   ============================================ */
.sidebar-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, #25C6DA, #1a9aa8);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(37, 198, 218, 0.4);
    transition: all 0.3s ease;
}

.sidebar-toggle-btn:hover {
    background: linear-gradient(145deg, #2dd4e8, #25C6DA);
    box-shadow: 0 6px 20px rgba(37, 198, 218, 0.6);
    transform: translateY(-2px);
}

.sidebar-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(37, 198, 218, 0.4);
}

/* Hamburger Lines */
.sidebar-toggle-btn span {
    display: block;
    width: 26px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Animated X when sidebar is open */
.sidebar-toggle-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.sidebar-toggle-btn.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.sidebar-toggle-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   OFFCANVAS SIDEBAR
   ============================================ */
.offcanvas-sidebar-wrapper {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(145deg, rgba(15, 15, 15, 0.98), rgba(25, 25, 25, 0.98));
    z-index: 99998;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
    border-left: 2px solid rgba(37, 198, 218, 0.3);
}

.offcanvas-sidebar-wrapper.active {
    right: 0;
}

/* Sidebar Header */
.offcanvas-sidebar-header {
    position: sticky;
    top: 0;
    background: rgba(10, 10, 10, 0.95);
    padding: 20px 25px;
    border-bottom: 2px solid rgba(37, 198, 218, 0.3);
    z-index: 10;
    backdrop-filter: blur(10px);
    margin: 0; /* Kein Margin */
}

.offcanvas-sidebar-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #25C6DA;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Sidebar Content */
.offcanvas-sidebar-content {
    padding: 0; /* Kein Padding, damit Header ganz oben ist */
}

/* Padding nur für die inneren Elemente nach dem Header */
.offcanvas-sidebar-content > *:not(.offcanvas-sidebar-header) {
    padding-left: 25px;
    padding-right: 25px;
}

.offcanvas-sidebar-content > *:first-child:not(.offcanvas-sidebar-header) {
    padding-top: 25px;
}

.offcanvas-sidebar-content > *:last-child {
    padding-bottom: 25px;
}

/* Style the widgets inside sidebar */
.offcanvas-sidebar-content .widget {
    background: rgba(30, 30, 30, 0.6);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid rgba(37, 198, 218, 0.2);
    transition: all 0.3s ease;
}

.offcanvas-sidebar-content .widget:hover {
    background: rgba(35, 35, 35, 0.8);
    border-color: rgba(37, 198, 218, 0.4);
    box-shadow: 0 4px 15px rgba(37, 198, 218, 0.1);
}

.offcanvas-sidebar-content .widget-title {
    color: #25C6DA;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(37, 198, 218, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   USER PROFILE SECTION - Complete Profile Card
   ============================================ */
.sidebar-user-profile {
    background: linear-gradient(145deg, rgba(30, 30, 30, 0.95), rgba(20, 20, 20, 0.95));
    border: 2px solid rgba(37, 198, 218, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Avatar Section */
.sidebar-user-avatar {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #25C6DA;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(37, 198, 218, 0.4);
}

.sidebar-user-level {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #25C6DA, #1a9aa8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #0f0f0f;
    box-shadow: 0 2px 10px rgba(37, 198, 218, 0.5);
}

.sidebar-user-level span {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

/* User Info */
.sidebar-user-info {
    text-align: center;
    margin-bottom: 15px;
}

.sidebar-user-name {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* XP Bar */
.sidebar-user-xp {
    margin-top: 10px;
}

.sidebar-xp-bar {
    width: 100%;
    height: 8px;
    background: rgba(40, 40, 40, 0.8);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.sidebar-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #25C6DA, #2dd4e8);
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(37, 198, 218, 0.6);
    position: relative;
}

.sidebar-xp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.sidebar-xp-text {
    margin-top: 5px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

/* User Links */
.sidebar-user-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(37, 198, 218, 0.2);
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(40, 40, 40, 0.6);
    border: 1px solid rgba(37, 198, 218, 0.2);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sidebar-link:hover {
    background: rgba(37, 198, 218, 0.1);
    border-color: #25C6DA;
    color: #25C6DA;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 198, 218, 0.2);
}

.sidebar-link svg {
    flex-shrink: 0;
}

.sidebar-link-steam {
    border-color: rgba(102, 192, 244, 0.3);
}

.sidebar-link-steam:hover {
    border-color: #66c0f4;
    color: #66c0f4;
    background: rgba(102, 192, 244, 0.1);
}

.sidebar-link-discord {
    border-color: rgba(88, 101, 242, 0.3);
}

.sidebar-link-discord:hover {
    border-color: #5865F2;
    color: #5865F2;
    background: rgba(88, 101, 242, 0.1);
}

.sidebar-link-logout {
    border-color: rgba(255, 82, 82, 0.3);
    grid-column: span 2;
}

.sidebar-link-logout:hover {
    border-color: #ff5252;
    color: #ff5252;
    background: rgba(255, 82, 82, 0.1);
}

/* User Activity Section */
.sidebar-user-activity {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(37, 198, 218, 0.2);
}

.sidebar-activity-title {
    color: #25C6DA;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px 0;
}

.sidebar-activity-section {
    margin-bottom: 12px;
}

.sidebar-activity-section h5 {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 6px 0;
}

.sidebar-activity-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(35, 35, 35, 0.4);
    border-radius: 4px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
}

.sidebar-activity-item:hover {
    background: rgba(40, 40, 40, 0.8);
    color: #25C6DA;
    transform: translateX(5px);
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-match {
    background: #4caf50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

.activity-tournament {
    background: #ff9800;
    box-shadow: 0 0 6px rgba(255, 152, 0, 0.6);
}

.activity-game {
    background: #9c27b0;
    box-shadow: 0 0 6px rgba(156, 39, 176, 0.6);
}

/* ============================================
   DISCORD LOGIN WIDGET - Professional Design
   ============================================ */
.offcanvas-sidebar-content .mo_discord_login_wid {
    text-align: center;
    padding: 25px 20px;
}

.offcanvas-sidebar-content .mo_discord_login_wid a {
    display: inline-block;
    width: 100%;
    padding: 14px 30px;
    background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
    position: relative;
    overflow: hidden;
}

.offcanvas-sidebar-content .mo_discord_login_wid a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.offcanvas-sidebar-content .mo_discord_login_wid a:hover {
    background: linear-gradient(135deg, #4752C4 0%, #3c45a3 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

.offcanvas-sidebar-content .mo_discord_login_wid a:hover::before {
    left: 100%;
}

.offcanvas-sidebar-content .mo_discord_login_wid a:active {
    transform: translateY(-1px);
}

/* ============================================
   COLOR SCHEME SELECTOR - Compact Dropdown
   ============================================ */
.offcanvas-sidebar-content #te-color-scheme-selector {
    background: rgba(25, 25, 25, 0.8);
    padding: 20px;
    border-radius: 8px;
}

/* Hide the large button grid */
.offcanvas-sidebar-content .te-color-scheme-grid {
    display: none !important;
}

/* Create custom select dropdown */
.offcanvas-sidebar-content .te-color-scheme-select-wrapper {
    position: relative;
    width: 100%;
}

.offcanvas-sidebar-content .te-color-scheme-select {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: rgba(40, 40, 40, 0.9);
    border: 2px solid rgba(37, 198, 218, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.3s ease;
}

.offcanvas-sidebar-content .te-color-scheme-select:hover {
    border-color: rgba(37, 198, 218, 0.6);
    background: rgba(45, 45, 45, 0.9);
}

.offcanvas-sidebar-content .te-color-scheme-select:focus {
    outline: none;
    border-color: #25C6DA;
    box-shadow: 0 0 0 3px rgba(37, 198, 218, 0.2);
}

/* Custom dropdown arrow */
.offcanvas-sidebar-content .te-color-scheme-select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #25C6DA;
    pointer-events: none;
    font-size: 12px;
}

/* Style the option colors */
.offcanvas-sidebar-content .te-color-scheme-select option {
    background: #1a1a1a;
    color: #fff;
    padding: 10px;
}

/* Color preview indicator */
.offcanvas-sidebar-content .te-color-scheme-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(30, 30, 30, 0.6);
    border-radius: 6px;
}

.offcanvas-sidebar-content .te-color-scheme-preview-swatch {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.offcanvas-sidebar-content .te-color-scheme-preview-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

/* ============================================
   UPCOMING MATCHES WIDGET - Enhanced
   ============================================ */
.offcanvas-sidebar-content .te_upcoming_matches {
    padding: 18px;
}

.offcanvas-sidebar-content .te_upcoming_matches .match-item {
    background: rgba(35, 35, 35, 0.6);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 3px solid #25C6DA;
    transition: all 0.3s ease;
}

.offcanvas-sidebar-content .te_upcoming_matches .match-item:hover {
    background: rgba(40, 40, 40, 0.8);
    border-left-color: #2dd4e8;
    transform: translateX(5px);
}

.offcanvas-sidebar-content .te_upcoming_matches .match-date {
    color: #25C6DA;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.offcanvas-sidebar-content .te_upcoming_matches .match-teams {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.offcanvas-sidebar-content .te_upcoming_matches .match-vs {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin: 0 5px;
}

/* ============================================
   LIST STYLES - Better Typography
   ============================================ */
.offcanvas-sidebar-content ul,
.offcanvas-sidebar-content ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.offcanvas-sidebar-content li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.offcanvas-sidebar-content li:last-child {
    border-bottom: none;
}

.offcanvas-sidebar-content a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.offcanvas-sidebar-content a:hover {
    color: #25C6DA;
    transform: translateX(5px);
}

/* ============================================
   COMPACT WIDGET SPACING
   ============================================ */
.offcanvas-sidebar-content .widget {
    padding: 15px;
    margin-bottom: 15px;
}

.offcanvas-sidebar-content .widget-title {
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
}

/* ============================================
   OVERLAY (Background Dimming)
   ============================================ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   PREVENT BODY SCROLL WHEN SIDEBAR IS OPEN
   ============================================ */
body.sidebar-open {
    overflow: hidden;
}

/* ============================================
   SCROLLBAR STYLING FOR SIDEBAR
   ============================================ */
.offcanvas-sidebar-wrapper::-webkit-scrollbar {
    width: 8px;
}

.offcanvas-sidebar-wrapper::-webkit-scrollbar-track {
    background: rgba(20, 20, 20, 0.5);
}

.offcanvas-sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(37, 198, 218, 0.5);
    border-radius: 4px;
}

.offcanvas-sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 198, 218, 0.7);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .sidebar-toggle-btn {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }

    .offcanvas-sidebar-wrapper {
        width: 320px;
    }

    .offcanvas-sidebar-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .sidebar-toggle-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .sidebar-toggle-btn span {
        width: 22px;
        height: 2px;
    }

    .offcanvas-sidebar-wrapper {
        width: 280px;
    }
}

/* ============================================
   WORDPRESS ADMIN BAR SUPPORT
   ============================================ */
body.admin-bar .sidebar-toggle-btn {
    top: 52px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .sidebar-toggle-btn {
        top: 56px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.offcanvas-sidebar-wrapper.active {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Widget fade-in animation */
.offcanvas-sidebar-content .widget {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.offcanvas-sidebar-wrapper.active .widget {
    opacity: 1;
    transform: translateX(0);
}

.offcanvas-sidebar-wrapper.active .widget:nth-child(1) {
    transition-delay: 0.1s;
}

.offcanvas-sidebar-wrapper.active .widget:nth-child(2) {
    transition-delay: 0.2s;
}

.offcanvas-sidebar-wrapper.active .widget:nth-child(3) {
    transition-delay: 0.3s;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.sidebar-toggle-btn:focus,
.offcanvas-sidebar-wrapper:focus-within {
    outline: 2px solid #25C6DA;
    outline-offset: 2px;
}

/* Screen reader text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
