/**
 * Expansion Info - Menu & Sidebar Styles
 * Glassmorphism accordion design
 */

/* ==========================================
   SIDEBAR & ACCORDION CONTAINER
   ========================================== */

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 0 0 320px;
    max-width: 320px;
    overflow-x: hidden;
}

/* Main Accordion Section (Pre-patch, Midnight, etc.) */
.accordion-section {
    margin-bottom: 0.5rem;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-section.active {
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    background: rgba(15, 23, 42, 0.6);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s;
}

.accordion-header:hover {
    background: rgba(139, 92, 246, 0.1);
}

.accordion-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative; /* For absolute positioned badges */
}

.accordion-icon {
    font-size: 1.2rem;
}

.accordion-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #e2e8f0;
}

.accordion-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s;
    opacity: 0.5;
}

.accordion-section.active .accordion-arrow {
    transform: rotate(180deg);
}

/* Accordion Content (Categories) */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.2);
}

.accordion-section.active .accordion-content {
    max-height: 2000px;
    /* Large enough to fit content */
    padding: 1rem;
}

/* ==========================================
   CATEGORY & ARTICLE STYLES
   ========================================== */

.menu-category {
    margin-bottom: 0.8rem;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.4rem;
}

.category-header:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: translateX(5px);
}

.category-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.category-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fca5a5;
}

.category-count {
    background: rgba(239, 68, 68, 0.4);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.category-articles {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-left: 0.8rem;
    max-height: 1000px;
    overflow-y: visible;
    transition: all 0.3s ease;
}

.menu-category.collapsed .category-articles {
    max-height: 0;
    overflow: hidden;
    padding: 0;
}

.article-link {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: rgba(15, 20, 35, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    color: #cbd5e1;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-height: 44px;
    width: 100%;
}

.article-link:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateX(4px);
    color: #fff;
}

.article-link.active {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
    color: #e9d5ff;
    font-weight: 600;
}

.article-title {
    flex: 1;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-date {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    align-self: flex-start;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

/* Sidebar Info (Modules) */
.sidebar-module-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    margin-top: 0.5rem;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.sidebar-module-link:hover,
.sidebar-module-link.active {
    background: rgba(34, 197, 94, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.6);
}

/* Live Badge Styling */
.live-badge {
    background: #22c55e;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
    animation: live-pulse 2s infinite ease-in-out;
    letter-spacing: 0.5px;
    margin-left: 0.5rem;
    display: inline-block;
    vertical-align: middle;
    text-transform: uppercase;
}

@keyframes live-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 10px 4px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .sidebar-menu {
        flex: 1;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar-menu {
        padding: 0;
    }

    .article-link {
        padding: 0.8rem;
    }
}