/* ============================================
   SIDEBAR - VERSÃO RECRIADA SEM SCROLLBAR
   ============================================ */

/* Sidebar Container */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 244px;
    height: 100vh;
    background: #121a30;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 999;
    transform: translateX(0);
    transition: transform 0.3s ease;
    overflow: hidden;
    user-select: none;
}

.sidebar.closed {
    transform: translateX(-100%);
}

.sidebar-content {
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Top Buttons - Banners Promocionais */
.sidebar-top-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.sidebar-top-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    font-size: 0.8rem;
    font-weight: 600;
    width: 100%;
    height: 60px;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-top-btn .sidebar-btn-badge {
    display: none;
}

.sidebar-top-btn:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.sidebar-top-btn.has-image {
    padding: 0;
    min-height: 50px;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.sidebar-top-btn.has-image .sidebar-btn-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    border-radius: 12px;
}

.sidebar-top-btn.has-image .sidebar-btn-title {
    position: relative;
    z-index: 2;
    color: var(--text-light, #ffffff);
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 15px;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

.sidebar-btn-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-btn-title {
    flex: 1;
}

.sidebar-btn-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent-red);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    z-index: 3;
}

/* Promoção Buttons - Botões Individuais */
.sidebar-promo-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.sidebar-promo-buttons .promo-btn {
    width: 100%;
    padding: 10px 5px;
    height: auto;
    min-height: auto;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1), 0 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    overflow: hidden;
    gap: 6px;
    font-size: 0.85rem;
    text-transform: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-promo-buttons .promo-btn:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    transform: translateX(2px);
}

.sidebar-promo-buttons .promo-btn .sidebar-btn-badge {
    display: none;
}

.sidebar-promo-buttons .promo-btn .sidebar-btn-image {
    border-radius: 8px;
}

.sidebar-promo-buttons .promo-btn .sidebar-btn-image {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    object-fit: contain;
    margin: 0;
}

.sidebar-promo-buttons .promo-btn .sidebar-btn-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: inherit;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

/* Promoção Section - No meio, depois dos botões do topo */
.sidebar-section {
    margin-top: 0;
    flex-shrink: 0;
}

.promo-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 8px;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.promo-container .sidebar-section-header {
    border-radius: 8px 8px 0 0;
}

.promo-container .sidebar-section-header.collapsed {
    border-bottom: none;
    border-radius: 8px;
}

.sidebar-section-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-section-header i:first-child {
    color: #4a9eff;
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.sidebar-section-header .section-title {
    flex: 1;
    color: var(--text-light, #ffffff);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: lowercase;
    letter-spacing: 0.3px;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.sidebar-section-header .section-toggle {
    color: var(--text-muted, #888);
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.sidebar-section-header.collapsed .section-toggle {
    transform: rotate(180deg);
}

.sidebar-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.promo-container .sidebar-section-content {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 0 8px 8px;
}

.sidebar-section-header:not(.collapsed) + .sidebar-section-content {
    max-height: 1000px;
    opacity: 1;
    margin: 0;
    padding: 0;
}

/* Download e Language - Abaixo dos botões de promoção */
.sidebar-download,
.sidebar-language {
    margin-top: 0;
    position: relative;
    z-index: 1;
}

.sidebar-submenu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 20px;
    color: var(--text-light, #ffffff);
    text-decoration: none;
    border-radius: 0;
    transition: all 0.3s;
    font-size: 0.8rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1), 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
}

.sidebar-submenu-item:last-child {
    border-bottom: none;
}

.sidebar-submenu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 25px;
}

.sidebar-submenu-item:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.promo-icon-image {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Download APP Button - Abaixo da promoção */
.sidebar-download {
    margin-top: 0;
    padding-top: 8px;
    flex-shrink: 0;
    transition: margin-top 0.3s ease;
}

.sidebar-download-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-light, #ffffff);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1), 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
}

.sidebar-download-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.download-icon-image {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-download-btn .download-text {
    flex: 1;
}

.download-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    font-size: 0;
    font-weight: 700;
    padding: 5px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
}

.download-badge::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #ff4444;
}

.badge-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.badge-coin {
    font-size: 0.65rem;
    color: #FFD700;
}

/* Language Selector - Abaixo da promoção */
.sidebar-language {
    margin-top: 0;
    padding-top: 8px;
    position: relative;
    flex-shrink: 0;
    transition: margin-top 0.3s ease;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: none;
}

.language-selector:hover {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.2);
}

.language-flag {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.language-text {
    flex: 1;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.language-toggle {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform 0.3s;
}

.language-selector.active .language-toggle {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 10px;
    background: linear-gradient(135deg, rgba(26, 31, 58, 0.98) 0%, rgba(20, 25, 45, 0.98) 100%);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 10px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.language-selector.active + .language-dropdown,
.language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-light);
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.2) 0%, rgba(37, 99, 235, 0.05) 100%);
    padding-left: 20px;
}

.language-option:hover .language-flag {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.language-option .language-flag {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

/* Main Content Adjustment */
.dashboard-main {
    transition: margin-left 0.3s ease;
    margin-left: 0;
}

.sidebar:not(.closed) ~ .dashboard-main {
    margin-left: 244px;
}

.sidebar.closed ~ .dashboard-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Sidebar Resize Handle */
.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    cursor: ew-resize;
    z-index: 1000;
    transition: background 0.2s;
}

.sidebar-resize-handle:hover {
    background: rgba(37, 99, 235, 0.5);
}

.sidebar-resize-handle.active {
    background: rgba(37, 99, 235, 0.8);
}

/* Sidebar Overlay - Mobile */
.sidebar-overlay {
    display: none;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 767px) {
    .sidebar {
        width: 228px;
        transform: translateX(-100%);
        z-index: 1001;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar.closed {
        transform: translateX(-100%);
    }
    
    .sidebar-content {
        padding: 10px 15px;
        gap: 6px;
    }
    
    .sidebar-top-btn {
        padding: 8px 15px;
        height: 55px;
        font-size: 0.75rem;
    }
    
    .sidebar-section-header {
        padding: 8px 15px;
        font-size: 0.75rem;
    }
    
    .sidebar-submenu-item {
        padding: 6px 15px;
        font-size: 0.75rem;
    }
    
    .sidebar-download-btn {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
    
    .language-selector {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
    
    .dashboard-main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .sidebar.active ~ .dashboard-main {
        margin-left: 0 !important;
    }
    
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        pointer-events: none;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}
