/* ─── RepoLens Design System – Midnight Paper Editorial ─── */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background-color: #000000;
    color: #e2e2e2;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* Material Symbols */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* ─── Glass Panel ─── */
.glass-panel {
    background: rgba(14, 14, 14, 0.6);
    backdrop-filter: blur(20px);
}

/* ─── Editorial Shadow ─── */
.editorial-shadow {
    box-shadow: 0 0 60px rgba(206, 189, 255, 0.04);
}

/* ─── Scrollbar ─── */
.custom-scrollbar::-webkit-scrollbar { width: 2px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(206, 189, 255, 0.1); }

/* ─── Code Glow ─── */
.code-glow {
    text-shadow: 0 0 15px rgba(206, 189, 255, 0.2);
}

/* ─── Status Indicators ─── */
.status-glow-green {
    box-shadow: 0 0 8px #69dabd;
}
.status-glow-pulse {
    box-shadow: 0 0 8px #ffba35;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ─── Sweeping Line ─── */
.sweeping-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, #cebdff, transparent);
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
}

/* ─── Animations ─── */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
@keyframes sweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(1.2); }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fadeIn 0.5s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.6s ease-out forwards; }

/* ─── Modal Overlay ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal-box {
    background: #1b1b1b;
    border: 1px solid rgba(255,255,255,0.05);
    padding: 2.5rem;
    width: 100%;
    max-width: 520px;
    position: relative;
}

/* ─── Toast Notification ─── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 200;
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast.success { background: #0e0e0e; color: #69dabd; border-color: rgba(105,218,189,0.15); }
.toast.error   { background: #0e0e0e; color: #ffb4ab; border-color: rgba(255,180,171,0.15); }
.toast.info    { background: #0e0e0e; color: #cebdff; border-color: rgba(206,189,255,0.15); }

/* ─── Loading Skeleton ─── */
.skeleton {
    background: linear-gradient(90deg, #1b1b1b 25%, #2a2a2a 50%, #1b1b1b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 2px;
}

/* ─── Markdown rendered content ─── */
.md-content h1, .md-content h2, .md-content h3, .md-content h4 { color: #cebdff; margin: 1.5rem 0 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.75rem; }
.md-content p { color: #cbc3d7; line-height: 1.8; margin-bottom: 1rem; }
.md-content code { background: rgba(105,218,189,0.1); color: #69dabd; padding: 0.1rem 0.35rem; font-size: 0.85em; }
.md-content pre { background: #0e0e0e; padding: 1rem; overflow-x: auto; margin: 1rem 0; font-size: 0.8rem; border-left: 2px solid rgba(206,189,255,0.15); }
.md-content pre code { background: none; padding: 0; color: #a9b1d6; }
.md-content ul, .md-content ol { padding-left: 1.5rem; margin-bottom: 1rem; color: #cbc3d7; }
.md-content li { margin-bottom: 0.4rem; line-height: 1.6; }
.md-content strong { color: #e2e2e2; }
.md-content em { font-style: italic; }
.md-content hr { border: 0; border-top: 1px solid rgba(255,255,255,0.06); margin: 1.75rem 0; }
.md-content .md-step { display: grid; grid-template-columns: 1.75rem 1fr; gap: 0.75rem; color: #cbc3d7; line-height: 1.8; margin: 0.8rem 0; }
.md-content .md-step > span { color: #69dabd; font-size: 0.7rem; font-weight: 700; padding-top: 0.3rem; }

/* ─── Collapsible Sidebar ─── */
aside {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, min-width 0.3s ease;
    flex-shrink: 0;
}
aside.sidebar-collapsed {
    width: 4.5rem !important;
    min-width: 4.5rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}
aside.sidebar-collapsed span:not(.material-symbols-outlined) {
    display: none !important;
}
aside.sidebar-collapsed button span:not(.material-symbols-outlined) {
    display: none !important;
}
aside.sidebar-collapsed button {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    text-align: center !important;
    font-size: 0 !important;
}
aside.sidebar-collapsed a {
    justify-content: center !important;
    padding-left: 0 !important;
    font-size: 0 !important;
}
aside.sidebar-collapsed .material-symbols-outlined {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

@media (max-width: 767px) {
    #sidebar.sidebar-mobile-open {
        display: flex !important;
        position: fixed !important;
        top: 5rem;
        left: 0;
        z-index: 45;
        width: 16rem !important;
        height: calc(100vh - 5rem) !important;
    }

    body.sidebar-mobile-active::before {
        content: "";
        position: fixed;
        inset: 5rem 0 0 0;
        z-index: 44;
        background: rgba(0, 0, 0, 0.72);
        backdrop-filter: blur(2px);
    }
}
